answer
stringlengths
15
1.25M
using NSubstitute; using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using Xunit; using Xunit.Abstractions; namespace PoshGit2.TabCompletion { public class TabCompletionTests { private readonly ITestOutputHelper _log; public TabCompletionTests(ITestOutputHelper log) { _log = log; } [InlineData("gi")] [InlineData("git")] [InlineData("git.")] [InlineData("git.exe")] [Theory] public async Task GitCommand(string cmd) { var repo = Substitute.For<IRepositoryStatus>(); var completer = new TabCompleter(Task.FromResult(repo)); var result = await completer.CompleteAsync(cmd, CancellationToken.None); Assert.True(result.IsFailure); } [InlineData("git ", new string[] { "clone", "init" })] [Theory] public async Task NullStatus(string command, string[] expected) { var completer = new TabCompleter(Task.FromResult<IRepositoryStatus>(null)); var fullResult = await completer.CompleteAsync(command, CancellationToken.None); var result = GetResult(fullResult); Assert.Equal(result, expected.OrderBy(o => o, StringComparer.Ordinal)); } [InlineData("git add ", new string[] { })] [InlineData("git rm ", new string[] { })] [Theory] public async Task EmptyStatus(string command, string[] expected) { var repo = Substitute.For<IRepositoryStatus>(); var completer = new TabCompleter(Task.FromResult(repo)); var fullResult = await completer.CompleteAsync(command, CancellationToken.None); var result = GetResult(fullResult); Assert.Equal(result, expected.OrderBy(o => o, StringComparer.Ordinal)); } [InlineData("git ", "stash")] [InlineData("git s", "stash")] [InlineData("git ", "push")] [InlineData("git p", "push")] [InlineData("git ", "pull")] [InlineData("git p", "pull")] [InlineData("git ", "bisect")] [InlineData("git bis", "bisect")] [InlineData("git ", "branch")] [InlineData("git br", "branch")] [InlineData("git ", "add")] [InlineData("git a", "add")] [InlineData("git ", "rm")] [InlineData("git r", "rm")] [InlineData("git ", "merge")] [InlineData("git m", "merge")] [InlineData("git ", "mergetool")] [InlineData("git m", "mergetool")] [Theory] public async Task ResultContains(string command, string expected) { var completer = CreateTabCompleter(); var fullResult = await completer.CompleteAsync(command, CancellationToken.None); var result = GetResult(fullResult); Assert.Contains(expected, result); } // Verify command completion [InlineData("git ", new[] { "add", "am", "annotate", "archive", "bisect", "blame", "branch", "bundle", "checkout", "cherry", "cherry-pick", "citool", "clean", "clone", "commit", "config", "describe", "diff", "difftool", "fetch", "format-patch", "gc", "grep", "gui", "help", "init", "instaweb", "log", "merge", "mergetool", "mv", "notes", "prune", "pull", "push", "rebase", "reflog", "remote", "rerere", "reset", "revert", "rm", "shortlog", "show", "stash", "status", "submodule", "svn", "tag", "whatchanged" })] [InlineData("git.exe ", new[] { "add", "am", "annotate", "archive", "bisect", "blame", "branch", "bundle", "checkout", "cherry", "cherry-pick", "citool", "clean", "clone", "commit", "config", "describe", "diff", "difftool", "fetch", "format-patch", "gc", "grep", "gui", "help", "init", "instaweb", "log", "merge", "mergetool", "mv", "notes", "prune", "pull", "push", "rebase", "reflog", "remote", "rerere", "reset", "revert", "rm", "shortlog", "show", "stash", "status", "submodule", "svn", "tag", "whatchanged" })] // git add [InlineData("git add ", new[] { "working-duplicate", "working-modified", "working-added", "working-unmerged" })] [InlineData("git add working-m", new[] { "working-modified" })] // git rm [InlineData("git rm ", new[] { "working-deleted", "working-duplicate" })] [InlineData("git rm working-a", new string[] { })] [InlineData("git rm working-d", new string[] { "working-deleted", "working-duplicate" })] // git bisect [InlineData("git bisect ", new[] { "start", "bad", "good", "skip", "reset", "visualize", "replay", "log", "run" })] [InlineData("git bisect s", new[] { "start", "skip" })] [InlineData("git bisect bad ", new string[] { "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git bisect good ", new string[] { "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git bisect reset ", new string[] { "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git bisect skip ", new string[] { "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git bisect bad f", new string[] { "feature1", "feature2" })] [InlineData("git bisect good f", new string[] { "feature1", "feature2" })] [InlineData("git bisect reset f", new string[] { "feature1", "feature2" })] [InlineData("git bisect skip f", new string[] { "feature1", "feature2" })] [InlineData("git bisect bad g", new string[] { })] [InlineData("git bisect good g", new string[] { })] [InlineData("git bisect reset g", new string[] { })] [InlineData("git bisect skip g", new string[] { })] [InlineData("git bisect skip H", new string[] { "HEAD" })] // git notes [InlineData("git notes ", new[] { "edit", "show" })] [InlineData("git notes e", new[] { "edit" })] // git reflog [InlineData("git reflog ", new[] { "expire", "delete", "show" })] [InlineData("git reflog e", new[] { "expire" })] // git branch [InlineData("git branch -d ", new string[] { "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git branch -D ", new string[] { "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git branch -m ", new string[] { "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git branch -M ", new string[] { "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git branch -d f", new string[] { "feature1", "feature2" })] [InlineData("git branch -D f", new string[] { "feature1", "feature2" })] [InlineData("git branch -m f", new string[] { "feature1", "feature2" })] [InlineData("git branch -M f", new string[] { "feature1", "feature2" })] [InlineData("git branch -d g", new string[] { })] [InlineData("git branch -D g", new string[] { })] [InlineData("git branch -m g", new string[] { })] [InlineData("git branch -M g", new string[] { })] [InlineData("git branch newBranch ", new string[] { "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git branch newBranch f", new string[] { "feature1", "feature2" })] [InlineData("git branch newBranch g", new string[] { })] // git push [InlineData("git push ", new string[] { "origin", "other" })] [InlineData("git push oth", new string[] { "other" })] [InlineData("git push origin ", new string[] { "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git push origin fe", new string[] { "feature1", "feature2" })] [InlineData("git push origin :", new string[] { ":remotefeature", ":cutfeature" })] [InlineData("git push origin :re", new string[] { ":remotefeature" })] // git pull [InlineData("git pull ", new string[] { "origin", "other" })] [InlineData("git pull oth", new string[] { "other" })] [InlineData("git pull origin ", new string[] { "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git pull origin fe", new string[] { "feature1", "feature2" })] // git fetch [InlineData("git fetch ", new string[] { "origin", "other" })] [InlineData("git fetch oth", new string[] { "other" })] // git submodule [InlineData("git submodule ", new string[] { "add", "status", "init", "update", "summary", "foreach", "sync" })] [InlineData("git submodule s", new string[] { "status", "summary", "sync" })] // git svn [InlineData("git svn ", new string[] { "init", "fetch", "clone", "rebase", "dcommit", "branch", "tag", "log", "blame", "find-rev", "set-tree", "create-ignore", "show-ignore", "mkdirs", "commit-diff", "info", "proplist", "propget", "show-externals", "gc", "reset" })] [InlineData("git svn f", new string[] { "fetch", "find-rev" })] // git stash [InlineData("git stash ", new string[] { "list", "save", "show", "drop", "pop", "apply", "branch", "clear", "create" })] [InlineData("git stash s", new string[] { "save", "show" })] [InlineData("git stash show ", new string[] { "stash", "wip" })] [InlineData("git stash show w", new string[] { "wip" })] [InlineData("git stash show d", new string[] { })] [InlineData("git stash apply ", new string[] { "stash", "wip" })] [InlineData("git stash apply w", new string[] { "wip" })] [InlineData("git stash apply d", new string[] { })] [InlineData("git stash drop ", new string[] { "stash", "wip" })] [InlineData("git stash drop w", new string[] { "wip" })] [InlineData("git stash drop d", new string[] { })] [InlineData("git stash pop ", new string[] { "stash", "wip" })] [InlineData("git stash pop w", new string[] { "wip" })] [InlineData("git stash pop d", new string[] { })] [InlineData("git stash branch ", new string[] { "stash", "wip" })] [InlineData("git stash branch w", new string[] { "wip" })] [InlineData("git stash branch d", new string[] { })] // Tests for commit [InlineData("git commit -C ", new string[] { "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git commit -C O", new string[] { "ORIG_HEAD" })] [InlineData("git commit -C o", new string[] { "origin/cutfeature", "origin/remotefeature" })] // git remote [InlineData("git remote ", new[] { "add", "rename", "rm", "set-head", "show", "prune", "update" })] [InlineData("git remote r", new[] { "rename", "rm" })] [InlineData("git remote rename ", new string[] { "origin", "other" })] [InlineData("git remote rename or", new string[] { "origin" })] [InlineData("git remote rm ", new string[] { "origin", "other" })] [InlineData("git remote rm or", new string[] { "origin" })] [InlineData("git remote set-head ", new string[] { "origin", "other" })] [InlineData("git remote set-head or", new string[] { "origin" })] [InlineData("git remote set-branches ", new string[] { "origin", "other" })] [InlineData("git remote set-branches or", new string[] { "origin" })] [InlineData("git remote set-url ", new string[] { "origin", "other" })] [InlineData("git remote set-url or", new string[] { "origin" })] [InlineData("git remote show ", new string[] { "origin", "other" })] [InlineData("git remote show or", new string[] { "origin", })] [InlineData("git remote prune ", new string[] { "origin", "other" })] [InlineData("git remote prune or", new string[] { "origin" })] // git help <cmd> [InlineData("git help ", new[] { "add", "am", "annotate", "archive", "bisect", "blame", "branch", "bundle", "checkout", "cherry", "cherry-pick", "citool", "clean", "clone", "commit", "config", "describe", "diff", "difftool", "fetch", "format-patch", "gc", "grep", "gui", "help", "init", "instaweb", "log", "merge", "mergetool", "mv", "notes", "prune", "pull", "push", "rebase", "reflog", "remote", "rerere", "reset", "revert", "rm", "shortlog", "show", "stash", "status", "submodule", "svn", "tag", "whatchanged" })] [InlineData("git help ch", new[] { "checkout", "cherry", "cherry-pick" })] // git checkout -- <files> [InlineData("git checkout -- ", new[] { "working-deleted", "working-duplicate", "working-modified", "working-unmerged" })] [InlineData("git checkout -- working-d", new[] { "working-deleted", "working-duplicate" })] // git merge|mergetool <files> // TODO: Enable for merge state //[InlineData("git merge ", new[] { "working-unmerged", "working-duplicate" })] //[InlineData("git merge working-u", new[] { "working-unmerged" })] //[InlineData("git merge j", new string[] { })] //[InlineData("git mergetool ", new[] { "working-unmerged", "working-duplicate" })] //[InlineData("git mergetool working-u", new[] { "working-unmerged" })] //[InlineData("git mergetool j", new string[] { })] // git checkout <branch> [InlineData("git checkout ", new[] { "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] // git cherry-pick <branch> [InlineData("git cherry ", new[] { "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] // git cherry-pick <branch> [InlineData("git cherry-pick ", new[] { "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] // git diff <branch> [InlineData("git diff ", new[] { "index-modified", "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git diff --cached ", new[] { "working-modified", "working-duplicate", "working-unmerged", "index-modified", "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git diff --staged ", new[] { "index-modified", "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] // git difftool <branch> [InlineData("git difftool ", new[] { "index-modified", "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git difftool --cached ", new[] { "working-modified", "working-duplicate", "working-unmerged", "index-modified", "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git difftool --staged ", new[] { "index-modified", "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] // git log <branch> [InlineData("git log ", new[] { "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] // git merge <branch> [InlineData("git merge ", new[] { "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] // git rebase <branch> [InlineData("git rebase ", new[] { "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] // git reflog <branch> [InlineData("git reflog show ", new[] { "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] // git reset <branch> [InlineData("git reset ", new[] { "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] // git reset HEAD <file> [InlineData("git reset HEAD ", new[] { "index-added", "index-deleted", "index-modified", "index-unmerged" })] [InlineData("git reset HEAD index-a", new[] { "index-added" })] // git revert <branch> [InlineData("git revert ", new[] { "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] // git show<branch> [InlineData("git show ", new[] { "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [Theory] public async Task CheckCompletion(string cmd, string[] expected) { var completer = CreateTabCompleter(); await CompareAsync(completer, cmd, expected.OrderBy(o => o, StringComparer.Ordinal)); } // git add [InlineData("git add ", new[] { "working duplicate", "working modified", "working added", "working unmerged" })] [InlineData("git add \"working m", new[] { "working modified" })] [InlineData("git add \'working m", new[] { "working modified" })] // git rm [InlineData("git rm ", new[] { "working deleted", "working duplicate" })] [InlineData("git rm \"working d", new string[] { "working deleted", "working duplicate" })] [InlineData("git rm \'working d", new string[] { "working deleted", "working duplicate" })] // git checkout -- <files> [InlineData("git checkout -- ", new[] { "working deleted", "working duplicate", "working modified", "working unmerged" })] [InlineData("git checkout -- \"wor", new[] { "working deleted", "working duplicate", "working modified", "working unmerged" })] [InlineData("git checkout -- \"working d", new[] { "working deleted", "working duplicate" })] [InlineData("git checkout -- \'working d", new[] { "working deleted", "working duplicate" })] // git merge|mergetool <files> // TODO: Enable for merge state //[InlineData("git merge ", new[] { "working unmerged", "working duplicate" })] //[InlineData("git merge working u", new[] { "working unmerged" })] //[InlineData("git merge j", new string[] { })] //[InlineData("git mergetool ", new[] { "working unmerged", "working duplicate" })] //[InlineData("git mergetool working u", new[] { "working unmerged" })] //[InlineData("git mergetool j", new string[] { })] // git diff <branch> [InlineData("git diff ", new[] { "index modified", "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git diff --cached ", new[] { "working modified", "working duplicate", "working unmerged", "index modified", "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git diff --staged ", new[] { "index modified", "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] // git difftool <branch> [InlineData("git difftool ", new[] { "index modified", "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git difftool --cached ", new[] { "working modified", "working duplicate", "working unmerged", "index modified", "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] [InlineData("git difftool --staged ", new[] { "index modified", "FETCH_HEAD", "HEAD", "MERGE_HEAD", "ORIG_HEAD", "feature1", "feature2", "master", "origin/cutfeature", "origin/remotefeature" })] // git reset HEAD <file> [InlineData("git reset HEAD ", new[] { "index added", "index deleted", "index modified", "index unmerged" })] [InlineData("git reset HEAD \"index a", new[] { "index added" })] [InlineData("git reset HEAD \'index a", new[] { "index added" })] [Theory] public async Task <API key>(string cmd, string[] initialExpected) { const string quot = "\""; var completer = CreateTabCompleter(" "); var expected = initialExpected .OrderBy(o => o, StringComparer.Ordinal) .Select(o => o.Contains(" ") ? $"{quot}{o}{quot}" : o); await CompareAsync(completer, cmd, expected); } private async Task CompareAsync(ITabCompleter completer, string cmd, IEnumerable<string> expected) { var fullResult = await completer.CompleteAsync(cmd, CancellationToken.None); var result = GetResult(fullResult); _log.WriteLine("Expected output:"); _log.WriteLine(string.Join(Environment.NewLine, expected)); _log.WriteLine(string.Empty); _log.WriteLine("Actual output:"); _log.WriteLine(string.Join(Environment.NewLine, result)); Assert.Equal(expected, result); } private static ITabCompleter CreateTabCompleter(string join = "-") { var status = Substitute.For<IRepositoryStatus>(); var working = new <API key> { Added = new[] { $"working{join}added", $"working{join}duplicate" }, Deleted = new[] { $"working{join}deleted", $"working{join}duplicate" }, Modified = new[] { $"working{join}modified", $"working{join}duplicate" }, Unmerged = new[] { $"working{join}unmerged", $"working{join}duplicate" } }; var index = new <API key> { Added = new[] { $"index{join}added" }, Deleted = new[] { $"index{join}deleted" }, Modified = new[] { $"index{join}modified" }, Unmerged = new[] { $"index{join}unmerged" } }; status.Index.Returns(index); status.Working.Returns(working); status.LocalBranches.Returns(new[] { "master", "feature1", "feature2" }); status.Remotes.Returns(new[] { "origin", "other" }); status.RemoteBranches.Returns(new[] { "origin/remotefeature", "origin/cutfeature" }); status.Stashes.Returns(new[] { "stash", "wip" }); return new TabCompleter(Task.FromResult(status)); } private IEnumerable<string> GetResult(TabCompletionResult fullResult) { Assert.True(fullResult.IsSuccess); return (fullResult as TabCompletionResult.Success).Item; } } }
package org.fayalite.sjs import org.fayalite.sjs.canvas.CanvasBootstrap import org.scalajs.dom import org.scalajs.dom.Node import org.scalajs.dom.raw.<API key> import org.scalajs.dom.raw.HTMLCanvasElement import rx.core.{Rx, Var} object Schema extends SJSHelp { import upickle._ // json.read // json.write case class A(b: String) case class ParseRequest ( code: String, cookies: String, requestId: String ) val defaultFont = "12pt monospace" /** * This is used because the canvas * engine requires setting flags in advance of draw * calls, these are the typical modified GUI * declarations required most commonly, feel * free to add on additional specifications * @param font: A string as expected in CSS * @param fillStyle : Hex prefixed color code * @param globalAlpha : Zero to one float value * as in png for draw call */ case class CanvasStyling( font: String = defaultFont, fillStyle: String = lightBlue, globalAlpha: Double = 1D ) trait DeleteAble { val node: Node def delete(): Unit = { node.parentNode.removeChild(node) } } case class CanvasContextInfo( canvas: HTMLCanvasElement, context: <API key>, tileSize: Int = CanvasBootstrap.minSize, text: Option[String] = None ) extends DeleteAble { val node = canvas var location = LatCoord(0, 0) var isMoving = false } case class LatCoord(x: Int, y: Int)(implicit squareTileSize : Int = CanvasBootstrap.minSize) { def *(o: Int) = { this.copy(x*o, y*o) } def up0 = this.copy(y=0) def left0 = this.copy(x=0) def right = this.copy(x=x+1*squareTileSize) def right(n: Int) = this.copy(x=x+n*squareTileSize) def left = this.copy(x=x-1) def up = this.copy(y=y-1*squareTileSize) def down = this.copy(y=y+1*squareTileSize) def down(n: Int) = this.copy(y=y+n*squareTileSize) def *(o: LatCoordD) = { // elementwise o.copy(x*o.x, y*o.y) } def +(o: LatCoord) = this.copy(o.x+x, o.y+y) def str = s"x:$x,y:$y" def toAbsolute = { LatCoord(x*squareTileSize, y*squareTileSize) } def fromAbsolute = { LatCoord(x/squareTileSize, y/squareTileSize) } } case class LatCoordD(x: Double, y: Double) { def +(other: LatCoordD) = { this.copy(other.x+x, other.y+y) } def +(otheri: Int) = { val other = LatCoord(otheri, otheri) this.copy(other.x+x, other.y+y) } def -(o: LatCoordD) = { this.copy(x-o.x, y-o.y) } def -(o: LatCoord) = this.copy(x-o.x, y-o.y) def -(oi: Int) = { this.copy(x-oi, y-oi) } /* def fillRect(dxDy: LatCoordD) = { LatCoord2D(this, dxDy).fillRect() }*/ def str = s"x:$x,y:$y" } /* case class ChiralCell( side: Either[LatCoord, LatCoord] ) { val offset = side match { case Left(lc) => lc case Right(lc) => lc.copy(x=lc.x+1) } } */ implicit def d2tolc(d2: (Double, Double)) : LatCoordD = { LatCoordD(d2._1, d2._2) } implicit def i2tolc(d2: (Int, Int)) : LatCoordD = { LatCoordD(d2._1, d2._2) } implicit def i2t2olc(d2: (Int, Int)) : LatCoord = { LatCoord(d2._1, d2._2) } /* // This kills rx.ops._ import carefully. Or make a nested class. implicit class RxOps[T](rxx: Rx[T]) { def reset(f: => T) = { rxx.parents.map{q => Try{q.asInstanceOf[Var[T]]() = f}} } } */ def xy(x: Double = 0D, y: Double = 0D): LatCoordD = LatCoordD(x,y) def xyi(x: Int = 0, y: Int = 0): LatCoord = LatCoord(x,y) def vl(x: Int = 0, y: Int = 0) = Var(xyi(x,y)) //def vl(x: Int = 0) = Var(xyi(x,x)) implicit class RxOpsExt[T](t: T) { def v = Var(t) def rx = Rx{t} } def lc0 = LatCoord(0, 0) def lcd0 = LatCoordD(0D, 0D) def l0 = Var{LatCoord(0, 0)} def ld0 = Var{LatCoordD(0D, 0D)} def l20 = Var{LatCoord2(LatCoord(0, 0),LatCoord(0, 0))} def ld20 = Var{LatCoord2D(lcd0, lcd0)} type LC = LatCoord type LCD = LatCoordD type LC2 = LatCoord2 type LC2D = LatCoord2D type VL = Var[LatCoord] type VLD = Var[LatCoordD] type VL2 = Var[LatCoord2] type VL2D = Var[LatCoord2D] case class LatCoord2(xy: LatCoord, xy2: LatCoord) { def str = xy.str + "|" + xy2.str } case class LatCoord2D(xy: LatCoordD, xy2: LatCoordD) { def str = xy.str + "|" + xy2.str def x = xy.x def y = xy.y def dx = xy2.x def dy = xy2.y def plus1(other: LCD) = { this.copy(xy = other.+(this.xy)) } } case class XYI(x: Var[Int], y: Var[Int]) { def plus(other: XYI) = { this.copy( x=Var(x() + other.x()), y=Var(y() + other.y()) ) } } }
var Purest = require('purest'); function Facebook(opts) { this._opts = opts || {}; this._opts.provider = 'facebook'; this._purest = new Purest(this._opts); this._group = 'LIB:SOCIAL:FACEBOOK'; return this; } Facebook.prototype.user = function (cb) { var self = this; this._purest.query() .get('me') .auth(this._opts.auth.token) .request(function (err, res, body) { if (err) { console.log(err); return cb(err); } cb(null, body); }); }; Facebook.prototype.post = function (endpoint, form, cb) { // form = {message: 'post message'} this._purest.query() .post(endpoint || 'me/feed') .auth(this._opts.auth.token) .form(form) .request(function (err, res, body) { if (err) { console.log(err); return cb(err); } cb(null, body); }); }; module.exports = function(app) { return Facebook; };
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> <title>Note Detail</title> <script src="http://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/<API key>=" crossorigin="anonymous"> </script> <!-- Kein Javascsript --> <noscript><a href=NoJavaScript.html>Kein Java Script</a></noscript> <!-- lib calendar resources --> <link rel="stylesheet" type="text/css" href="../lib/tcal/css/tcal.css"> <script src="../lib/tcal/js/tcal.js"></script> <!-- moment, systemjs wrapped with comment for html-replace--> <!-- build:vendor --> <script src="../../node_modules/moment/moment.js"></script> <script src="../../node_modules/moment-timezone/builds/<API key>.js"></script> <script src="../../node_modules/systemjs/dist/system.js"></script> <!-- endbuild --> <!-- application resources --> <link rel="stylesheet" type="text/css" href="../css/style.css"> <!-- handlebars lib from cdn--> <script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.5/handlebars.min.js"> </script> <!-- appbundle.js is created with tsconfig options target es5 module system--> <script src="../appbundle.js"></script> <script> System.import("notedetail/NoteDetail"); </script> </head> <body class="site"> <header role="banner"> <h1>Notiz erstellen</h1> </header> <div class="note-content"> <main class="note-detail"> <form id="note-form" class="note-form" action="" method="post"> <input id="note-id" class="input" name="id" type="number" hidden="hidden"> <label for="note-id"></label> <input id="note-createdDate" class="input" name="createdDate" type="text" hidden="hidden"> <label for="note-createdDate"></label> <input id="note-finishedDate" class="input" name="finishedDate" type="text" hidden="hidden"> <label for="note-finishedDate"></label> <div class="item col1"><h4>Title</h4></div> <div class="item col2"> <input id="note-title" class="input" name="title" type="text" required autofocus> <label for="note-title"></label> </div> <div class="item col1"><h4>Beschreibung</h4></div> <div class="item col2"> <textarea id="note-description" class="description" name="beschreibung" cols="50" rows="5" required placeholder="Beschreiben Sie hier Ihre Notiz..."></textarea> <label for="note-description"></label> </div> <div class="item col1"><h4>Wichtigkeit</h4></div> <div class="item col2"> <div class="rate"> <input type="radio" id="star5" name="rate" value="5" /> <label for="star5" title="Sehr wichtig und dringend"></label> <input type="radio" id="star4" name="rate" value="4" /> <label for="star4" title="Sehr wichtig"></label> <input type="radio" id="star3" name="rate" value="3" /> <label for="star3" title="wichtig"></label> <input type="radio" id="star2" name="rate" value="2" checked="checked"/> <label for="star2" title="Wenig wichtig"></label> <input type="radio" id="star1" name="rate" value="1" /> <label for="star1" title="Nicht wichtig"></label> </div> </div> <div class="item col1"><h4>Erledigt bis:</h4></div> <div class="item col2"> <input id="note-dueDate" type="text" name="dueDate" class="tcal duedate" required placeholder="DD/MM/YYYY" pattern="(0[1-9]|1[0-9]|2[0-9]|3[01])/(0[1-9]|1[012])/[0-9]{4}"> <label for="note-dueDate"></label> </div> <div class="item col1"></div> <div class="item col2"> <div class="buttons"> <button id="btnBack" type="button">Zurück</button> <button id="btnNoteReset" type="button">Reset</button> <button id="btnNoteSave" type="submit" form="note-form">Speichern</button> </div> </div> </form> <div id="log" class="item col1 log"></div> </main> </div> <footer> <div class="item footer">CAS Frontend Engineering 2016<br>Authoren: Marc Labud, Michel Rimbeaux</div> <div class="item col2"> <div class="footer-right"> <label for="<API key>">Design auswählen: </label> <select id="<API key>"> <option value="StyleOne">DarkTheme</option> <option value="StyleTwo" selected>BlueTheme</option> </select> <br>Projekt-Sourcen:&nbsp&nbsp<a class="git" href="https://github.com/marclabud/cas_fee_projectone">github</a> </div> </div> </footer> </body> </html>
<?php namespace Lollipop; defined('LOLLIPOP_BASE') or die('Lollipop wasn\'t loaded correctly.'); /** * Benchmark Class * * @author John Aldrich Bernardo * @email 4ldrich@protonmail.com * @package Lollipop * @description Class for recording benchmarks */ class Benchmark { /** * @var array $_marks Recorded microtimes * */ static private $_marks = []; /** * Record benchmark * * @param string $mark Key name * */ static public function mark($mark) { self::$_marks[$mark] = [ 'time' => microtime(true), 'memory_usage' => <API key>(true) ]; } /** * Get detailed benchmark * * @access public * @param string $start Start mark * @param string $end End mark * @return array * */ static public function elapsed($start, $end) { return [ 'time_elapsed' => self::elapsedTime($start, $end), 'memory_usage_gap' => self::elapsedMemory($start, $end), 'real_memory_usage' => self::elapsedMemory($start, $end, true) ]; } /** * Get elapsed memory between two marks * * @access public * @param string $start Start mark * @param string $end End mark * @param bool $real_usage Get real memory usage * @param bool $inMB Show output in MB instead of Bytes * @return mixed <string> if $inMB is <true>, <longint> if on <false> * */ static public function elapsedMemory($start, $end, $real_usage = false, $inMB = true) { $start = isset(self::$_marks[$start]) ? self::$_marks[$start]['memory_usage'] : 0; $end = isset(self::$_marks[$end]) ? self::$_marks[$end]['memory_usage'] : 0; $elapsed = !$real_usage ? ($end - $start) : $end; return $start ? ($inMB ? (($elapsed / 1024 / 1024) . ' MB') : $elapsed) : null; } /** * Compute the elapsed time of two marks * * @param string $start Keyname 1 * @param string $end Keyname 2 * * @return mixed * */ static public function elapsedTime($start, $end) { $start = isset(self::$_marks[$start]) ? self::$_marks[$start]['time'] : 0; $end = isset(self::$_marks[$end]) ? self::$_marks[$end]['time'] : 0; return $start ? round($end - $start, 10) : null; } }
#include <windows.h> #include "NativeCore.hpp" bool RC_CallConv IsProcessValid(RC_Pointer handle) { if (handle == nullptr) { return false; } const auto retn = WaitForSingleObject(handle, 0); if (retn == WAIT_FAILED) { return false; } return retn == WAIT_TIMEOUT; }
#!/usr/bin/env bash # build datatheme resources # usage: $ bash ./publi.sh # build & deploys datatheme resources to host s3 bucket # usage: $ bash ./publi.sh put dev.afgo.pgyi # dependencies: datatheme_root=s3://tesera.data.themes datatheme_path="$datatheme_root/$2" cp_flags="--acl public-read --cache-control no-cahe" if [ "$CI_BRANCH" != 'master' ]; then DATATHEME_NAME="$CI_BRANCH.$DATATHEME_NAME"; fi; echo "processing $CI_BRANCH" echo "building datapackage.json for datatheme $DATATHEME_NAME" mkdir -p ./www node ./build.js $DATATHEME_NAME > ./www/datapackage.json mkdir ./www/awk ./www/rules echo "compiling bawlk rules from datapackage.json" bawlk rules -d ./www/datapackage.json -o ./www/rules echo "compiling bawlk scripts from datapackage.json" bawlk scripts -d ./www/datapackage.json -o ./www/awk if [ "$1" == "put" ]; then echo "publishing datatheme resources to s3" aws s3 cp ./www/partials/ $datatheme_path/partials --recursive --content-type text/html $cp_flags aws s3 cp ./www/index.html $datatheme_path/index.html --content-type text/html $cp_flags aws s3 cp ./www/datapackage.json $datatheme_path/datapackage.json --content-type application/json $cp_flags aws s3 cp ./www/awk/ $datatheme_path/awk --recursive --content-type text/plain $cp_flags aws s3 cp ./www/rules/ $datatheme_path/rules --recursive --content-type text/plain $cp_flags echo "publishing complete" fi echo "done"
#ifndef <API key> #define <API key> #include "api/sk_txn.h" #include "api/sk_service.h" struct _skull_service_t { sk_service_t* service; const sk_txn_t* txn; sk_txn_taskdata_t* task; // If freezed == 1, user cannot use set/get apis to touch data. Instead // user should create a new service job for that purpose int freezed; int _reserved; }; #endif
# read only In leveldb you may only open an instance in one process... but you could have other processes open the database in read only mode easily enough. You could also have each instance create it's own memtable, (and tail other's memtables... as long as there weren't too many) then you could have eventual consistency between instances. Youd need to have timestamps in the memtable, though, + check each memtable for a key ... which means it would scale the number of processes badly, but it might be okay for one or two... # bulk load optimization when creating a memtable, you could detect whether all the writes are appends. Then, you could turn that table into a SST. If the file exceeds a given size, and there has only been appends, treat it like an SST... And even, if you get a non append write later, just start a new table. this would mean you could do a bulk load without any compaction. It could basically be the time to append to a file.
#ifndef BITCOINGUI_H #define BITCOINGUI_H #include <QMainWindow> #include <QSystemTrayIcon> #include <QLabel> #include <QMap> #include "util.h" class <API key>; class WalletView; class ClientModel; class WalletModel; class WalletStack; class TransactionView; class OverviewPage; class AddressBookPage; class SendCoinsDialog; class <API key>; class Notificator; class RPCConsole; class <API key>; class CWallet; class CWalletManager; class MessageModel; QT_BEGIN_NAMESPACE class QLabel; class QModelIndex; class QProgressBar; class QStackedWidget; class QListWidget; class QPushButton; QT_END_NAMESPACE class ActiveLabel : public QLabel { Q_OBJECT public: ActiveLabel(const QString & text = "", QWidget * parent = 0); ~ActiveLabel(){} signals: void clicked(); protected: void mouseReleaseEvent (QMouseEvent * event) ; }; /** Bitcoin GUI main class. This class represents the main window of the Bitcoin UI. It communicates with both the client and wallet models to give the user an up-to-date view of the current core state. */ class BitcoinGUI : public QMainWindow { Q_OBJECT public: explicit BitcoinGUI(QWidget *parent = 0); ~BitcoinGUI(); int nHeight; /** Set the client model. The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic. */ void setClientModel(ClientModel *clientModel); /** Set the wallet model. The wallet model represents a bitcoin wallet, and offers access to the list of transactions, address book and sending functionality. */ void setWalletManager(CWalletManager *walletManager) { this->walletManager = walletManager; } bool addWallet(const QString& name, WalletModel *walletModel, MessageModel *messageModel); QString getCurrentWallet(); bool setCurrentWallet(const QString& name); QAction *exportAction; Get window identifier of QMainWindow (BitcoinGUI) WId getMainWinId() const; Notificator* getNotificator(); protected: void changeEvent(QEvent *e); void closeEvent(QCloseEvent *event); void dragEnterEvent(QDragEnterEvent *event); void dropEvent(QDropEvent *event); bool eventFilter(QObject *object, QEvent *event); private: ClientModel *clientModel; CWalletManager *walletManager; <API key> *<API key>; QMap<QString, WalletModel*> mapWalletModels; QListWidget *walletList; WalletStack *walletStack; WalletView *walletView; QPushButton *loadWalletButton; QPushButton *unloadWalletButton; QPushButton *newWalletButton; QLabel *labelEncryptionIcon; QLabel *labelStakingIcon; QLabel *<API key>; QLabel *labelBlocksIcon; QLabel *progressBarLabel; QLabel *mainIcon; QToolBar *mainToolbar; QToolBar *secondaryToolbar; QProgressBar *progressBar; QMenuBar *appMenuBar; QAction *overviewAction; QAction *historyAction; QAction *quitAction; QAction *sendCoinsAction; QAction *addressBookAction; QAction *shoppingAction; QAction *messageAction; QAction *signMessageAction; QAction *verifyMessageAction; QAction *aboutAction; QAction *charityAction; QAction *receiveCoinsAction; QAction *optionsAction; QAction *toggleHideAction; QAction *encryptWalletAction; QAction *unlockWalletAction; QAction *lockWalletAction; QAction *checkWalletAction; QAction *repairWalletAction; QAction *backupWalletAction; QAction *<API key>; QAction *dumpWalletAction; QAction *importWalletAction; QAction *<API key>; QAction *aboutQtAction; QAction *<API key>; QAction *openTrafficAction; QAction *loadWalletAction; QAction *unloadWalletAction; QAction *newWalletAction; QAction *blockAction; QAction *blocksIconAction; QAction *<API key>; QAction *stakingIconAction; QSystemTrayIcon *trayIcon; TransactionView *transactionView; RPCConsole *rpcConsole; Notificator *notificator; QMovie *syncIconMovie; /** Keep track of previous number of blocks, to detect progress */ int prevBlocks; uint64_t nWeight; /** Create the main UI actions. */ void createActions(); /** Create the menu bar and sub-menus. */ void createMenuBar(); /** Create the toolbars */ void createToolBars(); /** Create system tray (notification) icon */ void createTrayIcon(); /** Create system tray menu (or setup the dock menu) */ void createTrayIconMenu(); public slots: /** Switch to overview (home) page */ void gotoOverviewPage(); /** Switch to history (transactions) page */ void gotoHistoryPage(bool fExportOnly=false, bool fExportConnect=true, bool fExportFirstTime=false); /** Switch to address book page */ void gotoAddressBookPage(bool fExportOnly=false, bool fExportConnect=true, bool fExportFirstTime=false); /** Switch to receive coins page */ void <API key>(bool fExportOnly=false, bool fExportConnect=true, bool fExportFirstTime=false); /** Switch to send coins page */ void gotoSendCoinsPage(); /** Switch to shopping page */ void gotoShoppingPage(); /** Switch to message page */ void gotoMessagePage(); /** Switch to block browser page */ void gotoBlockBrowser(QString transactionId = ""); /** Show Sign/Verify Message dialog and switch to sign message tab */ void gotoSignMessageTab(QString addr = ""); /** Show Sign/Verify Message dialog and switch to verify message tab */ void <API key>(QString addr = ""); /** Set number of connections shown in the UI */ void setNumConnections(int count); /** Set number of blocks shown in the UI */ void setNumBlocks(int count, int nTotalBlocks); /** Set the encryption status as shown in the UI. @param[in] status current encryption status @see WalletModel::EncryptionStatus */ void setEncryptionStatus(int status); /** Show information about stakes */ void stakingIconClicked(); /** Show incoming transaction notification for new transactions. The new items are those between start and end inclusive, under the given parent item. */ void incomingTransaction(const QString& date, int unit, qint64 amount, const QString& type, const QString& address); /** Notify the user of an event from the core network or transaction handling code. @param[in] title the message box / notification title @param[in] message the displayed text @param[in] style modality and style definitions (icon and used buttons - buttons only for message boxes) @see CClientUIInterface::MessageBoxFlags @param[in] detail optional detail text */ void message(const QString &title, const QString &message, unsigned int style, const QString &detail=QString()); void askFee(qint64 nFeeRequired, bool *payFee); void handleURI(QString strURI); void <API key>(Qt::Orientation orientation); void <API key>(Qt::Orientation orientation); void loadWallet(); void unloadWallet(); void newWallet(); private slots: /** Show configuration dialog */ void optionsClicked(); /** Show about dialog */ void aboutClicked(); /** Show information about network */ void blocksIconClicked(); /** Show Stake For Charity Dialog */ void charityClicked(QString addr = ""); /** Allow user to lock/unlock wallet from click */ void lockIconClicked(); /** Ask for passphrase to unlock wallet during entire session */ void unlockWalletForMint(); #ifndef Q_OS_MAC /** Handle tray icon clicked */ void trayIconActivated(QSystemTrayIcon::ActivationReason reason); #endif /** Encrypt the wallet */ void encryptWallet(bool status); /** Check the wallet */ void checkWallet(); /** Repair the wallet */ void repairWallet(); /** Backup the wallet */ void backupWallet(); void backupAllWallets(); /** Import/Export the wallet's keys */ void dumpWallet(); void importWallet(); /** Change encrypted wallet passphrase */ void changePassphrase(); /** Ask for passphrase to unlock wallet temporarily */ void unlockWallet(); void lockWallet(); /** Give user information about staking */ void updateStakingIcon(); /** Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true */ void <API key>(bool fToggleHidden = false); /** simply calls <API key>(true) for use in SLOT() macro */ void toggleHidden(); /** Adds or removes wallets to the stack */ void addWallet(const QString& name); void removeWallet(const QString& name); }; #endif // BITCOINGUI_H
package dev.jee6demo.jspes; import java.io.IOException; import java.io.PrintWriter; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/EventSourceServlet") public class EventSourceServlet extends HttpServlet { private static final long serialVersionUID = 1L; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/event-stream"); response.<API key>("UTF-8"); PrintWriter pw = response.getWriter(); for (int i = 0; i < 5; i++) { pw.write("event:new_time\n"); pw.write("data: " + now() + "\n\n"); pw.flush(); try { Thread.sleep(1000); } catch (<API key> e) { e.printStackTrace(); } } pw.write("event:new_time\n"); pw.write("data: STOP\n\n"); pw.flush(); pw.close(); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request,response); } public static String now(){ DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss.SSS"); return dateFormat.format(new Date()); } }
<?php namespace Presta\CMSThemeBasicBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\<API key>; class Configuration implements <API key> { /** * {@inheritDoc} */ public function <API key>() { $treeBuilder = new TreeBuilder(); $treeBuilder->root('<API key>'); // Here you should define the parameters that are allowed to // configure your bundle. See the documentation linked above for // more information on that topic. return $treeBuilder; } }
using System; using Android.App; using Android.Content.PM; using Android.Runtime; using Android.Views; using Android.Widget; using Android.OS; namespace XF_ManySwitches.Droid { [Activity(Label = "XF_ManySwitches", Icon = "@drawable/icon", MainLauncher = true, <API key> = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] public class MainActivity : global::Xamarin.Forms.Platform.Android.<API key> { protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); LoadApplication(new App()); } } }
describe('controllers/home', function () { var di, Core, Home, Type, contentModel = { findOne: function() { } }, widgetHooks = [], widgetHook = { load: function (a, b, c) { widgetHooks.push({ name: a, alias: b, method: c }); }, handle: function () { } }; beforeEach(function () { di = require('mvcjs'); di.setAlias('cp', __dirname + '/../../app/controllers/'); Type = di.load('typejs'); Core = di.mock('@{cp}/core', { 'typejs': Type, 'core/controller': { inherit: function () { return Type.create.apply(Type, arguments); } }, '@{core}/widget-hook': widgetHook }); Home = di.mock('@{cp}/home', { 'typejs': Type, 'promise': di.load('promise'), '@{controllersPath}/core': Core, '@{modelsPath}/content': contentModel }); }); it('construct', function () { var api = {}; var controller = new Home(api); expect(controller.locals.scripts.length).toBe(0); expect(controller.locals.brand).toBe('MVCJS'); expect(controller.locals.pageTitle).toBe('Mvcjs nodejs framework'); expect(controller.locals.pageDesc).toBe('Mvcjs fast, opinionated lightweight mvc framework for Node.js inspired by Yii framework'); expect(controller.menu.length).toBe(0); }); it('action_index', function () { var api = { locals: { scripts: [] }, renderFile: function(route, locals) { return 'RENDERED'; } }; spyOn(api, 'renderFile').and.callThrough(); di.setAlias('basePath', __dirname + '/../../'); var controller = new Home(api); var result = controller.action_index.call(api); expect(api.renderFile).<API key>( 'home/index', { scripts : [ { src : 'https://buttons.github.io/buttons.js', id : 'github-bjs', async : true } ], version : '0.1.0-beta-15' }); expect(result).toBe('RENDERED'); expect(api.locals.scripts.length).toBe(1); }); it('action_content', function () { var api = { locals: { content: '', pageTitle: '', pageDesc: '' }, renderFile: function(route, locals) { return 'RENDERED'; } }; spyOn(api, 'renderFile').and.callThrough(); di.setAlias('basePath', __dirname + '/../../'); var controller = new Home(api); var result = controller.action_content.call(api, {}, { text: 'TEXT', pageTitle: 'TITLE', pageDesc: 'DESC' }); expect(api.renderFile).<API key>( 'home/content', { pageTitle: 'TITLE', pageDesc: 'DESC', content : 'TEXT' }); expect(result).toBe('RENDERED'); }); it('before_content', function (done) { var api = { getParsedUrl: function(route, locals) { return { pathname: '/home/index' }; } }; contentModel.findOne = function(data, callback) { expect(data.url).toBe('/home/index'); callback(null, { id: 1, text: 'yes' }); }; spyOn(api, 'getParsedUrl').and.callThrough(); spyOn(contentModel, 'findOne').and.callThrough(); di.setAlias('basePath', __dirname + '/../../'); var controller = new Home(api); var result = controller.before_content.call(api); result.then(function(data) { expect(api.getParsedUrl).toHaveBeenCalled(); expect(contentModel.findOne).toHaveBeenCalled(); expect(data.id).toBe(1); expect(data.text).toBe('yes'); done(); }); }); it('before_content error', function (done) { var api = { getParsedUrl: function(route, locals) { return { pathname: '/home/index' }; } }; contentModel.findOne = function(data, callback) { expect(data.url).toBe('/home/index'); callback(true, { id: 1, text: 'yes' }); }; spyOn(api, 'getParsedUrl').and.callThrough(); spyOn(contentModel, 'findOne').and.callThrough(); di.setAlias('basePath', __dirname + '/../../'); var controller = new Home(api); var result = controller.before_content.call(api); result.then(null, function(error) { console.log('error', error); done(); }); }); it('beforeEach', function () { var api = {}; widgetHook.handle = function(hooks) { expect(hooks.indexOf('menu-hook')).toBe(0); return hooks.shift(); }; var controller = new Home(api); expect(controller.beforeEach()).toBe('menu-hook'); expect(controller.locals.scripts.length).toBe(1); }); it('action_error', function () { var api = { locals: {}, setStatusCode: function(code) { expect(code).toBe(500); }, renderFile: function(name, locals) { expect(name).toBe('home/error'); expect(locals.pageTitle).toBe('Error - mvcjs nodejs framework'); expect(locals.text).toBe('ERROR'); return 'RENDER'; } }; spyOn(api, 'setStatusCode').and.callThrough(); spyOn(api, 'renderFile').and.callThrough(); var controller = new Home({}); var response = controller.action_error.call(api, { code: 500, toString: function() { return "ERROR"; } }); expect(api.setStatusCode).toHaveBeenCalled(); expect(api.renderFile).toHaveBeenCalled(); expect(response).toBe('RENDER'); }); });
<!DOCTYPE html> <html xmlns:msxsl="urn:<API key>:xslt"> <head> <meta content="en-us" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-16" http-equiv="Content-Type" /> <title _locid="<API key>">.NET Portability Report</title> <style> /* Body style, for the entire document */ body { background: #F3F3F4; color: #1E1E1F; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; padding: 0; margin: 0; } /* Header1 style, used for the main title */ h1 { padding: 10px 0px 10px 10px; font-size: 21pt; background-color: #E2E2E2; border-bottom: 1px #C1C1C2 solid; color: #201F20; margin: 0; font-weight: normal; } /* Header2 style, used for "Overview" and other sections */ h2 { font-size: 18pt; font-weight: normal; padding: 15px 0 5px 0; margin: 0; } /* Header3 style, used for sub-sections, such as project name */ h3 { font-weight: normal; font-size: 15pt; margin: 0; padding: 15px 0 5px 0; background-color: transparent; } h4 { font-weight: normal; font-size: 12pt; margin: 0; padding: 0 0 0 0; background-color: transparent; } /* Color all hyperlinks one color */ a { color: #1382CE; } /* Paragraph text (for longer informational messages) */ p { font-size: 10pt; } /* Table styles */ table { border-spacing: 0 0; border-collapse: collapse; font-size: 10pt; } table th { background: #E7E7E8; text-align: left; text-decoration: none; font-weight: normal; padding: 3px 6px 3px 6px; } table td { vertical-align: top; padding: 3px 6px 5px 5px; margin: 0px; border: 1px solid #E7E7E8; background: #F7F7F8; } .NoBreakingChanges { color: darkgreen; font-weight:bold; } .FewBreakingChanges { color: orange; font-weight:bold; } .ManyBreakingChanges { color: red; font-weight:bold; } .BreakDetails { margin-left: 30px; } .CompatMessage { font-style: italic; font-size: 10pt; } .GoodMessage { color: darkgreen; } /* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */ .localLink { color: #1E1E1F; background: #EEEEED; text-decoration: none; } .localLink:hover { color: #1382CE; background: #FFFF99; text-decoration: none; } /* Center text, used in the over views cells that contain message level counts */ .textCentered { text-align: center; } /* The message cells in message tables should take up all avaliable space */ .messageCell { width: 100%; } /* Padding around the content after the h1 */ #content { padding: 0px 12px 12px 12px; } /* The overview table expands to width, with a max width of 97% */ #overview table { width: auto; max-width: 75%; } /* The messages tables are always 97% width */ #messages table { width: 97%; } /* All Icons */ .IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded { min-width: 18px; min-height: 18px; background-repeat: no-repeat; background-position: center; } /* Success icon encoded */ .IconSuccessEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ background-image: url(data:image/png;base64,<API key>/9hAAABPElEQVR4Xp1Tv0vDUBi8FqeA4NpBcBLcWnQSApncOnTo4FSnjP0DsnXpH5CxiwbHDg4Zuj4oOEXiJgiC4FDcCkLWmIMc1Pfw+<API key>/H5+sHpZwYfxyRjTs+<API key>/13u3Fjrs/EdhsdDFHGB/<API key>+m3tVe/t97D52CB/ziG0nIgD/<API key>/<API key>/<API key>+zk7s8czeges//s5C5+CwqrR4/gw+AAAAABJRU5ErkJggg==); } /* Information icon encoded */ .IconInfoEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ background-image: url(data:image/png;base64,<API key>/<API key>+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/<API key>/HF1RsMXq+<API key>/<API key>+<API key>/<API key>=); } /* Warning icon encoded */ .IconWarningEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ background-image: url(data:image/png;base64,<API key>/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/<API key>+wVDSyyzFoJjfz9NB+pAF+<API key>/<API key>/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/<API key>==); } /* Error icon encoded */ .IconErrorEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ background-image: url(data:image/png;base64,<API key>/<API key>/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+<API key>/<API key>/<API key>=); } </style> </head> <body> <h1 _locid="PortabilityReport">.NET Portability Report</h1> <div id="content"> <div id="submissionId" style="font-size:8pt;"> <p> <i> Submission Id&nbsp; <API key> </i> </p> </div> <h2 _locid="SummaryTitle"> <a name="Portability Summary"></a>Portability Summary </h2> <div id="summary"> <table> <tbody> <tr> <th>Assembly</th> <th>ASP.NET 5,Version=v1.0</th> <th>Windows,Version=v8.1</th> <th>.NET Framework,Version=v4.6</th> <th>Windows Phone,Version=v8.1</th> </tr> <tr> <td><strong><a href="#FlitBit.IoC">FlitBit.IoC</a></strong></td> <td class="text-center">94.84 %</td> <td class="text-center">92.08 %</td> <td class="text-center">100.00 %</td> <td class="text-center">92.08 %</td> </tr> </tbody> </table> </div> <div id="details"> <a name="FlitBit.IoC"><h3>FlitBit.IoC</h3></a> <table> <tbody> <tr> <th>Target type</th> <th>ASP.NET 5,Version=v1.0</th> <th>Windows,Version=v8.1</th> <th>.NET Framework,Version=v4.6</th> <th>Windows Phone,Version=v8.1</th> <th>Recommended changes</th> </tr> <tr> <td>System.<API key></td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use other exception types.</td> </tr> <tr> <td style="padding-left:2em">#ctor</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use other exception types.</td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use other exception types.</td> </tr> <tr> <td style="padding-left:2em">#ctor(System.String)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use other exception types.</td> </tr> <tr> <td style="padding-left:2em">#ctor(System.String,System.Exception)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use other exception types.</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Delegate</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use System.Reflection.<API key>.GetMethodInfo</td> </tr> <tr> <td style="padding-left:2em">get_Method</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use System.Reflection.<API key>.GetMethodInfo</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Exception</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Remove usage.</td> </tr> <tr> <td style="padding-left:2em"><API key>(System.EventHandler{System.Runtime.Serialization.<API key>})</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Remove usage.</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.ICloneable</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Remove usage. Implement cloning operation yourself if needed.</td> </tr> <tr> <td style="padding-left:2em">Clone</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Remove usage. Implement cloning operation yourself if needed.</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Binder</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use an overload that does not take a Binder.</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.BindingFlags</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Emit.ILGenerator</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">DeclareLocal(System.Type)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">DefineLabel</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">MarkLabel(System.Reflection.Emit.Label)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">ThrowException(System.Type)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Emit.Label</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Emit.LocalBuilder</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Emit.ModuleBuilder</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.MemberInfo</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">IsDefined(System.Type,System.Boolean)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.Module</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">GetType(System.String,System.Boolean,System.Boolean)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.ParameterModifier</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use an overload that does not take a ParameterModifier array.</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.PropertyInfo</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use PropertyInfo.SetMethod property</td> </tr> <tr> <td style="padding-left:2em">GetGetMethod</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use PropertyInfo.GetMethod property</td> </tr> <tr> <td style="padding-left:2em">GetSetMethod</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use PropertyInfo.SetMethod property</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Reflection.TypeFilter</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Object,System.IntPtr)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Runtime.<API key>.Cer</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Runtime.<API key>.Consistency</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Runtime.<API key>.<API key></td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Remove usage</td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Runtime.<API key>.Consistency,System.Runtime.<API key>.Cer)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Remove usage</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Runtime.Remoting.Messaging.CallContext</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Consider using System.Threading.AsyncLocal&lt;T&gt;</td> </tr> <tr> <td style="padding-left:2em">LogicalGetData(System.String)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">LogicalSetData(System.String,System.Object)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Runtime.Serialization.<API key></td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>either 1) Delete Serialization info from exceptions (since this can&#39;t be remoted) or 2) Use a different serialization technology if not for exceptions.</td> </tr> <tr> <td style="padding-left:2em"><API key>(System.Object)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>either 1) Delete Serialization info from exceptions (since this can&#39;t be remoted) or 2) Use a different serialization technology if not for exceptions.</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Runtime.Serialization.<API key></td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>either 1) Delete Serialization info from exceptions (since this can&#39;t be remoted) or 2) Use a different serialization technology if not for exceptions.</td> </tr> <tr> <td style="padding-left:2em">AddSerializedState(System.Runtime.Serialization.<API key>)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>either 1) Delete Serialization info from exceptions (since this can&#39;t be remoted) or 2) Use a different serialization technology if not for exceptions.</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Runtime.Serialization.SerializationInfo</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Remove serialization constructors on custom Exception types</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Threading.Thread</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use System.Threading.Interlocked.MemoryBarrier instead</td> </tr> <tr> <td style="padding-left:2em">MemoryBarrier</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use System.Threading.Interlocked.MemoryBarrier instead</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Type</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Equivalent available: Add using for System.Reflection, and reference System.Reflection.TypeExtensions </td> </tr> <tr> <td style="padding-left:2em">EmptyTypes</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>new Type[0] (or create your own static property which returns a cached version of this)</td> </tr> <tr> <td style="padding-left:2em">FindInterfaces(System.Reflection.TypeFilter,System.Object)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_Assembly</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>.GetTypeInfo().Assembly</td> </tr> <tr> <td style="padding-left:2em">get_BaseType</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>.GetTypeInfo().BaseType</td> </tr> <tr> <td style="padding-left:2em">get_IsAbstract</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>.GetTypeInfo().IsAbstract</td> </tr> <tr> <td style="padding-left:2em">get_IsClass</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>.GetTypeInfo().IsClass</td> </tr> <tr> <td style="padding-left:2em">get_IsGenericType</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>.GetTypeInfo().IsGenericType</td> </tr> <tr> <td style="padding-left:2em"><API key></td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>.GetTypeInfo().<API key></td> </tr> <tr> <td style="padding-left:2em">get_IsInterface</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>.GetTypeInfo().IsInterface</td> </tr> <tr> <td style="padding-left:2em">get_IsPrimitive</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>.GetTypeInfo().IsPrimitive</td> </tr> <tr> <td style="padding-left:2em">get_IsValueType</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>.GetTypeInfo().IsValueType</td> </tr> <tr> <td style="padding-left:2em">GetConstructor(System.Reflection.BindingFlags,System.Reflection.Binder,System.Type[],System.Reflection.ParameterModifier[])</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use GetConstructor(Type[]) to search for public constructors by parameter type or filter the results of GetConstructors(BindingFlags) using LINQ for other queries.</td> </tr> <tr> <td style="padding-left:2em">GetConstructor(System.Type[])</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">GetConstructors(System.Reflection.BindingFlags)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Equivalent available: Add using for System.Reflection, and reference System.Reflection.TypeExtensions </td> </tr> <tr> <td style="padding-left:2em">GetGenericArguments</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">GetInterfaces</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">GetMethod(System.String)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">GetMethod(System.String,System.Reflection.BindingFlags)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Equivalent available: Add using for System.Reflection, and reference System.Reflection.TypeExtensions </td> </tr> <tr> <td style="padding-left:2em">GetMethod(System.String,System.Type[],System.Reflection.ParameterModifier[])</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use GetMethod(string, Type[]) to search for public methods by name and parameter type or filter the results of GetMethods(BindingFlags) using LINQ for other queries.</td> </tr> <tr> <td style="padding-left:2em">GetMethods</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">GetProperties</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">GetProperty(System.String)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">IsAssignableFrom(System.Type)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </tbody> </table> <p> <a href="#Portability Summary">Back to Summary</a> </p> </div> </div> </body> </html>
#ifndef <API key> #define <API key> #include <QDebug> #include <QCoreApplication> #include <QString> #include <QMap> #include <QSettings> #include <QDir> class AppSettingsStorage { public: enum Settings { ACCOUNT_LOGIN = 0, ACCOUNT_PASS, APP_RUN_ON_BOOT, APP_START_MINIMIZED, APP_STATUS }; AppSettingsStorage(); static void initColumnNames() { settingsMap.insert(ACCOUNT_LOGIN, "account/login"); settingsMap.insert(ACCOUNT_PASS, "account/password"); settingsMap.insert(APP_RUN_ON_BOOT, "app/runOnbootCheckBox"); settingsMap.insert(APP_START_MINIMIZED, "app/<API key>"); settingsMap.insert(APP_STATUS, "app/status"); } QMap<QString, QString> loadSettings(); void storeSettings(QMap<QString, QString> properties); signals: public slots: public: const static QSettings *settings; static QMap<Settings, QString> settingsMap; }; #endif // <API key>
<?php return array( 'table_liaison' => '<API key>', '<API key>' => 'mooc_', 'forbidden_words' => array( // 3 lettres 'les', 'des', 'ses', 'son', 'mes', 'mon', 'tes', 'ton', 'une', 'aux', 'est', 'sur', 'par', 'dit', 'the', // 4 lettres 'pour','sans','dans','avec','deux','vers', // 5 lettres 'titre', ), /** @brief allowed some chars in words indexed and in search */ 'allowable_chars' => '*?', 'min_word_len' => 3, /** @brief max number of joins for a search */ 'max_join' => 4, /** @brief For debugging */ 'debug' => false, /** @brief use a transaction to speed up InnoDB insert */ 'transaction' => false, /** @brief use INSERT DELAYED, for MyISAM Engine only*/ 'insert_delayed' => true, /** @brief group insertion of words */ 'words_by_insert' => 100, /** @brief score can be improved by this config*/ 'title_boost' => 3, 'html_boost' => array( 'h1' => 3, 'h2' => 2, 'h3' => 1, 'strong' => 1, ) );
/* vim: set syntax=javascript ts=8 sts=8 sw=8 noet: */ var BINDING = require('./lockfd_binding'); function check_arg(pos, name, value, type) { if (typeof (value) !== type) { throw (new Error('argument #' + pos + ' (' + name + ') must be of type ' + type)); } } function lockfd(fd, callback) { check_arg(1, 'fd', fd, 'number'); check_arg(2, 'callback', callback, 'function'); BINDING.lock_fd(fd, 'write', false, function (ret, errmsg, errno) { var err = null; if (ret === -1) { err = new Error('File Locking Error: ' + errmsg); err.code = errno; } setImmediate(callback, err); }); } function lockfdSync(fd) { var cb_fired = false; var err; check_arg(1, 'fd', fd, 'number'); BINDING.lock_fd(fd, 'write', true, function (ret, errno, errmsg) { cb_fired = true; if (ret === -1) { err = new Error('File Locking Error: ' + errmsg); err.__errno = errno; return; } }); if (!cb_fired) { throw (new Error('lockfdSync: CALLBACK NOT FIRED')); } else if (err) { throw (err); } return (null); } function flock(fd, op, callback) { check_arg(1, 'fd', fd, 'number'); check_arg(2, 'op', op, 'number'); check_arg(3, 'callback', callback, 'function'); BINDING.flock(fd, op, false, function (ret, errmsg, errno) { var err = null; if (ret === -1) { err = new Error('File Locking Error: ' + errmsg); err.code = errno; } setImmediate(callback, err); }); } function flockSync(fd, op) { var cb_fired = false; var err; check_arg(1, 'fd', fd, 'number'); check_arg(2, 'op', op, 'number'); BINDING.flock(fd, op, true, function (ret, errmsg, errno) { cb_fired = true; if (ret === -1) { err = new Error('File Locking Error: ' + errmsg); err.code = errno; return; } }); if (!cb_fired) { throw (new Error('flockSync: CALLBACK NOT FIRED')); } else if (err) { throw (err); } return (null); } module.exports = { LOCK_SH: 1, LOCK_EX: 2, LOCK_NB: 4, LOCK_UN: 8, flock: flock, flockSync: flockSync, lockfd: lockfd, lockfdSync: lockfdSync };
'use strict'; angular.module('depthyApp') .controller('DrawCtrl', function ($scope, $element, depthy, $window, $timeout) { var drawer = depthy.drawMode, viewer = depthy.getViewer(), lastPointerPos = null, oldViewerOpts = angular.extend({}, depthy.viewer); drawer.setOptions(depthy.drawOptions || { depth: 0.5, size: 0.05, hardness: 0.5, opacity: 0.25, }); angular.extend(depthy.viewer, { animate: false, fit: 'contain', upscale: 2, // depthPreview: 0.75, // orient: false, // hover: false, }); $scope.drawer = drawer; $scope.drawOpts = drawer.getOptions(); $scope.preview = 1; $scope.brushMode = false; $scope.$watch('drawOpts', function(options) { if (drawer && options) { drawer.setOptions(options); } }, true); $scope.$watch('preview', function(preview) { depthy.viewer.orient = preview === 2; depthy.viewer.hover = preview === 2; depthy.viewer.animate = preview === 2 && oldViewerOpts.animate; depthy.viewer.quality = preview === 2 ? false : 1; depthy.animateOption(depthy.viewer, { depthPreview: preview === 0 ? 1 : preview === 1 ? 0.75 : 0, depthScale: preview === 2 ? oldViewerOpts.depthScale : 0, depthBlurSize: preview === 2 ? oldViewerOpts.depthBlurSize : 0, enlarge: 1.0, }, 250); }); $scope.togglePreview = function() { console.log('togglePreview', $scope.preview); // $scope.preview = ++$scope.preview % 3; $scope.preview = $scope.preview === 1 ? 2 : 1; }; $scope.done = function() { $window.history.back(); }; $scope.cancel = function() { drawer.cancel(); $window.history.back(); }; $scope.brushIcon = function() { switch($scope.brushMode) { case 'picker': return 'target'; case 'level': return 'magnet'; default: return 'draw'; } }; $element.on('touchstart mousedown', function(e) { console.log('mousedown'); var event = e.originalEvent, pointerEvent = event.touches ? event.touches[0] : event; if (event.target.id !== 'draw') return; lastPointerPos = viewer.screenToImagePos({x: pointerEvent.pageX, y: pointerEvent.pageY}); if ($scope.brushMode === 'picker' || $scope.brushMode === 'level') { $scope.drawOpts.depth = drawer.getDepthAtPos(lastPointerPos); console.log('Picked %s', $scope.drawOpts.depth); if ($scope.brushMode === 'picker') { $scope.brushMode = false; lastPointerPos = null; $scope.$safeApply(); event.preventDefault(); event.stopPropagation(); return; } else { $scope.$safeApply(); } } drawer.drawBrush(lastPointerPos); // updateDepthMap(); event.preventDefault(); event.stopPropagation(); }); $element.on('touchmove mousemove', function(e) { if (lastPointerPos) { var event = e.originalEvent, pointerEvent = event.touches ? event.touches[0] : event, pointerPos = viewer.screenToImagePos({x: pointerEvent.pageX, y: pointerEvent.pageY}); drawer.drawBrushTo(pointerPos); lastPointerPos = pointerPos; } }); $element.on('touchend mouseup', function(event) { console.log('mouseup', event); if (lastPointerPos) { lastPointerPos = null; $scope.$safeApply(); } // if(window.location.href.indexOf('preview')<0){ // updateDepthMap(); }); $element.on('click', function(e) { console.log('click'); // updateDepthMap(); }); function getSliderForKey(e) { var id = 'draw-brush-depth'; if (e.shiftKey && e.altKey) { id = 'draw-brush-hardness'; } else if (e.altKey) { id = 'draw-brush-opacity'; } else if (e.shiftKey) { id = 'draw-brush-size'; } var el = $element.find('.' + id + ' [range-stepper]'); el.click(); // simulate click to notify change return el.controller('rangeStepper'); } function onKeyDown(e) { console.log('keydown', e); var s, handled = false; console.log('keydown which %d shift %s alt %s ctrl %s', e.which, e.shiftKey, e.altKey, e.ctrlKey); if (e.which === 48) { getSliderForKey(e).percent(0.5); handled = true; } else if (e.which >= 49 && e.which <= 57) { getSliderForKey(e).percent((e.which - 49) / 8); handled = true; } else if (e.which === 189) { s = getSliderForKey(e); s.percent(s.percent() - 0.025); handled = true; } else if (e.which === 187) { s = getSliderForKey(e); s.percent(s.percent() + 0.025); handled = true; } else if (e.which === 32) { $element.find('.draw-preview').click(); handled = true; } else if (e.which === 90) { $element.find('.draw-undo').click(); handled = true; } else if (e.which === 80) { $element.find('.draw-picker').click(); handled = true; } else if (e.which === 76) { $element.find('.draw-level').click(); handled = true; } else if (e.which === 81) { $scope.preview = $scope.preview === 1 ? 2 : 1; handled = true; } if (handled) { e.preventDefault(); $scope.$safeApply(); } } $($window).on('keydown', onKeyDown); $element.find('.draw-brush-depth').on('touchstart mousedown click', function() { $scope.brushMode = false; }); $element.on('$destroy', function() { $element.off('touchstart mousedown'); $element.off('touchmove mousemove'); $($window).off('keydown', onKeyDown); depthy.animateOption(depthy.viewer, { depthPreview: oldViewerOpts.depthPreview, depthScale: oldViewerOpts.depthScale, depthBlurSize: oldViewerOpts.depthBlurSize, enlarge: oldViewerOpts.enlarge, }, 250); $timeout(function() { angular.extend(depthy.viewer, oldViewerOpts); }, 251); if (drawer.isCanceled()) { // restore opened depthmap viewer.setDepthmap(depthy.opened.depthSource, depthy.opened.depthUsesAlpha); } else { if (drawer.isModified()) { updateDepthMap(); } } drawer.destroy(true); }); function updateDepthMap(){ depthy.drawOptions = drawer.getOptions(); // remember drawn depthmap // store it as jpg console.log('updateDepthMap',viewer); viewer.exportDepthmap().then(function(url) { depthy.opened.markAsModified(); depthy.opened.depthSource = url; //viewer.getDepthmap().texture; depthy.opened.depthUsesAlpha = false; viewer.setDepthmap(url); depthy.opened.onDepthmapOpened(); localStorage.depthMapUrl = url; var intercom = Intercom.getInstance(); intercom.emit('depthMapUrl', {message: url}); }); } });
<?xml version="1.0" ?><!DOCTYPE TS><TS language="el_GR" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About BigBang</source> <translation type="unfinished"/> </message> <message> <location line="+39"/> <source>&lt;b&gt;BigBang&lt;/b&gt; version</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2014 The NovaCoin developers Copyright © 2014 The BigBang developers</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http: This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http: <translation> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http: This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http: </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>Διπλό-κλικ για επεξεργασία της διεύθυνσης ή της ετικέτας</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Δημιούργησε νέα διεύθυνση</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Αντέγραψε την επιλεγμένη διεύθυνση στο πρόχειρο του συστήματος</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation type="unfinished"/> </message> <message> <location line="-46"/> <source>These are your BigBang addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation type="unfinished"/> </message> <message> <location line="+60"/> <source>&amp;Copy Address</source> <translation>&amp;Αντιγραφή διεύθυνσης</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a BigBang address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Αντιγραφη της επιλεγμενης διεύθυνσης στο πρόχειρο του συστηματος</translation> </message> <message> <location line="-14"/> <source>Verify a message to ensure it was signed with a specified BigBang address</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation type="unfinished"/> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>&amp;Διαγραφή</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation>Αντιγραφή &amp;επιγραφής</translation> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation>&amp;Επεξεργασία</translation> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Αρχείο οριοθετημένο με κόμματα (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Ετικέτα</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Διεύθυνση</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(χωρίς ετικέτα)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Φράση πρόσβασης </translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Βάλτε κωδικό πρόσβασης</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Νέος κωδικός πρόσβασης</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Επανέλαβε τον νέο κωδικό πρόσβασης</translation> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>For staking only</source> <translation type="unfinished"/> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+35"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Εισάγετε τον νέο κωδικό πρόσβασης στον πορτοφόλι &lt;br/&gt; Παρακαλώ χρησιμοποιείστε ένα κωδικό με &lt;b&gt; 10 ή περισσότερους τυχαίους χαρακτήρες&lt;/b&gt; ή &lt;b&gt; οχτώ ή παραπάνω λέξεις&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Κρυπτογράφησε το πορτοφόλι</translation> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Αυτη η ενεργεία χρειάζεται τον κωδικό του πορτοφολιού για να ξεκλειδώσει το πορτοφόλι.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Ξεκλειδωσε το πορτοφολι</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Αυτη η ενεργεια χρειάζεται τον κωδικο του πορτοφολιου για να αποκρυπτογραφησειι το πορτοφολι.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Αποκρυπτογράφησε το πορτοφολι</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Άλλαξε κωδικο πρόσβασης</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Εισάγετε τον παλιό και τον νεο κωδικο στο πορτοφολι.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Επιβεβαίωσε την κρυπτογραφηση του πορτοφολιού</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR COINS&lt;/b&gt;!</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Είστε σίγουροι ότι θέλετε να κρυπτογραφήσετε το πορτοφόλι σας;</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>ΣΗΜΑΝΤΙΚΟ: Τα προηγούμενα αντίγραφα ασφαλείας που έχετε κάνει από το αρχείο του πορτοφόλιου σας θα πρέπει να αντικατασταθουν με το νέο που δημιουργείται, κρυπτογραφημένο αρχείο πορτοφόλιου. Για λόγους ασφαλείας, τα προηγούμενα αντίγραφα ασφαλείας του μη κρυπτογραφημένου αρχείου πορτοφόλιου θα καταστουν άχρηστα μόλις αρχίσετε να χρησιμοποιείτε το νέο κρυπτογραφημένο πορτοφόλι. </translation> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Προσοχη: το πλήκτρο Caps Lock είναι ενεργο.</translation> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation>Κρυπτογραφημενο πορτοφολι</translation> </message> <message> <location line="-58"/> <source>BigBang will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Η κρυπτογραφηση του πορτοφολιού απέτυχε</translation> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Η κρυπτογράφηση του πορτοφολιού απέτυχε λογω εσωτερικού σφάλματος. Το πορτοφολι δεν κρυπτογραφηθηκε.</translation> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation>Οι εισαχθέντες κωδικοί δεν ταιριάζουν.</translation> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation>το ξεκλείδωμα του πορτοφολιού απέτυχε</translation> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Ο κωδικος που εισήχθη για την αποκρυπτογραφηση του πορτοφολιού ήταν λαθος.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Η αποκρυπτογραφηση του πορτοφολιού απέτυχε</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Ο κωδικος του πορτοφολιού άλλαξε με επιτυχία.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+282"/> <source>Sign &amp;message...</source> <translation>Υπογραφή &amp;Μηνύματος...</translation> </message> <message> <location line="+251"/> <source>Synchronizing with network...</source> <translation>Συγχρονισμός με το δίκτυο...</translation> </message> <message> <location line="-319"/> <source>&amp;Overview</source> <translation>&amp;Επισκόπηση</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Εμφάνισε τη γενική εικόνα του πορτοφολιού</translation> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation>&amp;Συναλλαγές</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Περιήγηση στο ιστορικό συναλλαγών</translation> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation type="unfinished"/> </message> <message> <location line="-13"/> <source>&amp;Receive coins</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show the list of addresses for receiving payments</source> <translation type="unfinished"/> </message> <message> <location line="-7"/> <source>&amp;Send coins</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>E&amp;xit</source> <translation>Έ&amp;ξοδος</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Εξοδος από την εφαρμογή</translation> </message> <message> <location line="+6"/> <source>Show information about BigBang</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Σχετικά με &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Εμφάνισε πληροφορίες σχετικά με Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Επιλογές...</translation> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Κρυπτογράφησε το πορτοφόλι</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Αντίγραφο ασφαλείας του πορτοφολιού</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Άλλαξε κωδικο πρόσβασης</translation> </message> <message numerus="yes"> <location line="+259"/> <source>~%n block(s) remaining</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source> <translation type="unfinished"/> </message> <message> <location line="-256"/> <source>&amp;Export...</source> <translation type="unfinished"/> </message> <message> <location line="-64"/> <source>Send coins to a BigBang address</source> <translation type="unfinished"/> </message> <message> <location line="+47"/> <source>Modify configuration options for BigBang</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Export the data in the current tab to a file</source> <translation type="unfinished"/> </message> <message> <location line="-14"/> <source>Encrypt or decrypt wallet</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup wallet to another location</source> <translation>Δημιουργία αντιγράφου ασφαλείας πορτοφολιού σε άλλη τοποθεσία</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Αλλαγή του κωδικού κρυπτογράφησης του πορτοφολιού</translation> </message> <message> <location line="+10"/> <source>&amp;Debug window</source> <translation>&amp;Παράθυρο αποσφαλμάτωσης</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Άνοιγμα κονσόλας αποσφαλμάτωσης και διαγνωστικών</translation> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation>&amp;Επιβεβαίωση μηνύματος</translation> </message> <message> <location line="-202"/> <source>BigBang</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet</source> <translation>Πορτοφόλι</translation> </message> <message> <location line="+180"/> <source>&amp;About BigBang</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>&amp;Εμφάνισε/Κρύψε</translation> </message> <message> <location line="+9"/> <source>Unlock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>&amp;Lock Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Lock wallet</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>&amp;File</source> <translation>&amp;Αρχείο</translation> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation>&amp;Ρυθμίσεις</translation> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation>&amp;Βοήθεια</translation> </message> <message> <location line="+12"/> <source>Tabs toolbar</source> <translation>Εργαλειοθήκη καρτελών</translation> </message> <message> <location line="+8"/> <source>Actions toolbar</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <location line="+9"/> <source>[testnet]</source> <translation>[testnet]</translation> </message> <message> <location line="+0"/> <location line="+60"/> <source>BigBang client</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+75"/> <source>%n active connection(s) to BigBang network</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+40"/> <source>Downloaded %1 blocks of transaction history.</source> <translation type="unfinished"/> </message> <message> <location line="+413"/> <source>Staking.&lt;br&gt;Your weight is %1&lt;br&gt;Network weight is %2&lt;br&gt;Expected time to earn reward is %3</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Not staking because wallet is locked</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is offline</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because wallet is syncing</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Not staking because you don&apos;t have mature coins</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="-403"/> <source>%n second(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="-312"/> <source>About BigBang card</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show information about BigBang card</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>&amp;Unlock Wallet...</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+297"/> <source>%n minute(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s) ago</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+6"/> <source>Up to date</source> <translation>Ενημερωμένο</translation> </message> <message> <location line="+7"/> <source>Catching up...</source> <translation>Ενημέρωση...</translation> </message> <message> <location line="+10"/> <source>Last received block was generated %1.</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm transaction fee</source> <translation type="unfinished"/> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation>Η συναλλαγή απεστάλη</translation> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation>Εισερχόμενη συναλλαγή</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Ημερομηνία: %1 Ποσό: %2 Τύπος: %3 Διεύθυνση: %4 </translation> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation type="unfinished"/> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid BigBang address or malformed URI parameters.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Το πορτοφόλι είναι &lt;b&gt;κρυπτογραφημένο&lt;/b&gt; και &lt;b&gt;ξεκλείδωτο&lt;/b&gt;</translation> </message> <message> <location line="+10"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Το πορτοφόλι είναι &lt;b&gt;κρυπτογραφημένο&lt;/b&gt; και &lt;b&gt;κλειδωμένο&lt;/b&gt;</translation> </message> <message> <location line="+25"/> <source>Backup Wallet</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation type="unfinished"/> </message> <message numerus="yes"> <location line="+76"/> <source>%n second(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n hour(s)</source> <translation><numerusform>%n ώρες </numerusform><numerusform>%n ώρες </numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n ημέρες </numerusform><numerusform>%n ημέρες </numerusform></translation> </message> <message> <location line="+18"/> <source>Not staking</source> <translation type="unfinished"/> </message> <message> <location filename="../bitcoin.cpp" line="+109"/> <source>A fatal error occurred. BigBang can no longer continue safely and will quit.</source> <translation type="unfinished"/> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+90"/> <source>Network Alert</source> <translation>Ειδοποίηση Δικτύου</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Amount:</source> <translation>Ποσό:</translation> </message> <message> <location line="+32"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+48"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="+551"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change:</source> <translation type="unfinished"/> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>List mode</source> <translation type="unfinished"/> </message> <message> <location line="+45"/> <source>Amount</source> <translation>Ποσό</translation> </message> <message> <location line="+5"/> <source>Label</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Address</source> <translation>Διεύθυνση</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation>Ημερομηνία</translation> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation>Επικυρωμένες</translation> </message> <message> <location line="+5"/> <source>Priority</source> <translation type="unfinished"/> </message> <message> <location filename="../coincontroldialog.cpp" line="-515"/> <source>Copy address</source> <translation>Αντιγραφή διεύθυνσης</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Αντιγραφή επιγραφής</translation> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation>Αντιγραφή ποσού</translation> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation>Αντιγραφη του ID Συναλλαγής</translation> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+317"/> <source>highest</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium-high</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>low-medium</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>low</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>lowest</source> <translation type="unfinished"/> </message> <message> <location line="+155"/> <source>DUST</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>yes</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Transactions with higher priority get more likely into a block. This label turns red, if the priority is smaller than &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if any recipient receives an amount smaller than %1. This means a fee of at least %2 is required. Amounts below 0.546 times the minimum relay fee are shown as DUST.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>This label turns red, if the change is smaller than %1. This means a fee of at least %2 is required.</source> <translation type="unfinished"/> </message> <message> <location line="+37"/> <location line="+66"/> <source>(no label)</source> <translation>(χωρίς ετικέτα)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>(change)</source> <translation type="unfinished"/> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Επεξεργασία Διεύθυνσης</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Επιγραφή</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Διεύθυνση</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation type="unfinished"/> </message> <message> <location filename="../editaddressdialog.cpp" line="+20"/> <source>New receiving address</source> <translation>Νέα διεύθυνση λήψης</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Νέα διεύθυνση αποστολής</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Επεξεργασία διεύθυνσης λήψης</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Επεξεργασία διεύθυνσης αποστολής</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Η διεύθυνση &quot;%1&quot; βρίσκεται ήδη στο βιβλίο διευθύνσεων.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid BigBang address.</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Δεν είναι δυνατό το ξεκλείδωμα του πορτοφολιού.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Η δημιουργία νέου κλειδιού απέτυχε.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+420"/> <location line="+12"/> <source>BigBang-Qt</source> <translation type="unfinished"/> </message> <message> <location line="-12"/> <source>version</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Usage:</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>UI options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation type="unfinished"/> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Ρυθμίσεις</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Κύριο</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Αμοιβή &amp;συναλλαγής</translation> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Reserve</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Automatically start BigBang after logging in to the system.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Start BigBang on system login</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Detach databases at shutdown</source> <translation type="unfinished"/> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation>&amp;Δίκτυο</translation> </message> <message> <location line="+6"/> <source>Automatically open the BigBang client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Απόδοση θυρών με χρήστη &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the BigBang network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>&amp;IP διαμεσολαβητή:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Θύρα:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Θύρα διαμεσολαβητή</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>SOCKS &amp;Έκδοση:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>SOCKS εκδοση του διαμεσολαβητη (e.g. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Παράθυρο</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Εμφάνιση μόνο εικονιδίου στην περιοχή ειδοποιήσεων κατά την ελαχιστοποίηση</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Ελαχιστοποίηση στην περιοχή ειδοποιήσεων αντί της γραμμής εργασιών</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>Ελαχιστοποίηση αντί για έξοδο κατά το κλείσιμο του παραθύρου</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>Ε&amp;λαχιστοποίηση κατά το κλείσιμο</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Απεικόνιση</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>Γλώσσα περιβάλλοντος εργασίας: </translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting BigBang.</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Μονάδα μέτρησης:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Διαλέξτε την προεπιλεγμένη υποδιαίρεση που θα εμφανίζεται όταν στέλνετε νομίσματα.</translation> </message> <message> <location line="+9"/> <source>Whether to show BigBang addresses in the transaction list or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>Εμφάνιση διευθύνσεων στη λίστα συναλλαγών</translation> </message> <message> <location line="+7"/> <source>Whether to show coin control features or not.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;ΟΚ</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Ακύρωση</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation type="unfinished"/> </message> <message> <location filename="../optionsdialog.cpp" line="+55"/> <source>default</source> <translation>προεπιλογή</translation> </message> <message> <location line="+149"/> <location line="+9"/> <source>Warning</source> <translation type="unfinished"/> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting BigBang.</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>Δεν είναι έγκυρη η διεύθυνση διαμεσολαβητή</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Φόρμα</translation> </message> <message> <location line="+33"/> <location line="+231"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the BigBang network after a connection is established, but this process has not completed yet.</source> <translation type="unfinished"/> </message> <message> <location line="-160"/> <source>Stake:</source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation type="unfinished"/> </message> <message> <location line="-107"/> <source>Wallet</source> <translation>Πορτοφόλι</translation> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation>Το τρέχον διαθέσιμο υπόλοιπο</translation> </message> <message> <location line="+71"/> <source>Immature:</source> <translation>Ανώριμος</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Εξορυγμενο υπόλοιπο που δεν έχει ακόμα ωριμάσει </translation> </message> <message> <location line="+20"/> <source>Total:</source> <translation>Σύνολο:</translation> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation>Το τρέχον συνολικό υπόλοιπο</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Πρόσφατες συναλλαγές&lt;/b&gt;</translation> </message> <message> <location line="-108"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location line="-29"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation type="unfinished"/> </message> <message> <location filename="../overviewpage.cpp" line="+113"/> <location line="+1"/> <source>out of sync</source> <translation>εκτός συγχρονισμού</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation type="unfinished"/> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation type="unfinished"/> </message> <message> <location line="+56"/> <source>Amount:</source> <translation type="unfinished"/> </message> <message> <location line="-44"/> <source>Label:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Message:</source> <translation type="unfinished"/> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation type="unfinished"/> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation type="unfinished"/> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Όνομα Πελάτη</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+348"/> <source>N/A</source> <translation>Μη διαθέσιμο</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Έκδοση Πελάτη</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Πληροφορία</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Χρησιμοποιηση της OpenSSL εκδοσης</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Χρόνος εκκίνησης</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Δίκτυο</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Αριθμός συνδέσεων</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation type="unfinished"/> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Αλυσίδα μπλοκ</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Τρέχον αριθμός μπλοκ</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Κατ&apos; εκτίμηση συνολικά μπλοκς</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Χρόνος τελευταίου μπλοκ</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Άνοιγμα</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Show the BigBang-Qt help message to get a list with possible BigBang command-line options.</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation type="unfinished"/> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Κονσόλα</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Ημερομηνία κατασκευής</translation> </message> <message> <location line="-104"/> <source>BigBang - Debug window</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>BigBang Core</source> <translation type="unfinished"/> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Αρχείο καταγραφής εντοπισμού σφαλμάτων </translation> </message> <message> <location line="+7"/> <source>Open the BigBang debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation type="unfinished"/> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Καθαρισμός κονσόλας</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-33"/> <source>Welcome to the BigBang RPC console.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Χρησιμοποιήστε το πάνω και κάτω βέλος για να περιηγηθείτε στο ιστορικο, και &lt;b&gt;Ctrl-L&lt;/b&gt; για εκκαθαριση οθονης.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Γράψτε &lt;b&gt;help&lt;/b&gt; για μια επισκόπηση των διαθέσιμων εντολών</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+182"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Αποστολή νομισμάτων</translation> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation type="unfinished"/> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation type="unfinished"/> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation type="unfinished"/> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation type="unfinished"/> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Amount:</source> <translation>Ποσό:</translation> </message> <message> <location line="+22"/> <location line="+86"/> <location line="+86"/> <location line="+32"/> <source>0.00 BBC</source> <translation type="unfinished"/> </message> <message> <location line="-191"/> <source>Priority:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>medium</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation type="unfinished"/> </message> <message> <location line="+19"/> <source>no</source> <translation type="unfinished"/> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>Change</source> <translation type="unfinished"/> </message> <message> <location line="+50"/> <source>custom change address</source> <translation type="unfinished"/> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation>Αποστολή σε πολλούς αποδέκτες ταυτόχρονα</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>&amp;Προσθήκη αποδέκτη</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Καθαρισμός &amp;Όλων</translation> </message> <message> <location line="+28"/> <source>Balance:</source> <translation>Υπόλοιπο:</translation> </message> <message> <location line="+16"/> <source>123.456 BBC</source> <translation type="unfinished"/> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Επιβεβαίωση αποστολής</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>Αποστολη</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-173"/> <source>Enter a BigBang address (e.g. <API key>)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Αντιγραφή ποσού</translation> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Copy change</source> <translation type="unfinished"/> </message> <message> <location line="+86"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Επιβεβαίωση αποστολής νομισμάτων</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source> and </source> <translation type="unfinished"/> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation>Η διεύθυνση του αποδέκτη δεν είναι σωστή. Παρακαλώ ελέγξτε ξανά.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Το ποσό πληρωμής πρέπει να είναι μεγαλύτερο από 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Το ποσό ξεπερνάει το διαθέσιμο υπόλοιπο</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Το σύνολο υπερβαίνει το υπόλοιπό σας όταν συμπεριληφθεί και η αμοιβή %1</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Βρέθηκε η ίδια διεύθυνση δύο φορές. Επιτρέπεται μία μόνο εγγραφή για κάθε διεύθυνση, σε κάθε διαδικασία αποστολής.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed.</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="+251"/> <source>WARNING: Invalid BigBang address</source> <translation type="unfinished"/> </message> <message> <location line="+13"/> <source>(no label)</source> <translation>(χωρίς ετικέτα)</translation> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation type="unfinished"/> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>&amp;Ποσό:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Πληρωμή &amp;σε:</translation> </message> <message> <location line="+24"/> <location filename="../sendcoinsentry.cpp" line="+25"/> <source>Enter a label for this address to add it to your address book</source> <translation>Εισάγετε μια επιγραφή για αυτή τη διεύθυνση ώστε να καταχωρηθεί στο βιβλίο διευθύνσεων</translation> </message> <message> <location line="+9"/> <source>&amp;Label:</source> <translation>&amp;Επιγραφή</translation> </message> <message> <location line="+18"/> <source>The address to send the payment to (e.g. <API key>)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Choose address from address book</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Επικόλληση διεύθυνσης από το πρόχειρο</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation type="unfinished"/> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a BigBang address (e.g. <API key>)</source> <translation type="unfinished"/> </message> </context> <context> <name><API key></name> <message> <location filename="../forms/<API key>.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Υπογραφές - Είσοδος / Επαλήθευση μήνυματος </translation> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation>&amp;Υπογραφή Μηνύματος</translation> </message> <message> <location line="-118"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>Μπορείτε να υπογράφετε μηνύματα με τις διευθύνσεις σας, ώστε ν&apos; αποδεικνύετε πως αυτές σας ανήκουν. Αποφεύγετε να υπογράφετε κάτι αόριστο καθώς ενδέχεται να εξαπατηθείτε. Υπογράφετε μόνο πλήρης δηλώσεις με τις οποίες συμφωνείτε.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. <API key>)</source> <translation type="unfinished"/> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation type="unfinished"/> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation>Επικόλληση διεύθυνσης από το βιβλίο διευθύνσεων</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>Εισάγετε εδώ το μήνυμα που θέλετε να υπογράψετε</translation> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation>Αντέγραφη της επιλεγμενης διεύθυνσης στο πρόχειρο του συστηματος</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this BigBang address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation>Επαναφορά όλων των πεδίων μήνυματος</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Καθαρισμός &amp;Όλων</translation> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation>&amp;Επιβεβαίωση μηνύματος</translation> </message> <message> <location line="-64"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>Πληκτρολογήστε την υπογραφή διεύθυνσης, μήνυμα (βεβαιωθείτε ότι έχετε αντιγράψει τις αλλαγές γραμμής, κενά, tabs, κ.λπ. ακριβώς) και την υπογραφή παρακάτω, για να ελέγξει το μήνυμα. Να είστε προσεκτικοί για να μην διαβάσετε περισσότερα στην υπογραφή ό, τι είναι στην υπογραφή ίδιο το μήνυμα , για να μην εξαπατηθούν από έναν άνθρωπο -in - the-middle επίθεση.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. <API key>)</source> <translation type="unfinished"/> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified BigBang address</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation>Επαναφορά όλων επαλήθευμενων πεδίων μήνυματος </translation> </message> <message> <location filename="../<API key>.cpp" line="+27"/> <location line="+3"/> <source>Enter a BigBang address (e.g. <API key>)</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Κάντε κλικ στο &quot;Υπογραφή Μηνύματος&quot; για να λάβετε την υπογραφή</translation> </message> <message> <location line="+3"/> <source>Enter BigBang signature</source> <translation type="unfinished"/> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>Η διεύθυνση που εισήχθη είναι λάθος.</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Παρακαλούμε ελέγξτε την διεύθυνση και δοκιμάστε ξανά.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>Η διεύθυνση που έχει εισαχθεί δεν αναφέρεται σε ένα πλήκτρο.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>το ξεκλείδωμα του πορτοφολιού απέτυχε</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>Το προσωπικό κλειδί εισαγμενης διευθυνσης δεν είναι διαθέσιμο.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Η υπογραφή του μηνύματος απέτυχε.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Μήνυμα υπεγράφη.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>Η υπογραφή δεν μπόρεσε να αποκρυπτογραφηθεί.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Παρακαλούμε ελέγξτε την υπογραφή και δοκιμάστε ξανά.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>Η υπογραφή δεν ταιριάζει με το μήνυμα. </translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Η επιβεβαίωση του μηνύματος απέτυχε</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Μήνυμα επιβεβαιώθηκε.</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+19"/> <source>Open until %1</source> <translation>Ανοιχτό μέχρι %1</translation> </message> <message numerus="yes"> <location line="-2"/> <source>Open for %n block(s)</source> <translation type="unfinished"><numerusform></numerusform><numerusform></numerusform></translation> </message> <message> <location line="+8"/> <source>conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation>%1/χωρίς σύνδεση;</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/χωρίς επιβεβαίωση</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 επιβεβαιώσεις</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Κατάσταση</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, έχει μεταδοθεί μέσω %n κόμβων</numerusform><numerusform>, έχει μεταδοθεί μέσω %n κόμβων</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Ημερομηνία</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Πηγή</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Δημιουργία </translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>Από</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Προς</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation> δική σας διεύθυνση </translation> </message> <message> <location line="-2"/> <source>label</source> <translation>eπιγραφή</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Πίστωση </translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>ωρίμανση σε %n επιπλέον μπλοκ</numerusform><numerusform>ωρίμανση σε %n επιπλέον μπλοκ</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>μη αποδεκτό</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Debit</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Τέλος συναλλαγής </translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Καθαρό ποσό</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Μήνυμα</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Σχόλιο:</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID Συναλλαγής:</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 110 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation type="unfinished"/> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Πληροφορίες αποσφαλμάτωσης</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Συναλλαγή</translation> </message> <message> <location line="+5"/> <source>Inputs</source> <translation>εισροές </translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Ποσό</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>αληθής</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>αναληθής </translation> </message> <message> <location line="-211"/> <source>, has not been successfully broadcast yet</source> <translation>, δεν έχει ακόμα μεταδοθεί μ&apos; επιτυχία</translation> </message> <message> <location line="+35"/> <source>unknown</source> <translation>άγνωστο</translation> </message> </context> <context> <name><API key></name> <message> <location filename="../forms/<API key>.ui" line="+14"/> <source>Transaction details</source> <translation>Λεπτομέρειες συναλλαγής</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Αυτό το παράθυρο δείχνει μια λεπτομερή περιγραφή της συναλλαγής</translation> </message> </context> <context> <name><API key></name> <message> <location filename="../<API key>.cpp" line="+226"/> <source>Date</source> <translation>Ημερομηνία</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Τύπος</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Διεύθυνση</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Ποσό</translation> </message> <message> <location line="+60"/> <source>Open until %1</source> <translation>Ανοιχτό μέχρι %1</translation> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation>Επικυρωμένη (%1 επικυρώσεις)</translation> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation><numerusform>Ανοιχτό για %n μπλοκ</numerusform><numerusform>Ανοιχτό για %n μπλοκ</numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Αυτό το μπλοκ δεν έχει παραληφθεί από κανέναν άλλο κόμβο και κατά πάσα πιθανότητα θα απορριφθεί!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Δημιουργήθηκε αλλά απορρίφθηκε</translation> </message> <message> <location line="+42"/> <source>Received with</source> <translation>Παραλαβή με</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Ελήφθη από</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Αποστολή προς</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Πληρωμή προς εσάς</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Εξόρυξη</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(δ/α)</translation> </message> <message> <location line="+190"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Κατάσταση συναλλαγής. Πηγαίνετε το ποντίκι πάνω από αυτό το πεδίο για να δείτε τον αριθμό των επικυρώσεων</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Ημερομηνία κι ώρα λήψης της συναλλαγής.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Είδος συναλλαγής.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Διεύθυνση αποστολής της συναλλαγής.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Ποσό που αφαιρέθηκε ή προστέθηκε στο υπόλοιπο.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+55"/> <location line="+16"/> <source>All</source> <translation>Όλα</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Σήμερα</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Αυτή την εβδομάδα</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Αυτόν τον μήνα</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Τον προηγούμενο μήνα</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Αυτό το έτος</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Έκταση...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Ελήφθη με</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Απεστάλη προς</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Προς εσάς</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Εξόρυξη</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Άλλο</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Αναζήτηση με βάση τη διεύθυνση ή την επιγραφή</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Ελάχιστο ποσό</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Αντιγραφή διεύθυνσης</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Αντιγραφή επιγραφής</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Αντιγραφή ποσού</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Αντιγραφη του ID Συναλλαγής</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Επεξεργασία επιγραφής</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Εμφάνιση λεπτομερειών συναλλαγής</translation> </message> <message> <location line="+144"/> <source>Export Transaction Data</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Αρχείο οριοθετημένο με κόμματα (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Επικυρωμένες</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Ημερομηνία</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Τύπος</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Επιγραφή</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Διεύθυνση</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Ποσό</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation type="unfinished"/> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation type="unfinished"/> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Έκταση:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>έως</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+206"/> <source>Sending...</source> <translation type="unfinished"/> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+33"/> <source>BigBang version</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Usage:</source> <translation>Χρήση:</translation> </message> <message> <location line="+1"/> <source>Send command to -server or BigBangd</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>List commands</source> <translation>Λίστα εντολών</translation> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation>Επεξήγηση εντολής</translation> </message> <message> <location line="+2"/> <source>Options:</source> <translation>Επιλογές:</translation> </message> <message> <location line="+2"/> <source>Specify configuration file (default: BigBang.conf)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Specify pid file (default: BigBangd.pid)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Ορισμός φακέλου δεδομένων</translation> </message> <message> <location line="+2"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Όρισε το μέγεθος της βάσης προσωρινής αποθήκευσης σε megabytes(προεπιλογή:25)</translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation type="unfinished"/> </message> <message> <location line="+6"/> <source>Listen for connections on &lt;port&gt; (default: 15714 or testnet: 25714)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Μέγιστες αριθμός συνδέσεων με τους peers &lt;n&gt; (προεπιλογή: 125)</translation> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Σύνδεση σε έναν κόμβο για την ανάκτηση διευθύνσεων από ομοτίμους, και αποσυνδέσh</translation> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation>Διευκρινίστε τη δικιά σας δημόσια διεύθυνση.</translation> </message> <message> <location line="+5"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Stake your coins to support network and gain reward (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Όριο αποσύνδεσης προβληματικών peers (προεπιλογή: 100)</translation> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Δευτερόλεπτα πριν επιτραπεί ξανά η σύνδεση των προβληματικών peers (προεπιλογή: 86400)</translation> </message> <message> <location line="-44"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Ένα σφάλμα συνέβη καθώς προετοιμαζόταν η πόρτα RPC %u για αναμονή IPv4: %s</translation> </message> <message> <location line="+51"/> <source>Detach block and address databases. Increases shutdown time (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+109"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source> <translation type="unfinished"/> </message> <message> <location line="-87"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 15715 or testnet: 25715)</source> <translation type="unfinished"/> </message> <message> <location line="-11"/> <source>Accept command line and JSON-RPC commands</source> <translation>Αποδοχή εντολών κονσόλας και JSON-RPC</translation> </message> <message> <location line="+101"/> <source>Error: Transaction creation failed </source> <translation type="unfinished"/> </message> <message> <location line="-5"/> <source>Error: Wallet locked, unable to create transaction </source> <translation type="unfinished"/> </message> <message> <location line="-8"/> <source>Importing blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Importing bootstrap blockchain data file.</source> <translation type="unfinished"/> </message> <message> <location line="-88"/> <source>Run in the background as a daemon and accept commands</source> <translation>Εκτέλεση στο παρασκήνιο κι αποδοχή εντολών</translation> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation>Χρήση του δοκιμαστικού δικτύου</translation> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Να δέχεσαι συνδέσεις από έξω(προεπιλογή:1)</translation> </message> <message> <location line="-38"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Ένα σφάλμα συνέβη καθώς προετοιμαζόταν η υποδοχη RPC %u για αναμονη του IPv6, επεσε πισω στο IPv4:%s</translation> </message> <message> <location line="+117"/> <source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source> <translation type="unfinished"/> </message> <message> <location line="-20"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Προειδοποίηση: Η παράμετρος -paytxfee είναι πολύ υψηλή. Πρόκειται για την αμοιβή που θα πληρώνετε για κάθε συναλλαγή που θα στέλνετε.</translation> </message> <message> <location line="+61"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong BigBang will not work properly.</source> <translation type="unfinished"/> </message> <message> <location line="-31"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Προειδοποίηση : Σφάλμα wallet.dat κατα την ανάγνωση ! Όλα τα κλειδιά αναγνωρισθηκαν σωστά, αλλά τα δεδομένα των συναλλαγών ή καταχωρήσεις στο βιβλίο διευθύνσεων μπορεί να είναι ελλιπείς ή λανθασμένα. </translation> </message> <message> <location line="-18"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Προειδοποίηση : το αρχειο wallet.dat ειναι διεφθαρμένο, τα δεδομένα σώζονται ! Original wallet.dat αποθηκεύονται ως wallet.{timestamp}.bak στο %s . Αν το υπόλοιπο του ή τις συναλλαγές σας, είναι λάθος θα πρέπει να επαναφέρετε από ένα αντίγραφο ασφαλείας</translation> </message> <message> <location line="-30"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Προσπάθεια για ανακτησει ιδιωτικων κλειδιων από ενα διεφθαρμένο αρχειο wallet.dat </translation> </message> <message> <location line="+4"/> <source>Block creation options:</source> <translation>Αποκλεισμός επιλογων δημιουργίας: </translation> </message> <message> <location line="-62"/> <source>Connect only to the specified node(s)</source> <translation>Σύνδεση μόνο με ορισμένους κόμβους</translation> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Ανακαλύψτε την δικη σας IP διεύθυνση (προεπιλογή: 1 όταν ακούει και δεν - externalip) </translation> </message> <message> <location line="+94"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>ταλαιπωρηθειτε για να ακούσετε σε οποιαδήποτε θύρα. Χρήση - ακούστε = 0 , αν θέλετε αυτό.</translation> </message> <message> <location line="-90"/> <source>Find peers using DNS lookup (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync checkpoints policy (default: strict)</source> <translation type="unfinished"/> </message> <message> <location line="+83"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation type="unfinished"/> </message> <message> <location line="-82"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Μέγιστος buffer λήψης ανά σύνδεση, &lt;n&gt;*1000 bytes (προεπιλογή: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Μέγιστος buffer αποστολής ανά σύνδεση, &lt;n&gt;*1000 bytes (προεπιλογή: 1000)</translation> </message> <message> <location line="-16"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation> Συνδέση μόνο σε κόμβους του δικτύου &lt;net&gt; (IPv4, IPv6 ή Tor) </translation> </message> <message> <location line="+28"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Prepend debug output with timestamp</source> <translation type="unfinished"/> </message> <message> <location line="+35"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation>Ρυθμίσεις SSL: (ανατρέξτε στο Bitcoin Wiki για οδηγίες ρυθμίσεων SSL)</translation> </message> <message> <location line="-74"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation type="unfinished"/> </message> <message> <location line="+41"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Αποστολή πληροφοριών εντοπισμού σφαλμάτων στην κονσόλα αντί του αρχείου debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation type="unfinished"/> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Ορίστε το μέγιστο μέγεθος μπλοκ σε bytes (προεπιλογή: 0)</translation> </message> <message> <location line="-29"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Συρρίκνωση του αρχείο debug.log κατα την εκκίνηση του πελάτη (προεπιλογή: 1 όταν δεν-debug)</translation> </message> <message> <location line="-42"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Ορισμός λήξης χρονικού ορίου σε χιλιοστά του δευτερολέπτου(προεπιλογή:5000)</translation> </message> <message> <location line="+109"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation type="unfinished"/> </message> <message> <location line="-80"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Χρησιμοποίηση του UPnP για την χρήση της πόρτας αναμονής (προεπιλογή:0)</translation> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Χρησιμοποίηση του UPnP για την χρήση της πόρτας αναμονής (προεπιλογή:1)</translation> </message> <message> <location line="-25"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation type="unfinished"/> </message> <message> <location line="+42"/> <source>Username for JSON-RPC connections</source> <translation>Όνομα χρήστη για τις συνδέσεις JSON-RPC</translation> </message> <message> <location line="+47"/> <source>Verifying database integrity...</source> <translation type="unfinished"/> </message> <message> <location line="+57"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Warning: Disk space is low!</source> <translation type="unfinished"/> </message> <message> <location line="-2"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Προειδοποίηση: Αυτή η έκδοση είναι ξεπερασμένη, απαιτείται αναβάθμιση </translation> </message> <message> <location line="-48"/> <source>wallet.dat corrupt, salvage failed</source> <translation>Το αρχειο wallet.dat ειναι διεφθαρμένο, η διάσωση απέτυχε</translation> </message> <message> <location line="-54"/> <source>Password for JSON-RPC connections</source> <translation>Κωδικός για τις συνδέσεις JSON-RPC</translation> </message> <message> <location line="-84"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=BigBangrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;BigBang Alert&quot; admin@foo.com </source> <translation type="unfinished"/> </message> <message> <location line="+51"/> <source>Find peers using internet relay chat (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+15"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation type="unfinished"/> </message> <message> <location line="+16"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Αποδοχή συνδέσεων JSON-RPC από συγκεκριμένη διεύθυνση IP</translation> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Αποστολή εντολών στον κόμβο &lt;ip&gt; (προεπιλογή: 127.0.0.1)</translation> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Εκτέλεσε την εντολή όταν το καλύτερο μπλοκ αλλάξει(%s στην εντολή αντικαθίσταται από το hash του μπλοκ)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Εκτέλεσε την εντολή όταν το καλύτερο μπλοκ αλλάξει(%s στην εντολή αντικαθίσταται από το hash του μπλοκ)</translation> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation>Αναβάθμισε το πορτοφόλι στην τελευταία έκδοση</translation> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Όριο πλήθους κλειδιών pool &lt;n&gt; (προεπιλογή: 100)</translation> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Επανέλεγχος της αλυσίδας μπλοκ για απούσες συναλλαγές</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 2500, 0 = all)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Χρήση του OpenSSL (https) για συνδέσεις JSON-RPC</translation> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation>Αρχείο πιστοποιητικού του διακομιστή (προεπιλογή: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Προσωπικό κλειδί του διακομιστή (προεπιλογή: server.pem)</translation> </message> <message> <location line="+1"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation type="unfinished"/> </message> <message> <location line="+53"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation type="unfinished"/> </message> <message> <location line="+18"/> <source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source> <translation type="unfinished"/> </message> <message> <location line="-158"/> <source>This help message</source> <translation>Αυτό το κείμενο βοήθειας</translation> </message> <message> <location line="+95"/> <source>Wallet %s resides outside data directory %s.</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot obtain a lock on data directory %s. BigBang is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-98"/> <source>BigBang</source> <translation type="unfinished"/> </message> <message> <location line="+140"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Αδύνατη η σύνδεση με τη θύρα %s αυτού του υπολογιστή (bind returned error %d, %s) </translation> </message> <message> <location line="-130"/> <source>Connect through socks proxy</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Να επιτρέπονται οι έλεγχοι DNS για προσθήκη και σύνδεση κόμβων</translation> </message> <message> <location line="+122"/> <source>Loading addresses...</source> <translation>Φόρτωση διευθύνσεων...</translation> </message> <message> <location line="-15"/> <source>Error loading blkindex.dat</source> <translation type="unfinished"/> </message> <message> <location line="+2"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Σφάλμα φόρτωσης wallet.dat: Κατεστραμμένο Πορτοφόλι</translation> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of BigBang</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart BigBang to complete</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation>Σφάλμα φόρτωσης αρχείου wallet.dat</translation> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Δεν είναι έγκυρη η διεύθυνση διαμεσολαβητή: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Άγνωστo δίκτυο ορίζεται σε onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Άγνωστo δίκτυο ορίζεται: %i</translation> </message> <message> <location line="+4"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση: &apos;%s&apos;</translation> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση: &apos;%s&apos;</translation> </message> <message> <location line="-24"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Μη έγκυρο ποσό για την παράμετρο -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Error: could not start node</source> <translation type="unfinished"/> </message> <message> <location line="+11"/> <source>Sending...</source> <translation type="unfinished"/> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation>Λάθος ποσότητα</translation> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation>Ανεπαρκές κεφάλαιο</translation> </message> <message> <location line="-34"/> <source>Loading block index...</source> <translation>Φόρτωση ευρετηρίου μπλοκ...</translation> </message> <message> <location line="-103"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Προσέθεσε ένα κόμβο για σύνδεση και προσπάθησε να κρατήσεις την σύνδεση ανοιχτή</translation> </message> <message> <location line="+122"/> <source>Unable to bind to %s on this computer. BigBang is probably already running.</source> <translation type="unfinished"/> </message> <message> <location line="-97"/> <source>Fee per KB to add to transactions you send</source> <translation type="unfinished"/> </message> <message> <location line="+55"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation type="unfinished"/> </message> <message> <location line="+25"/> <source>Loading wallet...</source> <translation>Φόρτωση πορτοφολιού...</translation> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation>Δεν μπορώ να υποβαθμίσω το πορτοφόλι</translation> </message> <message> <location line="+1"/> <source>Cannot initialize keypool</source> <translation type="unfinished"/> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation>Δεν μπορώ να γράψω την προεπιλεγμένη διεύθυνση</translation> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation>Ανίχνευση...</translation> </message> <message> <location line="+5"/> <source>Done loading</source> <translation>Η φόρτωση ολοκληρώθηκε</translation> </message> <message> <location line="-167"/> <source>To use the %s option</source> <translation>Χρήση της %s επιλογής</translation> </message> <message> <location line="+14"/> <source>Error</source> <translation>Σφάλμα</translation> </message> <message> <location line="+6"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Πρέπει να βάλεις ένα κωδικό στο αρχείο παραμέτρων: %s Εάν το αρχείο δεν υπάρχει, δημιούργησε το με δικαιώματα μόνο για ανάγνωση από τον δημιουργό</translation> </message> </context> </TS>
<?php function <API key>($ranks){ } function <API key>($ranks){ }
#include <stdio.h> int main() { int current_char, previous_char; printf("Input text below, multiple spaces will be escaped:\n"); previous_char = -1; while((current_char = getchar()) != EOF) { if (!(current_char == ' ' && previous_char == ' ')) { putchar(current_char); } previous_char = current_char; } }
<ion-header> <ion-navbar> <ion-title></ion-title> <!-- <ion-buttons end (click)="presentPopover($event)"> <button ion-button icon-only> <ion-icon name="search"></ion-icon> </button> </ion-buttons> </ion-navbar> <div> <tab-slide (slideClick)="onSlideClick($event)" [slides]="pageSlides" [pageNumber]="5"></tab-slide> </div> </ion-header> <ion-content> <ion-refresher (ionRefresh)="doRefresh($event)"> <<API key> pullingIcon="arrow-dropdown" pullingText="" refreshingSpinner="circles" refreshingText="..."> </<API key>> </ion-refresher> <ion-list margin-top> <ion-item-sliding *ngFor="let meeting of list" (click)="doRead(meeting.Id)"> <ion-item> <!-- <h3>{{meeting.Title}}</h3> <span>{{meeting.Place}}</span> <p float-right>{{meeting.StartDate | date:"yyyyMMdd HHmm"}}</p> <h2> <span class="status-new-dot" *ngIf="meeting.Status=='1'">&nbsp;</span> <span>{{meeting.Title}}</span> <small class="text-ios-gray" float-right>{{meeting.StartDate | getdatediff: true}}</small> </h2> <span>:{{meeting.Place}}</span> </ion-item> </ion-item-sliding> </ion-list> <empty *ngIf="isEmpty"></empty> <ion-infinite-scroll (ionInfinite)="$event.waitFor(doInfinite())" [enabled]="moredata" threshold="100px"> <<API key> loadingSpinner="bubbles" loadingText="..."></<API key>> </ion-infinite-scroll> </ion-content>
<td> {{item.name}} </td> <td> {{item.age}} </td> <td> {{item.sex}} </td>
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class My_PHPMailer { public function My_PHPMailer() { require_once('class.phpmailer.php'); } } ?>
<?php return array( 'service_manager' => array( 'factories' => array( 'Twilio\Options\ModuleOptions' => 'Twilio\Options\Factory\<API key>', 'Twilio\Service\TwilioService' => 'Twilio\Service\Factory\<API key>' ) ) );
<?php $lang['date_year'] = 'Ano'; $lang['date_years'] = 'Anos'; $lang['date_month'] = 'Mês'; $lang['date_months'] = 'Meses'; $lang['date_week'] = 'Semana'; $lang['date_weeks'] = 'Semanas'; $lang['date_day'] = 'Dia'; $lang['date_days'] = 'Dias'; $lang['date_hour'] = 'Hora'; $lang['date_hours'] = 'Horas'; $lang['date_minute'] = 'Minuto'; $lang['date_minutes'] = 'Minutos'; $lang['date_second'] = 'Segundo'; $lang['date_seconds'] = 'Segundos'; $lang['UM12'] = '(UTC -12:00) Baker/Howland Island'; $lang['UM11'] = '(UTC -11:00) Samoa Time Zone, Niue'; $lang['UM10'] = '(UTC -10:00) Hawaii-Aleutian Standard Time, Cook Islands, Tahiti'; $lang['UM95'] = '(UTC -9:30) Marquesas Islands'; $lang['UM9'] = '(UTC -9:00) Alaska Standard Time, Gambier Islands'; $lang['UM8'] = '(UTC -8:00) Pacific Standard Time, Clipperton Island'; $lang['UM7'] = '(UTC -7:00) Mountain Standard Time'; $lang['UM6'] = '(UTC -6:00) Central Standard Time'; $lang['UM5'] = '(UTC -5:00) Eastern Standard Time, Western Caribbean Standard Time'; $lang['UM45'] = '(UTC -4:30) Venezuelan Standard Time'; $lang['UM4'] = '(UTC -4:00) Atlantic Standard Time, Eastern Caribbean Standard Time'; $lang['UM35'] = '(UTC -3:30) Newfoundland Standard Time'; $lang['UM3'] = '(UTC -3:00) Argentina, Brazil, French Guiana, Uruguay'; $lang['UM2'] = '(UTC -2:00) South Georgia/South Sandwich Islands'; $lang['UM1'] = '(UTC -1:00) Azores, Cape Verde Islands'; $lang['UTC'] = '(UTC) Greenwich Mean Time, Western European Time'; $lang['UP1'] = '(UTC +1:00) Central European Time, West Africa Time'; $lang['UP2'] = '(UTC +2:00) Central Africa Time, Eastern European Time, Kaliningrad Time'; $lang['UP3'] = '(UTC +3:00) Moscow Time, East Africa Time'; $lang['UP35'] = '(UTC +3:30) Iran Standard Time'; $lang['UP4'] = '(UTC +4:00) Azerbaijan Standard Time, Samara Time'; $lang['UP45'] = '(UTC +4:30) Afghanistan'; $lang['UP5'] = '(UTC +5:00) Pakistan Standard Time, Yekaterinburg Time'; $lang['UP55'] = '(UTC +5:30) Indian Standard Time, Sri Lanka Time'; $lang['UP575'] = '(UTC +5:45) Nepal Time'; $lang['UP6'] = '(UTC +6:00) Bangladesh Standard Time, Bhutan Time, Omsk Time'; $lang['UP65'] = '(UTC +6:30) Cocos Islands, Myanmar'; $lang['UP7'] = '(UTC +7:00) Krasnoyarsk Time, Cambodia, Laos, Thailand, Vietnam'; $lang['UP8'] = '(UTC +8:00) Australian Western Standard Time, Beijing Time, Irkutsk Time'; $lang['UP875'] = '(UTC +8:45) Australian Central Western Standard Time'; $lang['UP9'] = '(UTC +9:00) Japan Standard Time, Korea Standard Time, Yakutsk Time'; $lang['UP95'] = '(UTC +9:30) Australian Central Standard Time'; $lang['UP10'] = '(UTC +10:00) Australian Eastern Standard Time, Vladivostok Time'; $lang['UP105'] = '(UTC +10:30) Lord Howe Island'; $lang['UP11'] = '(UTC +11:00) Magadan Time, Solomon Islands, Vanuatu'; $lang['UP115'] = '(UTC +11:30) Norfolk Island'; $lang['UP12'] = '(UTC +12:00) Fiji, Gilbert Islands, Kamchatka Time, New Zealand Standard Time'; $lang['UP1275'] = '(UTC +12:45) Chatham Islands Standard Time'; $lang['UP13'] = '(UTC +13:00) Phoenix Islands Time, Tonga'; $lang['UP14'] = '(UTC +14:00) Line Islands';
<!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.3.1"/> <title>The Red Matrix: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectlogo"><img alt="Logo" src="rhash-64.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">The Red Matrix </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.3.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Related&#160;Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('classItem.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="<API key>"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="headertitle"> <div class="title">Item Member List</div> </div> </div><!--header <div class="contents"> <p>This is the complete list of members for <a class="el" href="classItem.html">Item</a>, including all inherited members.</p> <table class="directory"> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">$channel</a></td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">$children</a></td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">$<API key></a></td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">$conversation</a></td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">$data</a></td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">$owner_name</a></td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">$owner_photo</a></td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">$owner_url</a></td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">$parent</a></td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">$redirect_url</a></td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">$template</a></td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">$threaded</a></td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">$toplevel</a></td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">$visiting</a></td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">$wall_to_wall</a></td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">__construct</a>($data)</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">add_child</a>($item)</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">check_wall_to_wall</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">protected</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">count_descendants</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr><td class="entry"><a class="el" href="classBaseObject.html#<API key>">get_app</a>()</td><td class="entry"><a class="el" href="classBaseObject.html">BaseObject</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">get_child</a>($id)</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">get_children</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">get_comment_box</a>($indent)</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>"><API key></a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">get_conversation</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">get_data</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">get_data_value</a>($name)</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">get_id</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">get_owner_name</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">get_owner_photo</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">get_owner_url</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">get_parent</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">protected</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">get_redirect_url</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">get_template</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">get_template_data</a>($alike, $dlike, $thread_level=1)</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">is_threaded</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">is_toplevel</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">is_visiting</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">is_wall_to_wall</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">private</span></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">remove_child</a>($item)</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">remove_parent</a>()</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">protected</span></td></tr> <tr><td class="entry"><a class="el" href="classBaseObject.html#<API key>">set_app</a>($app)</td><td class="entry"><a class="el" href="classBaseObject.html">BaseObject</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classItem.html#<API key>">set_conversation</a>($conv)</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classItem.html#<API key>">set_parent</a>($item)</td><td class="entry"><a class="el" href="classItem.html">Item</a></td><td class="entry"><span class="mlabel">protected</span></td></tr> </table></div><!-- contents --> </div><!-- doc-content -->
/* eslint-disable node/no-deprecated-api */ module.exports.pathBasename = pathBasename module.exports.hasSuffix = hasSuffix module.exports.serialize = serialize module.exports.translate = translate module.exports.stringToStream = stringToStream module.exports.debrack = debrack module.exports.stripLineEndings = stripLineEndings module.exports.fullUrlForReq = fullUrlForReq module.exports.routeResolvedFile = routeResolvedFile module.exports.getQuota = getQuota module.exports.overQuota = overQuota module.exports.getContentType = getContentType module.exports.parse = parse const fs = require('fs') const path = require('path') const util = require('util') const $rdf = require('rdflib') const from = require('from2') const url = require('url') const debug = require('./debug').fs const getSize = require('get-folder-size') const ns = require('solid-namespace')($rdf) function fullUrlForReq (req) { const fullUrl = url.format({ protocol: req.protocol, host: req.get('host'), pathname: url.resolve(req.baseUrl, req.path), query: req.query }) return fullUrl } /** * Removes the `<` and `>` brackets around a string and returns it. * Used by the `allow` handler in `verifyDelegator()` logic. * @method debrack * * @param s {string} * * @return {string} */ function debrack (s) { if (!s || s.length < 2) { return s } if (s[0] !== '<') { return s } if (s[s.length - 1] !== '>') { return s } return s.substring(1, s.length - 1) } async function parse (data, baseUri, contentType) { const graph = $rdf.graph() return new Promise((resolve, reject) => { try { return $rdf.parse(data, graph, baseUri, contentType, (err, str) => { if (err) { return reject(err) } resolve(str) }) } catch (err) { return reject(err) } }) } function pathBasename (fullpath) { let bname = '' if (fullpath) { bname = (fullpath.lastIndexOf('/') === fullpath.length - 1) ? '' : path.basename(fullpath) } return bname } function hasSuffix (path, suffixes) { for (const i in suffixes) { if (path.indexOf(suffixes[i], path.length - suffixes[i].length) !== -1) { return true } } return false } function serialize (graph, baseUri, contentType) { return new Promise((resolve, reject) => { try { // target, kb, base, contentType, callback $rdf.serialize(null, graph, baseUri, contentType, function (err, result) { if (err) { return reject(err) } if (result === undefined) { return reject(new Error('Error serializing the graph to ' + contentType)) } resolve(result) }) } catch (err) { reject(err) } }) } function translate (stream, baseUri, from, to) { return new Promise((resolve, reject) => { let data = '' stream .on('data', function (chunk) { data += chunk }) .on('end', function () { const graph = $rdf.graph() $rdf.parse(data, graph, baseUri, from, function (err) { if (err) return reject(err) resolve(serialize(graph, baseUri, to)) }) }) }) } function stringToStream (string) { return from(function (size, next) { // if there's no more content // left in the string, close the stream. if (!string || string.length <= 0) { return next(null, null) } // Pull in a new chunk of text, // removing it from the string. const chunk = string.slice(0, size) string = string.slice(size) // Emit "chunk" from the stream. next(null, chunk) }) } /** * Removes line endings from a given string. Used for WebID TLS Certificate * generation. * * @param obj {string} * * @return {string} */ function stripLineEndings (obj) { if (!obj) { return obj } return obj.replace(/(\r\n|\n|\r)/gm, '') } /** * Adds a route that serves a static file from another Node module */ function routeResolvedFile (router, path, file, appendFileName = true) { const fullPath = appendFileName ? path + file.match(/[^/]+$/) : path const fullFile = require.resolve(file) router.get(fullPath, (req, res) => res.sendFile(fullFile)) } /** * Returns the number of bytes that the user owning the requested POD * may store or Infinity if no limit */ async function getQuota (root, serverUri) { const filename = path.join(root, 'settings/serverSide.ttl') let prefs try { prefs = await _asyncReadfile(filename) } catch (error) { debug('Setting no quota. While reading serverSide.ttl, got ' + error) return Infinity } const graph = $rdf.graph() const storageUri = serverUri + '/' try { $rdf.parse(prefs, graph, storageUri, 'text/turtle') } catch (error) { throw new Error('Failed to parse serverSide.ttl, got ' + error) } return Number(graph.anyValue($rdf.sym(storageUri), ns.solid('storageQuota'))) || Infinity } /** * Returns true of the user has already exceeded their quota, i.e. it * will check if new requests should be rejected, which means they * could PUT a large file and get away with it. */ async function overQuota (root, serverUri) { const quota = await getQuota(root, serverUri) if (quota === Infinity) { return false } // TODO: cache this value? const size = await actualSize(root) return (size > quota) } /** * Returns the number of bytes that is occupied by the actual files in * the file system. IMPORTANT NOTE: Since it traverses the directory * to find the actual file sizes, this does a costly operation, but * neglible for the small quotas we currently allow. If the quotas * grow bigger, this will significantly reduce write performance, and * so it needs to be rewritten. */ function actualSize (root) { return util.promisify(getSize)(root) } function _asyncReadfile (filename) { return util.promisify(fs.readFile)(filename, 'utf-8') } /** * Get the content type from a headers object * @param headers An Express or Fetch API headers object * @return {string} A content type string */ function getContentType (headers) { const value = headers.get ? headers.get('content-type') : headers['content-type'] return value ? value.replace(/;.*/, '') : 'application/octet-stream' }
Template.postSubmit.onCreated(function() { Session.set('postSubmitErrors', {}); }); Template.postSubmit.helpers({ errorMessage: function(field) { return Session.get('postSubmitErrors')[field]; }, errorClass: function (field) { return !!Session.get('postSubmitErrors')[field] ? 'has-error' : ''; } }); Template.postSubmit.onRendered(function(){ // AutoForm.hooks({ // postSubmitForm: hooksObject }); // Template.postSubmit.events({ // 'submit form': function(e) { // e.preventDefault(); // var post = { // url: $(e.target).find('[name=url]').val(), // title: $(e.target).find('[name=title]').val() // var errors = validatePost(post); // if (errors.title || errors.url) // return Session.set('postSubmitErrors', errors); // Meteor.call('postInsert', post, function(error, result) { // // display the error to the user and abort // if (error) // return throwError(error.reason); // // show this result but route anyway // if (result.postExists) // throwError('This link has already been posted'); // Router.go('postPage', {_id: result._id});
<?php // Text $_['text_sizechart'] = 'Größentabelle';
package ru.mephi.interpreter; import org.antlr.v4.runtime.tree.ParseTree; import java.math.BigInteger; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @author Anton_Chkadua */ public class Scope { static Scope GLOBAL = new Scope(null); private Scope parent; private Map<BigInteger, Variable> variables = new HashMap<>(); private Map<Function, ParseTree> functions = new HashMap<>(); private BigInteger memoryCounter = BigInteger.ZERO; Scope(Scope parent) { this.parent = parent; if (parent != null) { memoryCounter = parent.getMemoryCounter(); } } private BigInteger getMemoryCounter() { return memoryCounter; } void add(Variable variable) throws <API key> { if (variables.values().contains(variable)) { throw new <API key>(<API key>.Type.<API key>); } if (variable instanceof Array) { ((Array) variable).setScope(this); for (int i = 0; i < ((Array) variable).memoryLength; i++) { variables.put(memoryCounter, variable); memoryCounter = memoryCounter.add(BigInteger.ONE); } } else { variables.put(memoryCounter, variable); memoryCounter = memoryCounter.add(BigInteger.ONE); } } public void remove(String name) throws <API key> { Variable toBeRemoved = get(name); BigInteger address = variables.keySet().stream().filter(key -> variables.get(key).equals(toBeRemoved)).findFirst().orElseThrow(() -> new <API key>( <API key>.Type.NO_SUCH_VARIABLE)); variables.remove(address); } Scope getParent() { return parent; } Variable get(String name) throws <API key> { Variable candidate = variables.values().stream().filter(variable -> variable.getName().equals(name)).findAny() .orElse(null); if (candidate == null) { if (parent != null) { candidate = parent.get(name); } else { throw new <API key>(<API key>.Type.NO_SUCH_VARIABLE); } } return candidate; } Variable getByAddress(Pointer pointer) throws <API key> { Variable variable = variables.get(pointer.getValue()); System.out.println(variable); if (variable instanceof Array) { int address = getVariableAddress(variable).intValue(); int index = pointer.getValue().intValue() - address; return variable.getElement(index); } else { return variable; } } void setValueByAddress(Pointer pointer, BigInteger value) throws <API key> { if (pointer.constantValue) throw new <API key>(<API key>.Type.<API key>); variables.get(pointer.getValue()).setValue(value); } BigInteger getVariableAddress(Variable variable) throws <API key> { if (!variables.values().contains(variable)) { throw new <API key>(<API key>.Type.NO_SUCH_VARIABLE); } for (Map.Entry<BigInteger, Variable> entry : variables.entrySet()) { if (entry.getValue().name.equals(variable.name)) return entry.getKey(); } return null; } void addFunction(Function function, ParseTree functionTree) throws <API key> { if (functions.containsKey(function)) { throw new <API key>(<API key>.Type.<API key>); } functions.put(function, functionTree); } ParseTree getFunctionTree(String name, List<Class> types) throws <API key> { ParseTree tree = functions.get(getFunction(name, types)); if (tree == null) { if (parent != null) { tree = parent.getFunctionTree(name, types); } else { throw new <API key>(<API key>.Type.NO_SUCH_FUNCTION); } } return tree; } Function getFunction(String name, List<Class> types) throws <API key> { Map.Entry<Function, ParseTree> entryCandidate = functions.entrySet().stream().filter(entry -> entry.getKey().name.equals(name)).findAny() .orElse(null); Function candidate = null; if (entryCandidate == null) { if (parent != null) { candidate = parent.getFunction(name, types); } } else { candidate = entryCandidate.getKey(); } if (candidate == null) { if (name.equals("main")) { throw new <API key>(<API key>.Type.NO_MAIN_FUNCTION); } else { throw new <API key>(<API key>.Type.NO_SUCH_FUNCTION); } } if (candidate.args.size() != types.size()) { throw new <API key>(<API key>.Type.NO_SUCH_FUNCTION); } for (int i = 0; i < candidate.args.size(); i++) { if (!candidate.args.get(i).getType().equals(types.get(i))) { throw new <API key>(<API key>.Type.NO_SUCH_FUNCTION); } } return candidate; } @Override public String toString() { String parent = this.parent != null ? this.parent.toString() : ""; StringBuilder builder = new StringBuilder(); for (Variable variable : variables.values()) { builder.append(variable.getName()).append("-").append(variable.getType()).append("-length-") .append(variable.getLength()); try { builder.append("-value-").append(variable.getValue()).append('-').append(variable.constantValue) .append("\r\n"); } catch (<API key> e) { System.out.println(e.getType()); } } return builder.insert(0, parent).toString(); } }
# ServiceInfo.TryExcludeTag method Attempts to exclude a tag from service. csharp public bool TryExcludeTag(string tagName, out ServiceInfo service, out IReadOnlyList<<API key>> errors) ## See Also * class [<API key>](../<API key>.md) * class [ServiceInfo](../ServiceInfo.md) * namespace [Facility.Definition](../../Facility.Definition.md) <!-- DO NOT EDIT: generated by xmldocmd for Facility.Definition.dll -->
<?php return array ( 'id' => 'sec_e900_ver1_sub10', 'fallback' => 'sec_e900_ver1', 'capabilities' => array ( '<API key>' => 'false', 'j2me_max_jar_size' => '700000', '<API key>' => 'true', 'ajax_support_events' => 'true', ), );
<?php return array ( 'id' => '<API key>', 'fallback' => 'dell_streak_7_ver1', 'capabilities' => array ( 'device_os_version' => '3.2', ), );
#include <cstring> #include <iostream> #include <algorithm> #include "matcher.h" #include "edit.h" #include "char.h" #include "instrumentation.h" #define INIT_POS -1 #define __DEBUG__ false // the node represented by a given point #define node(p) (distances[(p)->j][(p)->i]) // the edit distance at a given point, from the distance matrix #define dist(p) (node(p).distance) using namespace std; // simply reverses a string in place void strrev(char *str, int len) { for(int i = 0; i < len / 2; i++) { std::swap(str[i], str[len - i - 1]); } } // empty constructor EditTable::EditTable() { } // destructor EditTable::~EditTable() { // free the rows of the table free_rows(); // free the table itself delete[] distances; // get rid of the best match if(best_match != NULL) { delete best_match; } } // compares the 3 given points based on their given distances, and // returns the point with the lowest distance Point *min3(Point *p1, int d1, Point *p2, int d2, Point *p3, int d3) { if(d1 < d2) { return d1 < d3 ? p1 : p3; } else { return d2 < d3 ? p2 : p3; } } // get the point surrounding (j,i) with the minimum distance Point *EditTable::min_neighbour(int j, int i) { // the only valid surrounding for the top-corner is (0,0) if(j == 1 && i == 1) { return new Point(0, 0); // if we're in the top row, we can't go up any higher } else if(j == 1) { return new Point(j, i - 1); // if we're in the leftmost column, we CAN go more left // (since it just means we're starting the match from there) } else if(i == 1) { return new Point(j, 0); // otherwise, } else { // 3 comparisons here inc_comparisons(3); return min3( // just above it new Point(j - 1, i), distances[j - 1][i].distance, // just to its left new Point(j, i - 1), distances[j][i - 1].distance, // top-left corner new Point(j - 1, i - 1), distances[j - 1][i - 1].distance + // add 1 if we need a replacement (text[j - 1] == query->query_str[i - 1] ? 0 : 1) ); } } // j is the index into the text, // i is the index into the query // assuming j != 0 and i != 0 int EditTable::set_distance(int j, int i) { Node &node = distances[j][i]; // get the valid neighbour with the minimum edit distance node.from = min_neighbour(j, i); node.distance = dist(node.from); // if the two characters at this node are different, if( query->query_str[i - 1] != text[j - 1] ) { // add 1 to the edit distance (replacement) node.distance++; } // return the edit distance of this node return node.distance; } // dump the whole table void EditTable::dump() { // print the query characters cerr << '\t'; for(int i = 0; i < query->query_len; i++) { cerr << '\t'; pc(cerr, query->query_str[i]); } cerr << endl; for(int j = 0; j <= text_len; j++) { for(int i = 0; i <= query->query_len; i++) { // print the text characters if(i == 0 && j != 0) { pc(cerr, text[j - 1]); } cerr << '\t'; // print the actual distance cerr << distances[j][i].distance; } cerr << endl; } } // traceback the best match SearchResult *EditTable::get_match() { SearchResult *result; // if there is no match, return an empty search result if(best_match->j == INIT_POS) { return new SearchResult(0); } // if the match has too high a distance, return an empty search result if(dist(best_match) > query->errors_allowed) { return new SearchResult(0); } // allocate memory for the result result = new SearchResult(query->query_len + query->errors_allowed); // the easy stuff first result->errors = dist(best_match); result->match_len = 0; // start off at the node with the best match Point *current = best_match; while(current != NULL) { // add the next char to the result result->match[result->match_len++] = text[current->j - 1]; // advance to the next node current = node(current).from; } // we don't really want to include the \0 char result->match_len // reverse the string in place strrev(result->match, result->match_len); /*// print the result if(__DEBUG__) { pc(cerr, result->match, result->match_len); cerr << endl; }*/ return result; } void EditTable::free_rows() { // free the rows of the table for(int j = 0; j <= text_len; j++) { if(query != NULL) { delete[] distances[j]; } } } void EditTable::fill_table() { // there are going to be the same amount of creates/accesses here inc_comparisons((text_len + 1) * (query->query_len + 1)); inc_ds((text_len + 1) * (query->query_len + 1)); // reset the best match best_match = new Point(INIT_POS, INIT_POS); // the first row and column have a distance 0 for(int j = 0; j <= text_len; j++) { // allocate memory for each row distances[j] = new Node[text_len + 1]; // set the first column to 0 distances[j][0].distance = 0; } for(int i = 0; i <= query->query_len; i++) { // set the first row to 0 distances[0][i].distance = 0; } // first go through the text (rows) for(int j = 1; j <= text_len; j++) { // then go through the query (columns) for(int i = 1; i <= query->query_len; i++) { // work out the edit distance set_distance(j, i); // if we're in the last column (the end of the query string), // [remember matches only happen at the end of the query string] if(i == query->query_len) { // if this is the first time we get to the end of the query, // or if it's got a lower edit distance than the current // best match, if( best_match->j == INIT_POS || distances[j][i].distance < dist(best_match) ) { // then update the best match to be this point best_match->j = j; best_match->i = i; } } } } } SearchResult *EditTable::execute_query(SearchQuery *query) { SearchResult *result; // save the query this->query = query; // fill the table this->fill_table(); // dump it if(__DEBUG__) { this->dump(); } // get the best match result = get_match(); // finally, return the match return result; } void EditTable::load_text(char *text, int len) { // save these values this->text = new char[len]; strncpy(this->text, text, len); this->text_len = len; // build an empty array this->distances = new Node *[text_len + 1]; } // used by main which doesn't know about the EditTable Matcher *create_matcher() { return new EditTable(); }
.ui.message { position: relative; min-height: 1em; margin: 1em 0em; background: #F8F8F9; padding: 1em 1.5em; line-height: 1.4285em; color: rgba(0, 0, 0, 0.87); -webkit-transition: opacity 0.1s ease, color 0.1s ease, background 0.1s ease, box-shadow 0.1s ease; transition: opacity 0.1s ease, color 0.1s ease, background 0.1s ease, box-shadow 0.1s ease; border-radius: 0.30769em; box-shadow: 0px 0px 0px 1px rgba(34, 36, 38, 0.22) inset, 0px 0px 0px 0px rgba(0, 0, 0, 0); } .ui.message:first-child { margin-top: 0em; } .ui.message:last-child { margin-bottom: 0em; } /* Header */ .ui.message .header { display: block; font-family: 'Arial', 'Helvetica Neue', Arial, Helvetica, sans-serif; font-weight: bold; margin: -0.14285em 0em 0rem 0em; } /* Default font size */ .ui.message .header:not(.ui) { font-size: 1.15384615em; } /* Paragraph */ .ui.message p { opacity: 0.85; margin: 0.75em 0em; } .ui.message p:first-child { margin-top: 0em; } .ui.message p:last-child { margin-bottom: 0em; } .ui.message .header + p { margin-top: 0.25em; } /* List */ .ui.message .list:not(.ui) { text-align: left; padding: 0em; opacity: 0.85; list-style-position: inside; margin: 0.5em 0em 0em; } .ui.message .list:not(.ui):first-child { margin-top: 0em; } .ui.message .list:not(.ui):last-child { margin-bottom: 0em; } .ui.message .list:not(.ui) li { position: relative; list-style-type: none; margin: 0em 0em 0.3em 1em; padding: 0em; } .ui.message .list:not(.ui) li:before { position: absolute; content: '•'; left: -1em; height: 100%; vertical-align: baseline; } .ui.message .list:not(.ui) li:last-child { margin-bottom: 0em; } /* Icon */ .ui.message > .icon { margin-right: 0.6em; } /* Close Icon */ .ui.message > .close.icon { cursor: pointer; position: absolute; margin: 0em; top: 0.78575em; right: 0.5em; opacity: 0.7; -webkit-transition: opacity 0.1s ease; transition: opacity 0.1s ease; } .ui.message > .close.icon:hover { opacity: 1; } /* First / Last Element */ .ui.message > :first-child { margin-top: 0em; } .ui.message > :last-child { margin-bottom: 0em; } .ui.dropdown .menu > .message { margin: 0px -1px; } .ui.visible.visible.visible.visible.message { display: block; } .ui.icon.visible.visible.visible.visible.message { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; } .ui.hidden.hidden.hidden.hidden.message { display: none; } .ui.compact.message { display: inline-block; } .ui.attached.message { margin-bottom: -1px; border-radius: 0.30769em 0.30769em 0em 0em; box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.13) inset; margin-left: -1px; margin-right: -1px; } .ui.attached + .ui.attached.message:not(.top):not(.bottom) { margin-top: -1px; border-radius: 0em; } .ui.bottom.attached.message { margin-top: -1px; border-radius: 0em 0em 0.30769em 0.30769em; box-shadow: 0em 0em 0em 1px rgba(0, 0, 0, 0.13) inset, 0px 1px 2px 0 rgba(0, 0, 0, 0.13); } .ui.bottom.attached.message:not(:last-child) { margin-bottom: 1em; } .ui.attached.icon.message { width: auto; } .ui.icon.message { display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; width: 100%; -webkit-box-align: center; -webkit-align-items: center; -ms-flex-align: center; align-items: center; } .ui.icon.message > .icon:not(.close) { display: block; -webkit-box-flex: 0; -webkit-flex: 0 0 auto; -ms-flex: 0 0 auto; flex: 0 0 auto; width: auto; line-height: 1; vertical-align: middle; font-size: 3em; opacity: 0.8; } .ui.icon.message > .content { display: block; -webkit-box-flex: 1; -webkit-flex: 1 1 auto; -ms-flex: 1 1 auto; flex: 1 1 auto; vertical-align: middle; } .ui.icon.message .icon:not(.close) + .content { padding-left: 0rem; } .ui.icon.message .circular.icon { width: 1em; } .ui.floating.message { box-shadow: 0px 0px 0px 1px rgba(34, 36, 38, 0.22) inset, 0px 2px 4px 0px rgba(34, 36, 38, 0.12), 0px 2px 10px 0px rgba(34, 36, 38, 0.08); } .ui.black.message { background-color: #444C55; color: rgba(255, 255, 255, 0.9); } /* Positive */ .ui.positive.message { background-color: #FCFFF5; color: #2C662D; } .ui.positive.message, .ui.attached.positive.message { box-shadow: 0px 0px 0px 1px #A3C293 inset, 0px 0px 0px 0px rgba(0, 0, 0, 0); } .ui.positive.message .header { color: #1A531B; } /* Negative */ .ui.negative.message { background-color: #FFF6F6; color: #9F3A38; } .ui.negative.message, .ui.attached.negative.message { box-shadow: 0px 0px 0px 1px #E0B4B4 inset, 0px 0px 0px 0px rgba(0, 0, 0, 0); } .ui.negative.message .header { color: #912D2B; } /* Info */ .ui.info.message { background-color: #E6F1F6; color: #4E575B; } .ui.info.message, .ui.attached.info.message { box-shadow: 0px 0px 0px 1px #A9D5DE inset, 0px 0px 0px 0px rgba(0, 0, 0, 0); } .ui.info.message .header { color: #0E566C; } /* Warning */ .ui.warning.message { background-color: #FFFAF3; color: #573A08; } .ui.warning.message, .ui.attached.warning.message { box-shadow: 0px 0px 0px 1px #C9BA9B inset, 0px 0px 0px 0px rgba(0, 0, 0, 0); } .ui.warning.message .header { color: #794B02; } /* Error */ .ui.error.message { background-color: #FFF6F6; color: #9F3A38; } .ui.error.message, .ui.attached.error.message { box-shadow: 0px 0px 0px 1px #E0B4B4 inset, 0px 0px 0px 0px rgba(0, 0, 0, 0); } .ui.error.message .header { color: #912D2B; } /* Success */ .ui.success.message { background-color: #FCFFF5; color: #2C662D; } .ui.success.message, .ui.attached.success.message { box-shadow: 0px 0px 0px 1px #A3C293 inset, 0px 0px 0px 0px rgba(0, 0, 0, 0); } .ui.success.message .header { color: #1A531B; } /* Colors */ .ui.inverted.message, .ui.black.message { background-color: #444C55; color: rgba(255, 255, 255, 0.9); } .ui.red.message { background-color: #FFE8E6; color: #E03131; } .ui.red.message .header { color: #d72020; } .ui.orange.message { background-color: #FFEDDE; color: #D26911; } .ui.orange.message .header { color: #ba5d0f; } .ui.yellow.message { background-color: #FFF8DB; color: #B58105; } .ui.yellow.message .header { color: #9c6f04; } .ui.olive.message { background-color: #FBFDEF; color: #8ABC1E; } .ui.olive.message .header { color: #7aa61a; } .ui.green.message { background-color: #E5F9E7; color: #1EBC30; } .ui.green.message .header { color: #1aa62a; } .ui.teal.message { background-color: #E1F7F7; color: #10A3A3; } .ui.teal.message .header { color: #0e8c8c; } .ui.blue.message { background-color: #DFF0FF; color: #80A6CD; } .ui.blue.message .header { color: #6e99c6; } .ui.violet.message { background-color: #EAE7FF; color: #6435C9; } .ui.violet.message .header { color: #5a30b5; } .ui.purple.message { background-color: #F6E7FF; color: #A333C8; } .ui.purple.message .header { color: #922eb4; } .ui.pink.message { background-color: #FFE3FB; color: #E03997; } .ui.pink.message .header { color: #dd238b; } .ui.brown.message { background-color: #F1E2D3; color: #A5673F; } .ui.brown.message .header { color: #935b38; } .ui.small.message { font-size: 0.92307692em; } .ui.message { font-size: 1em; } .ui.large.message { font-size: 1.15384615em; } .ui.huge.message { font-size: 1.46153846em; } .ui.massive.message { font-size: 1.69230769em; }
<?php namespace Beloop\Bundle\InstagramBundle; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\KernelInterface; use Beloop\Bundle\CoreBundle\Abstracts\AbstractBundle; use Beloop\Bundle\InstagramBundle\CompilerPass\MappingCompilerPass; use Beloop\Bundle\InstagramBundle\DependencyInjection\<API key>; /** * <API key> Bundle. */ class <API key> extends AbstractBundle { /** * @param ContainerBuilder $container */ public function build(ContainerBuilder $container) { parent::build($container); $container->addCompilerPass(new MappingCompilerPass()); } /** * Returns the bundle's container extension. * * @return ExtensionInterface The container extension */ public function <API key>() { return new <API key>(); } /** * Create instance of current bundle, and return dependent bundle namespaces. * * @param KernelInterface $kernel * @return array Bundle instances */ public static function <API key>(KernelInterface $kernel) { return [ 'Beloop\Bundle\CoreBundle\BeloopCoreBundle', 'Beloop\Bundle\CoreBundle\BeloopUserBundle', ]; } }
6650 #include "types.h" 6651 #include "x86.h" 6652 6653 void* 6654 memset(void *dst, int c, uint n) 6655 { 6656 if ((int)dst%4 == 0 && n%4 == 0){ 6657 c &= 0xFF; 6658 stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); 6659 } else 6660 stosb(dst, c, n); 6661 return dst; 6662 } 6663 6664 int 6665 memcmp(const void *v1, const void *v2, uint n) 6666 { 6667 const uchar *s1, *s2; 6668 6669 s1 = v1; 6670 s2 = v2; 6671 while(n 6672 if(*s1 != *s2) 6673 return *s1 - *s2; 6674 s1++, s2++; 6675 } 6676 6677 return 0; 6678 } 6679 6680 void* 6681 memmove(void *dst, const void *src, uint n) 6682 { 6683 const char *s; 6684 char *d; 6685 6686 s = src; 6687 d = dst; 6688 if(s < d && s + n > d){ 6689 s += n; 6690 d += n; 6691 while(n 6692 *--d = *--s; 6693 } else 6694 while(n 6695 *d++ = *s++; 6696 6697 return dst; 6698 } 6699 6700 // memcpy exists to placate GCC. Use memmove. 6701 void* 6702 memcpy(void *dst, const void *src, uint n) 6703 { 6704 return memmove(dst, src, n); 6705 } 6706 6707 int 6708 strncmp(const char *p, const char *q, uint n) 6709 { 6710 while(n > 0 && *p && *p == *q) 6711 n--, p++, q++; 6712 if(n == 0) 6713 return 0; 6714 return (uchar)*p - (uchar)*q; 6715 } 6716 6717 char* 6718 strncpy(char *s, const char *t, int n) 6719 { 6720 char *os; 6721 6722 os = s; 6723 while(n-- > 0 && (*s++ = *t++) != 0) 6724 ; 6725 while(n 6726 *s++ = 0; 6727 return os; 6728 } 6729 6730 // Like strncpy but guaranteed to NUL-terminate. 6731 char* 6732 safestrcpy(char *s, const char *t, int n) 6733 { 6734 char *os; 6735 6736 os = s; 6737 if(n <= 0) 6738 return os; 6739 while(--n > 0 && (*s++ = *t++) != 0) 6740 ; 6741 *s = 0; 6742 return os; 6743 } 6744 6745 6746 6747 6748 6749 6750 int 6751 strlen(const char *s) 6752 { 6753 int n; 6754 6755 for(n = 0; s[n]; n++) 6756 ; 6757 return n; 6758 } 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799
import { IQuotation } from '../../model/QuotationService/IQuotation'; export interface IQuoteDisplayProps { quote: IQuotation; }
# Laravel 5.1 Generators Some generators for Laravel 5.1 ## Install Require the package: sh composer require bvw/laravel-generators dev-master Add the service provider to **config/app.php** in Providers section: sh BVW\Providers\<API key>::class, Run the generators: sh php artisan make:database Available Commands sh make:database -- creates a database based on your environment variables (.env file) Notes For the *make:database* command you should configure your .env and add DB_CONNECTION to override default *mysql* in **config/database.php** config file
-- Purpose: Payload class require( "engine.shared.typelenvalues" ) class "payload" ( "typelenvalues" ) payload._handlers = payload._handlers or {} -- Generate ids for packet structures do local payloads = "engine.shared.network.payloads" if ( package.loaded[ payloads ] ) then unrequire( payloads ) end require( payloads ) typelenvalues.generateIds( payload.structs ) end function payload.initializeFromData( data ) local payload = payload() payload.data = data payload:deserialize() return payload end function payload.setHandler( func, struct ) payload._handlers[ struct ] = func end function payload:payload( struct ) typelenvalues.typelenvalues( self, payload.structs, struct ) end function payload:dispatchToHandler() local name = self:getStructName() if ( name == nil ) then return end local handler = payload._handlers[ name ] if ( handler ) then handler( self ) end end accessor( payload, "peer" ) function payload:getPlayer() return player.getByPeer( self.peer ) end function payload:sendToServer() if ( _CLIENT ) then local network = engine.client.network network.sendToServer( self ) end end function payload:broadcast() if ( _SERVER ) then local network = engine.server.network network.broadcast( self ) end end
2019-03-10 diff between today and yesterday # python * [pirate/ArchiveBox](https://github.com/pirate/ArchiveBox): The open source self-hosted web archive. Takes browser history/bookmarks/Pocket/Pinboard/etc., saves HTML, JS, PDFs, media, and more... * [0xAX/linux-insides](https://github.com/0xAX/linux-insides): A little bit about a linux kernel * [ageitgey/face_recognition](https://github.com/ageitgey/face_recognition): The world's simplest facial recognition api for Python and the command line * [ArchiveTeam/grab-site](https://github.com/ArchiveTeam/grab-site): The archivist's web crawler: WARC output, dashboard for all crawls, dynamic ignore patterns * [josephmisiti/<API key>](https://github.com/josephmisiti/<API key>): A curated list of awesome Machine Learning frameworks, libraries and software. * [pallets/flask](https://github.com/pallets/flask): The Python micro framework for building web applications. * [smacke/subsync](https://github.com/smacke/subsync): Automagically synchronize subtitles with video. * [gotify/server](https://github.com/gotify/server): A simple server for sending and receiving messages in real-time per web socket. (Includes a sleek web-ui) * [gotify/cli](https://github.com/gotify/cli): A command line interface for pushing messages to gotify/server. * [ma6254/FictionDown](https://github.com/ma6254/FictionDown): ||||Markdown|txt|epub|| * [etcd-io/etcd](https://github.com/etcd-io/etcd): Distributed reliable key-value store for the most critical data of a distributed system * [restic/restic](https://github.com/restic/restic): Fast, secure, efficient backup program * [snail007/goproxy](https://github.com/snail007/goproxy): Proxy is a high performance HTTP(S), websocket, TCP, UDP,Secure DNS, Socks5 proxy server implemented by golang. Now, it supports chain-style proxies,nat forwarding in different lan,TCP/UDP port forwarding, SSH forwarding.Proxygolanghttp,https,websocket,tcp,DNS,socks5,,,,HTTP,SOCKS5,,,KCP,API * [google/gvisor](https://github.com/google/gvisor): Container Runtime Sandbox * [dgraph-io/dgraph](https://github.com/dgraph-io/dgraph): Fast, Distributed Graph DB # cpp * [olive-editor/olive](https://github.com/olive-editor/olive): Professional open-source NLE video editor * [DeanRoddey/CIDLib](https://github.com/DeanRoddey/CIDLib): The CIDLib general purpose C++ development environment * [musescore/MuseScore](https://github.com/musescore/MuseScore): MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests! * [REDasmOrg/REDasm](https://github.com/REDasmOrg/REDasm): The OpenSource Disassembler * [google/<API key>](https://github.com/google/<API key>): Desktop implementations of the Flutter embedding API * [DiligentGraphics/DiligentEngine](https://github.com/DiligentGraphics/DiligentEngine): A modern cross-platform low-level graphics library * [cmderdev/cmder](https://github.com/cmderdev/cmder): Lovely console emulator package for Windows # javascript * [bvaughn/react-window](https://github.com/bvaughn/react-window): React components for efficiently rendering large lists and tabular data * [NervJS/taro](https: * [facebook/react-native](https://github.com/facebook/react-native): A framework for building native apps with React. * [nodejs/node](https://github.com/nodejs/node): Node.js JavaScript runtime * [facebook/jest](https://github.com/facebook/jest): Delightful JavaScript Testing. * [twbs/bootstrap](https://github.com/twbs/bootstrap): The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web. * [frankmcsherry/blog](https://github.com/frankmcsherry/blog): Some notes on things I find interesting and important. # coffeescript * [unpoly/unpoly](https://github.com/unpoly/unpoly): Unobtrusive Javascript Framework for server-side applications * [boennemann/badges](https://github.com/boennemann/badges): Readme Badges Gotta catch 'em all * [atom/language-json](https://github.com/atom/language-json): JSON package for Atom
import { Component, DebugElement } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { By, DOCUMENT } from '@angular/platform-browser'; import { TocComponent } from './toc.component'; import { TocItem, TocService } from 'app/shared/toc.service'; describe('TocComponent', () => { let tocComponentDe: DebugElement; let tocComponent: TocComponent; let tocService: TestTocService; let page: { listItems: DebugElement[]; tocHeading: DebugElement; tocHeadingButton: DebugElement; tocMoreButton: DebugElement; }; function setPage(): typeof page { return { listItems: tocComponentDe.queryAll(By.css('ul.toc-list>li')), tocHeading: tocComponentDe.query(By.css('.toc-heading')), tocHeadingButton: tocComponentDe.query(By.css('.toc-heading button')), tocMoreButton: tocComponentDe.query(By.css('button.toc-more-items')), }; } beforeEach(async(() => { TestBed.<API key>({ declarations: [ <API key>, <API key>, TocComponent ], providers: [ { provide: TocService, useClass: TestTocService } ] }) .compileComponents(); })); describe('when embedded in doc body', () => { let fixture: ComponentFixture<<API key>>; beforeEach(() => { fixture = TestBed.createComponent(<API key>); tocComponentDe = fixture.debugElement.children[0]; tocComponent = tocComponentDe.componentInstance; tocService = TestBed.get(TocService); }); it('should create tocComponent', () => { expect(tocComponent).toBeTruthy(); }); it('should be in embedded state', () => { expect(tocComponent.isEmbedded).toEqual(true); }); it('should not display anything when no TocItems', () => { tocService.tocList = []; fixture.detectChanges(); expect(tocComponentDe.children.length).toEqual(0); }); describe('when four TocItems', () => { beforeEach(() => { tocService.tocList.length = 4; fixture.detectChanges(); page = setPage(); }); it('should have four displayed items', () => { expect(page.listItems.length).toEqual(4); }); it('should not have secondary items', () => { expect(tocComponent.hasSecondary).toEqual(false, 'hasSecondary flag'); const aSecond = page.listItems.find(item => item.classes.secondary); expect(aSecond).toBeFalsy('should not find a secondary'); }); it('should not display expando buttons', () => { expect(page.tocHeadingButton).toBeFalsy('top expand/collapse button'); expect(page.tocMoreButton).toBeFalsy('bottom more button'); }); }); describe('when many TocItems', () => { beforeEach(() => { fixture.detectChanges(); page = setPage(); }); it('should have more than 4 displayed items', () => { expect(page.listItems.length).toBeGreaterThan(4); expect(page.listItems.length).toEqual(tocService.tocList.length); }); it('should be in "closed" (not expanded) state at the start', () => { expect(tocComponent.isClosed).toBeTruthy(); }); it('should have "closed" class at the start', () => { expect(tocComponentDe.children[0].classes.closed).toEqual(true); }); it('should display expando buttons', () => { expect(page.tocHeadingButton).toBeTruthy('top expand/collapse button'); expect(page.tocMoreButton).toBeTruthy('bottom more button'); }); it('should have secondary items', () => { expect(tocComponent.hasSecondary).toEqual(true, 'hasSecondary flag'); }); // CSS should hide items with the secondary class when closed it('should have secondary item with a secondary class', () => { const aSecondary = page.listItems.find(item => item.classes.secondary); expect(aSecondary).toBeTruthy('should find a secondary'); expect(aSecondary.classes.secondary).toEqual(true, 'has secondary class'); }); describe('after click expando button', () => { beforeEach(() => { page.tocHeadingButton.nativeElement.click(); fixture.detectChanges(); }); it('should not be "closed"', () => { expect(tocComponent.isClosed).toEqual(false); }); it('should not have "closed" class', () => { expect(tocComponentDe.children[0].classes.closed).toBeFalsy(); }); }); }); }); describe('when in side panel (not embedded))', () => { let fixture: ComponentFixture<<API key>>; beforeEach(() => { fixture = TestBed.createComponent(<API key>); tocComponentDe = fixture.debugElement.children[0]; tocComponent = tocComponentDe.componentInstance; fixture.detectChanges(); page = setPage(); }); it('should not be in embedded state', () => { expect(tocComponent.isEmbedded).toEqual(false); }); it('should display all items', () => { expect(page.listItems.length).toEqual(tocService.tocList.length); }); it('should not have secondary items', () => { expect(tocComponent.hasSecondary).toEqual(false, 'hasSecondary flag'); const aSecond = page.listItems.find(item => item.classes.secondary); expect(aSecond).toBeFalsy('should not find a secondary'); }); it('should not display expando buttons', () => { expect(page.tocHeadingButton).toBeFalsy('top expand/collapse button'); expect(page.tocMoreButton).toBeFalsy('bottom more button'); }); }); }); / helpers @Component({ selector: 'aio-embedded-host', template: '<aio-toc class="embedded"></aio-toc>' }) class <API key> {} @Component({ selector: '<API key>', template: '<aio-toc></aio-toc>' }) class <API key> {} class TestTocService { tocList: TocItem[] = getTestTocList(); } // tslint:disable:quotemark function getTestTocList() { return [ { "content": "Heading one", "href": "fizz/buzz#<API key>", "level": "h2", "title": "Heading one" }, { "content": "H2 Two", "href": "fizz/buzz#h2-two", "level": "h2", "title": "H2 Two" }, { "content": "H2 <b>Three</b>", "href": "fizz/buzz#h2-three", "level": "h2", "title": "H2 Three" }, { "content": "H3 3a", "href": "fizz/buzz#h3-3a", "level": "h3", "title": "H3 3a" }, { "content": "H3 3b", "href": "fizz/buzz#h3-3b", "level": "h3", "title": "H3 3b" }, { "content": "<i>H2 <b>four</b></i>", "href": "fizz/buzz#h2-four", "level": "h2", "title": "H2 4" } ]; }
<style> body { padding: 0; margin: 0; } #viewer { background-color: #000; color: #fff; margin: 0px; padding: 0; overflow: hidden; } </style> <div id="viewer"></div>
var http=require("http");var om=require("./omlib"); var Omega={Request:function(req){var req;req={api:null};req._sock=req;req._answer=function(){return"foo!"};return req},Response:function(res){var resp;resp={_sock:res,data:null,result:false,encoding:"json",headers:{"Content-Type":"text/plain","Cache-Control":"no-cache"},return_code:"200"};resp.set_result=function(result){resp.result=result?true:false};resp.encode=function(){var answer={result:resp.result};if(resp.result)answer.data=resp.data;else{answer.reason=resp.data;answer.data=null}return om.json.encode(answer)}; return resp},Server:function(conf){var omega;omega={_session_id:null,_session:null,_conf:conf,config:null,request:null,response:null,service:null,service_name:""};omega.answer=function(req,res){var answer;omega.request=Omega.Request(req);omega.response=Omega.Response(res);try{omega.response.data=omega.request._answer();omega.response.result=true}catch(e){omega.response.data=e;omega.response.return_code="500"}res.writeHead(omega.response.return_code,omega.response.headers);res.end(omega.response.encode())}; omega._server=http.createServer(omega.answer);omega._server.listen(conf.port,conf.iface);if(omega._conf.verbose)console.log(om.sprintf("Server running at http://%s:%d/",conf.iface,conf.port));return omega}};exports.Server=Omega.Server;
module Souschef # Loads Souschef configuration YAML class Config # Public - Reads the configuration file # Returns Hash def self.read verify_file YAML.load_file(File.expand_path('~/.souschef.yml')) end # Private - Checks if we have a configuraiton file # Returns nil def self.verify_file conf = File.expand_path('~/.souschef.yml') fail "'~/.souschef.yml' missing!" unless File.exist?(conf) end end end
package main import ( "encoding/json" "flag" "fmt" "io/ioutil" "log" "net/url" "os" "os/user" "path/filepath" "strings" "crypto/tls" "net/http" ) type configCommand struct { config *ClientConfig } // <API key> returns an *http.Client with InsecureSkipVerify set // to true for its TLS config. This allows self-signed SSL certificates. func <API key>(skipVerify bool) *http.Client { if skipVerify { tlsConfig := &tls.Config{InsecureSkipVerify: true} transport := &http.Transport{TLSClientConfig: tlsConfig} return &http.Client{Transport: transport} } return http.DefaultClient } func (cmd *configCommand) Run(args []string) error { if len(args) < 1 { cmd.Usage() os.Exit(1) } var config *ClientConfig if cfg, err := LoadClientConfig(); err == nil { config = cfg } else { config = new(ClientConfig) } var run func(*ClientConfig, []string) error switch strings.ToLower(args[0]) { case "set": run = setCmd case "print": printConfig() return nil default: cmd.Usage() os.Exit(1) } return run(config, args[1:]) } func printConfig() { path, err := clientConfigPath() if err != nil { log.Fatal(err) } cfgData, err := ioutil.ReadFile(path) if err != nil { log.Fatal(err) } fmt.Println(string(cfgData)) } func (cmd *configCommand) Usage() error { const help = ` mdmctl config print mdmctl config set -h ` fmt.Println(help) return nil } func setCmd(cfg *ClientConfig, args []string) error { flagset := flag.NewFlagSet("set", flag.ExitOnError) var ( flToken = flagset.String("api-token", "", "api token to connect to micromdm server") flServerURL = flagset.String("server-url", "", "server url of micromdm server") flSkipVerify = flagset.Bool("skip-verify", false, "skip verification of server certificate (insecure)") ) flagset.Usage = usageFor(flagset, "mdmctl config set [flags]") if err := flagset.Parse(args); err != nil { return err } if *flToken != "" { cfg.APIToken = *flToken } if *flServerURL != "" { if !strings.HasPrefix(*flServerURL, "http") || !strings.HasPrefix(*flServerURL, "https") { *flServerURL = "https://" + *flServerURL } u, err := url.Parse(*flServerURL) if err != nil { return err } u.Scheme = "https" u.Path = "/" cfg.ServerURL = u.String() } cfg.SkipVerify = *flSkipVerify return SaveClientConfig(cfg) } func clientConfigPath() (string, error) { usr, err := user.Current() if err != nil { return "", err } return filepath.Join(usr.HomeDir, ".micromdm", "default.json"), err } func SaveClientConfig(cfg *ClientConfig) error { configPath, err := clientConfigPath() if err != nil { return err } if _, err := os.Stat(filepath.Dir(configPath)); os.IsNotExist(err) { if err := os.MkdirAll(filepath.Dir(configPath), 0777); err != nil { return err } } f, err := os.OpenFile(configPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600) if err != nil { return err } defer f.Close() if cfg == nil { cfg = new(ClientConfig) } enc := json.NewEncoder(f) enc.SetIndent("", " ") return enc.Encode(cfg) } func LoadClientConfig() (*ClientConfig, error) { path, err := clientConfigPath() if err != nil { return nil, err } cfgData, err := ioutil.ReadFile(path) if err != nil { return nil, fmt.Errorf("unable to load default config file: %s", err) } var cfg ClientConfig err = json.Unmarshal(cfgData, &cfg) if err != nil { return nil, fmt.Errorf("failed to unmarshal %s : %s", path, err) } return &cfg, nil } type ClientConfig struct { APIToken string `json:"api_token"` ServerURL string `json:"server_url"` SkipVerify bool `json:"skip_verify"` }
# This is needed to render the menu properly, according to user's actions. # The first menu option has an index of 0. The lower option is, the higher index it has. <API key>() { # In case Arrow Down was pressed. if [ "$1" == $<API key> ]; then # If there are no more options to choose from, do nothing: the current index will NOT # be reset to 0 (zero). if (($(($<API key>+1)) < $<API key>)); then # Increment the value. <API key>=$(($<API key>+1)) fi fi # In case Arrow Up was pressed. if [ "$1" == $SELECTABLE_ARROW_UP ]; then # See the condition above. The current index will NOT be set to the latest element # (option). if (($(($<API key>)) >= 0)); then # Decrement the value. <API key>=$(($<API key>)) fi fi }
#include "InvocationManager.h" #include <bb/system/CardDoneMessage> #include <bb/system/InvokeRequest> // to send number data while invoking phone application #include <bb/PpsObject> // Map #include <bb/platform/LocationMapInvoker> #include <bb/platform/RouteMapInvoker> // contacts #include <bb/cascades/pickers/ContactPicker> using namespace bb::system; using namespace bb::platform; using namespace bb::cascades::pickers; InvocationManager::InvocationManager(const char* name) : Ti::TiProxy(name) { // Create a method, it also has to start with `_` <API key>("openURL", _openURLMethod); <API key>("callPhoneNumber", <API key>); <API key>("facebookShare", <API key>); <API key>("openSettings", _openSettingsMethod); <API key>("openPdf", _openPdfMethod); <API key>("openMap", _openMapMethod); <API key>("openContacts", _openContactsMethod); } InvocationManager::~InvocationManager() { // delete instatiated pointers } Ti::TiValue InvocationManager::openURLMethod(Ti::TiValue url) { Ti::TiValue returnValue; returnValue.toBool(); if (invokeReply_ && !invokeReply_->isFinished()) { // Don't send another invoke request if one is already pending. return returnValue; } // convert variable to QString QString myUrl = url.toString(); InvokeRequest request; request.setTarget("sys.browser"); request.setAction("bb.action.OPEN"); request.setUri(myUrl); invokeReply_ = invokeManager_.invoke(request); if (!invokeReply_) { fprintf(stderr, "Failed to invoke this card\n"); return returnValue; } returnValue.setBool(true); return returnValue; } Ti::TiValue InvocationManager::<API key>(Ti::TiValue number) { Ti::TiValue returnValue; returnValue.toBool(); if (invokeReply_ && !invokeReply_->isFinished()) { // Don't send another invoke request if one is already pending. return returnValue; } // convert variable to QString QString myNumber = number.toString(); QVariantMap map; map.insert("number", myNumber); QByteArray requestData = bb::PpsObject::encode(map, NULL); InvokeRequest request; request.setAction("bb.action.DIAL"); request.setMimeType("application/vnd.blackberry.phone.startcall"); request.setData(requestData); invokeReply_ = invokeManager_.invoke(request); if (!invokeReply_) { fprintf(stderr, "Failed to invoke this card\n"); return returnValue; } returnValue.setBool(true); return returnValue; } Ti::TiValue InvocationManager::facebookShareMethod(Ti::TiValue text) { //TODO: support image & url Ti::TiValue returnValue; returnValue.toBool(); if (invokeReply_ && !invokeReply_->isFinished()) { // Don't send another invoke request if one is already pending. return returnValue; } // convert variable to QString QString myText = text.toString(); InvokeRequest request; request.setTarget("Facebook"); request.setAction("bb.action.SHARE"); request.setMimeType("text/plain"); //request.setUri(myUrl); request.setData(myText.toLocal8Bit()); invokeReply_ = invokeManager_.invoke(request); if (!invokeReply_) { fprintf(stderr, "Failed to invoke this card\n"); return returnValue; } returnValue.setBool(true); return returnValue; } Ti::TiValue InvocationManager::openSettingsMethod(Ti::TiValue page) { Ti::TiValue returnValue; returnValue.toBool(); if (invokeReply_ && !invokeReply_->isFinished()) { // Don't send another invoke request if one is already pending. return returnValue; } // convert variable to QString QString myPage = page.toString(); InvokeRequest request; request.setTarget("sys.settings.card"); request.setAction("bb.action.OPEN"); request.setMimeType("settings/view"); request.setUri(myPage); invokeReply_ = invokeManager_.invoke(request); if (!invokeReply_) { fprintf(stderr, "Failed to invoke this card\n"); return returnValue; } returnValue.setBool(true); return returnValue; } Ti::TiValue InvocationManager::openPdfMethod(Ti::TiValue url) { Ti::TiValue returnValue; returnValue.toBool(); if (invokeReply_ && !invokeReply_->isFinished()) { // Don't send another invoke request if one is already pending. return returnValue; } // convert variable to QString QString myUrl = url.toString(); InvokeRequest request; request.setTarget("com.rim.bb.app.adobeReader.viewer"); request.setAction("bb.action.VIEW"); request.setMimeType("application/pdf"); request.setUri( "file:" + QDir::currentPath() + "/app/native/assets/" + myUrl); invokeReply_ = invokeManager_.invoke(request); if (!invokeReply_) { fprintf(stderr, "Failed to invoke this card\n"); return returnValue; } returnValue.setBool(true); return returnValue; } Ti::TiValue InvocationManager::openMapMethod(Ti::TiValue type) { Ti::TiValue returnValue; returnValue.toBool(); // convert variable to QString QString myType = type.toString(); if (myType == "pin") { LocationMapInvoker lmi; // Sample location set as Toronto // Latitude and Longitude values are expressed // in WGS 84 datum standard lmi.setLocationLatitude(25.1980730); lmi.<API key>(55.2728830); lmi.setLocationName("Burj Khalifa"); lmi.<API key>("The tallest building in the world."); //set "geocode" : false lmi.<API key>(true); //set "geolocation" : false lmi.<API key>(true); lmi.go(); } else { RouteMapInvoker rmi; // Latitude and Longitude values are expressed // in WGS 84 datum standard rmi.setEndLatitude(25.1412000); rmi.setEndLongitude(55.1854000); rmi.setEndName("Burj Al-Arab"); rmi.setEndDescription("The royal suite"); rmi.setEndAddress("Burj Al-Arab, Dubai"); rmi.setNavigationMode(bb::platform::MapNavigationMode::FastestRoute); rmi.<API key>(bb::platform::<API key>::Car); rmi.go(); } returnValue.setBool(true); return returnValue; } Ti::TiValue InvocationManager::openContactsMethod(Ti::TiValue text) { Ti::TiValue returnValue; returnValue.toBool(); ContactPicker *contactPicker = new ContactPicker(); contactPicker->setMode(<API key>::Single); contactPicker->setKindFilters( QSet<bb::pim::contacts::AttributeKind::Type>() << bb::pim::contacts::AttributeKind::Phone); contactPicker->open(); returnValue.setBool(true); return returnValue; }
<?php namespace Lonquan\TaobaoSDK\Top\Request; use Lonquan\TaobaoSDK\Top\RequestCheckUtil; use Lonquan\TaobaoSDK\Top\RequestInterface; /** * TOP API: taobao.product.img.delete request * * @author auto create * @since 1.0, 2016.03.05 */ class <API key> implements RequestInterface { private $id; /** * ID.Productid,taobao.product.addid. **/ private $productId; private $apiParas = [ ]; public function setId($id) { $this->id = $id; $this->apiParas["id"] = $id; } public function getId() { return $this->id; } public function setProductId($productId) { $this->productId = $productId; $this->apiParas["product_id"] = $productId; } public function getProductId() { return $this->productId; } public function getApiMethodName() { return "taobao.product.img.delete"; } public function getApiParas() { return $this->apiParas; } public function check() { RequestCheckUtil::checkNotNull($this->id, "id"); RequestCheckUtil::checkNotNull($this->productId, "productId"); } public function putOtherTextParam($key, $value) { $this->apiParas[ $key ] = $value; $this->$key = $value; } }
require "point/version" module Point autoload :Point, 'point/point' def self.sum(*args) x = y = 0 args.each do |point| x += point.x y += point.y end self::Point.new(x, y) end end
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="de"> <head> <!-- Generated by javadoc (1.8.0_121) on Sat Apr 01 23:01:20 CEST 2017 --> <title>Uses of Class algorithms.InitStrategy</title> <meta name="date" content="2017-04-01"> <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 algorithms.InitStrategy"; } } catch(err) { } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <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="../../algorithms/InitStrategy.html" title="enum in algorithms">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="../../index-files/index-1.html">Index</a></li> <li><a href="../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../index.html?algorithms/class-use/InitStrategy.html" target="_top">Frames</a></li> <li><a href="InitStrategy.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <h2 title="Uses of Class algorithms.InitStrategy" class="title">Uses of Class<br>algorithms.InitStrategy</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="../../algorithms/InitStrategy.html" title="enum in algorithms">InitStrategy</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="#algorithms">algorithms</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="algorithms"> </a> <h3>Uses of <a href="../../algorithms/InitStrategy.html" title="enum in algorithms">InitStrategy</a> in <a href="../../algorithms/package-summary.html">algorithms</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../algorithms/package-summary.html">algorithms</a> that return <a href="../../algorithms/InitStrategy.html" title="enum in algorithms">InitStrategy</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>static <a href="../../algorithms/InitStrategy.html" title="enum in algorithms">InitStrategy</a></code></td> <td class="colLast"><span class="typeNameLabel">InitStrategy.</span><code><span class="memberNameLink"><a href="../../algorithms/InitStrategy.html#valueOf-java.lang.String-">valueOf</a></span>(java.lang.String&nbsp;name)</code> <div class="block">Returns the enum constant of this type with the specified name.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../algorithms/InitStrategy.html" title="enum in algorithms">InitStrategy</a>[]</code></td> <td class="colLast"><span class="typeNameLabel">InitStrategy.</span><code><span class="memberNameLink"><a href="../../algorithms/InitStrategy.html#values--">values</a></span>()</code> <div class="block">Returns an array containing the constants of this enum type, in the order they are declared.</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="../../algorithms/package-summary.html">algorithms</a> with parameters of type <a href="../../algorithms/InitStrategy.html" title="enum in algorithms">InitStrategy</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>java.util.List&lt;<a href="../../data/Cluster.html" title="class in data">Cluster</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">Kmeans.</span><code><span class="memberNameLink"><a href="../../algorithms/Kmeans.html#<API key>.<API key>.UpdateStrategy-">calculateClusters</a></span>(<a href="../../algorithms/InitStrategy.html" title="enum in algorithms">InitStrategy</a>&nbsp;initStrat, <a href="../../algorithms/UpdateStrategy.html" title="enum in algorithms">UpdateStrategy</a>&nbsp;updateStrat)</code> <div class="block">calculateClusters(initStrat, updateStrat) startet das <API key></div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <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="../../algorithms/InitStrategy.html" title="enum in algorithms">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="../../index-files/index-1.html">Index</a></li> <li><a href="../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../index.html?algorithms/class-use/InitStrategy.html" target="_top">Frames</a></li> <li><a href="InitStrategy.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.bottom"> </a></div> </body> </html>
<?php namespace MvMidia\Factory; use MvMidia\Service\AudioService; use Zend\ServiceManager\FactoryInterface; use Zend\ServiceManager\<API key>; class AudioServiceFactory implements FactoryInterface { public function createService(<API key> $serviceLocator) { $entityManager = $serviceLocator->get('Doctrine\ORM\EntityManager'); return new AudioService($entityManager); } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _10.CatalanNumbers { class Program { static void Main(string[] args) { // 10. Write a program to calculate the Nth Catalan number by given N. Console.Write("Insert N = "); string input = Console.ReadLine(); int num; int catalanNumber; int factN = 1; int factM = 1; int factK = 1; if (int.TryParse(input, out num)) { if (num > -1) { if (num == 0) { Console.WriteLine("Catalan number given by '0' is: 1"); } else if (num >= 1) { int n = num; while (n > 1) { factN = factN * n; // for (n!) n = n - 1; } n = num + 1; while (n > 1) { factM = factM * n; // for (n + 1) n = n - 1; } n = 2 * num; while (n > 1) { factK = factK * n; // for (2 * n) n = n - 1; } catalanNumber = factK / (factM * factN); Console.WriteLine("Catalan number given by 'N' is: " + catalanNumber); } } else { Console.WriteLine("N < 0"); } } else { Console.WriteLine("Incorect input!"); } } } }
<?php /* TwigBundle:Exception:traces.txt.twig */ class <API key> extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); $this->parent = false; $this->blocks = array( ); } protected function doDisplay(array $context, array $blocks = array()) { // line 1 if (twig_length_filter($this->env, $this->getAttribute($this->getContext($context, "exception"), "trace"))) { // line 2 $context['_parent'] = (array) $context; $context['_seq'] = <API key>($this->getAttribute($this->getContext($context, "exception"), "trace")); foreach ($context['_seq'] as $context["_key"] => $context["trace"]) { // line 3 $this->env->loadTemplate("TwigBundle:Exception:trace.txt.twig")->display(array("trace" => $this->getContext($context, "trace"))); // line 4 echo " "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['trace'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; } } public function getTemplateName() { return "TwigBundle:Exception:traces.txt.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 42 => 14, 38 => 13, 35 => 4, 26 => 5, 87 => 20, 80 => 19, 55 => 13, 46 => 7, 44 => 10, 36 => 7, 31 => 5, 25 => 3, 21 => 2, 94 => 22, 92 => 21, 89 => 20, 85 => 19, 79 => 18, 75 => 17, 72 => 16, 68 => 14, 64 => 12, 56 => 9, 50 => 8, 41 => 9, 27 => 4, 24 => 4, 22 => 2, 201 => 92, 199 => 91, 196 => 90, 187 => 84, 183 => 82, 173 => 74, 171 => 73, 168 => 72, 166 => 71, 163 => 70, 158 => 67, 156 => 66, 151 => 63, 142 => 59, 138 => 57, 136 => 56, 133 => 55, 123 => 47, 121 => 46, 117 => 44, 115 => 43, 112 => 42, 105 => 40, 101 => 24, 91 => 31, 86 => 28, 69 => 25, 66 => 15, 62 => 23, 51 => 15, 49 => 19, 39 => 6, 32 => 12, 19 => 1, 57 => 16, 54 => 21, 43 => 8, 40 => 7, 33 => 10, 30 => 3,); } }
<section *ngIf="blogItems"> <div class="background"></div> <div class="wrapper" *ngFor="let item of blogItems"> <div class="text" [innerHtml]="texts[blogItems.indexOf(item)]"></div> <div class="item"> <aae-blog-item [blogItem]="item" [alias]="alias"></aae-blog-item> </div> </div> </section>
(function() { var $, expect, fruits; $ = require('../'); expect = require('expect.js'); /* Examples */ fruits = '<ul id = "fruits">\n <li class = "apple">Apple</li>\n <li class = "orange">Orange</li>\n <li class = "pear">Pear</li>\n</ul>'.replace(/(\n|\s{2})/g, ''); /* Tests */ describe('$(...)', function() { describe('.find', function() { it('() : should return this', function() { return expect($('ul', fruits).find()[0].name).to.equal('ul'); }); it('(single) : should find one descendant', function() { return expect($('#fruits', fruits).find('.apple')[0].attribs["class"]).to.equal('apple'); }); it('(many) : should find all matching descendant', function() { return expect($('#fruits', fruits).find('li')).to.have.length(3); }); it('(many) : should merge all selected elems with matching descendants'); it('(invalid single) : should return empty if cant find', function() { return expect($('ul', fruits).find('blah')).to.have.length(0); }); return it('should return empty if search already empty result', function() { return expect($('#fruits').find('li')).to.have.length(0); }); }); describe('.children', function() { it('() : should get all children', function() { return expect($('ul', fruits).children()).to.have.length(3); }); it('(selector) : should return children matching selector', function() { return expect($('ul', fruits).children('.orange').hasClass('orange')).to.be.ok; }); it('(invalid selector) : should return empty', function() { return expect($('ul', fruits).children('.lulz')).to.have.length(0); }); return it('should only match immediate children, not ancestors'); }); describe('.next', function() { it('() : should return next element', function() { return expect($('.orange', fruits).next().hasClass('pear')).to.be.ok; }); return it('(no next) : should return null (?)'); }); describe('.prev', function() { it('() : should return previous element', function() { return expect($('.orange', fruits).prev().hasClass('apple')).to.be.ok; }); return it('(no prev) : should return null (?)'); }); describe('.siblings', function() { it('() : should get all the siblings', function() { return expect($('.orange', fruits).siblings()).to.have.length(2); }); return it('(selector) : should get all siblings that match the selector', function() { return expect($('.orange', fruits).siblings('li')).to.have.length(2); }); }); describe('.each', function() { return it('( (i, elem) -> ) : should loop selected returning fn with (i, elem)', function() { var items; items = []; $('li', fruits).each(function(i, elem) { return items[i] = elem; }); expect(items[0].attribs["class"]).to.equal('apple'); expect(items[1].attribs["class"]).to.equal('orange'); return expect(items[2].attribs["class"]).to.equal('pear'); }); }); describe('.first', function() { it('() : should return the first item', function() { var elem, src; src = $("<span>foo</span><span>bar</span><span>baz</span>"); elem = src.first(); expect(elem.length).to.equal(1); return expect(elem.html()).to.equal('foo'); }); return it('() : should return an empty object for an empty object', function() { var first, src; src = $(); first = src.first(); expect(first.length).to.equal(0); return expect(first.html()).to.be(null); }); }); describe('.last', function() { it('() : should return the last element', function() { var elem, src; src = $("<span>foo</span><span>bar</span><span>baz</span>"); elem = src.last(); expect(elem.length).to.equal(1); return expect(elem.html()).to.equal('baz'); }); return it('() : should return an empty object for an empty object', function() { var last, src; src = $(); last = src.last(); expect(last.length).to.equal(0); return expect(last.html()).to.be(null); }); }); describe('.first & .last', function() { return it('() : should return same object if only one object', function() { var first, last, src; src = $("<span>bar</span>"); first = src.first(); last = src.last(); expect(first.html()).to.equal(last.html()); expect(first.length).to.equal(1); expect(first.html()).to.equal('bar'); expect(last.length).to.equal(1); return expect(last.html()).to.equal('bar'); }); }); return describe('.eq', function() { return it('(i) : should return the element at the specified index', function() { expect($('li', fruits).eq(0).text()).to.equal('Apple'); expect($('li', fruits).eq(1).text()).to.equal('Orange'); expect($('li', fruits).eq(2).text()).to.equal('Pear'); expect($('li', fruits).eq(3).text()).to.equal(''); return expect($('li', fruits).eq(-1).text()).to.equal('Pear'); }); }); }); }).call(this);
<?php namespace Symfony\Component\Form; use Symfony\Component\Form\Exception\<API key>; use Symfony\Component\Form\Exception\<API key>; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\OptionsResolver\OptionsResolver; /** * A wrapper for a form type and its extensions. * * @author Bernhard Schussek <bschussek@gmail.com> */ class ResolvedFormType implements <API key> { /** * @var FormTypeInterface */ private $innerType; /** * @var <API key>[] */ private $typeExtensions; /** * @var <API key>|null */ private $parent; /** * @var OptionsResolver */ private $optionsResolver; public function __construct(FormTypeInterface $innerType, array $typeExtensions = array(), <API key> $parent = null) { if (!preg_match('/^[a-z0-9_]*$/i', $innerType->getName())) { throw new <API key>(sprintf( 'The "%s" form type name ("%s") is not valid. Names must only contain letters, numbers, and "_".', get_class($innerType), $innerType->getName() )); } foreach ($typeExtensions as $extension) { if (!$extension instanceof <API key>) { throw new <API key>($extension, 'Symfony\Component\Form\<API key>'); } } $this->innerType = $innerType; $this->typeExtensions = $typeExtensions; $this->parent = $parent; } /** * {@inheritdoc} */ public function getName() { return $this->innerType->getName(); } /** * {@inheritdoc} */ public function getParent() { return $this->parent; } /** * {@inheritdoc} */ public function getInnerType() { return $this->innerType; } /** * {@inheritdoc} */ public function getTypeExtensions() { return $this->typeExtensions; } /** * {@inheritdoc} */ public function createBuilder(<API key> $factory, $name, array $options = array()) { $options = $this->getOptionsResolver()->resolve($options); // Should be decoupled from the specific option at some point $dataClass = isset($options['data_class']) ? $options['data_class'] : null; $builder = $this->newBuilder($name, $dataClass, $factory, $options); $builder->setType($this); return $builder; } /** * {@inheritdoc} */ public function createView(FormInterface $form, FormView $parent = null) { return $this->newView($parent); } /** * Configures a form builder for the type hierarchy. * * @param <API key> $builder The builder to configure * @param array $options The options used for the configuration */ public function buildForm(<API key> $builder, array $options) { if (null !== $this->parent) { $this->parent->buildForm($builder, $options); } $this->innerType->buildForm($builder, $options); foreach ($this->typeExtensions as $extension) { $extension->buildForm($builder, $options); } } /** * Configures a form view for the type hierarchy. * * This method is called before the children of the view are built. * * @param FormView $view The form view to configure * @param FormInterface $form The form corresponding to the view * @param array $options The options used for the configuration */ public function buildView(FormView $view, FormInterface $form, array $options) { if (null !== $this->parent) { $this->parent->buildView($view, $form, $options); } $this->innerType->buildView($view, $form, $options); foreach ($this->typeExtensions as $extension) { $extension->buildView($view, $form, $options); } } /** * Finishes a form view for the type hierarchy. * * This method is called after the children of the view have been built. * * @param FormView $view The form view to configure * @param FormInterface $form The form corresponding to the view * @param array $options The options used for the configuration */ public function finishView(FormView $view, FormInterface $form, array $options) { if (null !== $this->parent) { $this->parent->finishView($view, $form, $options); } $this->innerType->finishView($view, $form, $options); foreach ($this->typeExtensions as $extension) { /* @var <API key> $extension */ $extension->finishView($view, $form, $options); } } /** * Returns the configured options resolver used for this type. * * @return \Symfony\Component\OptionsResolver\<API key> The options resolver */ public function getOptionsResolver() { if (null === $this->optionsResolver) { if (null !== $this->parent) { $this->optionsResolver = clone $this->parent->getOptionsResolver(); } else { $this->optionsResolver = new OptionsResolver(); } $this->innerType->setDefaultOptions($this->optionsResolver); if (method_exists($this->innerType, 'configureOptions')) { $reflector = new \ReflectionMethod($this->innerType, 'setDefaultOptions'); $isOldOverwritten = 'Symfony\Component\Form\AbstractType' !== $reflector->getDeclaringClass()->getName(); $reflector = new \ReflectionMethod($this->innerType, 'configureOptions'); $isNewOverwritten = 'Symfony\Component\Form\AbstractType' !== $reflector->getDeclaringClass()->getName(); if ($isOldOverwritten && !$isNewOverwritten) { @trigger_error(get_class($this->innerType).': The FormTypeInterface::setDefaultOptions() method is deprecated since version 2.7 and will be removed in 3.0. Use configureOptions() instead. This method will be added to the FormTypeInterface with Symfony 3.0.', E_USER_DEPRECATED); } } else { @trigger_error(get_class($this->innerType).': The FormTypeInterface::configureOptions() method will be added in Symfony 3.0. You should extend AbstractType or implement it in your classes.', E_USER_DEPRECATED); } foreach ($this->typeExtensions as $extension) { $extension->setDefaultOptions($this->optionsResolver); if (method_exists($extension, 'configureOptions')) { $reflector = new \ReflectionMethod($extension, 'setDefaultOptions'); $isOldOverwritten = 'Symfony\Component\Form\<API key>' !== $reflector->getDeclaringClass()->getName(); $reflector = new \ReflectionMethod($extension, 'configureOptions'); $isNewOverwritten = 'Symfony\Component\Form\<API key>' !== $reflector->getDeclaringClass()->getName(); if ($isOldOverwritten && !$isNewOverwritten) { @trigger_error(get_class($extension).': The <API key>::setDefaultOptions() method is deprecated since version 2.7 and will be removed in 3.0. Use configureOptions() instead. This method will be added to the <API key> with Symfony 3.0.', E_USER_DEPRECATED); } } else { @trigger_error(get_class($this->innerType).': The <API key>::configureOptions() method will be added in Symfony 3.0. You should extend <API key> or implement it in your classes.', E_USER_DEPRECATED); } } } return $this->optionsResolver; } /** * Creates a new builder instance. * * Override this method if you want to customize the builder class. * * @param string $name The name of the builder * @param string $dataClass The data class * @param <API key> $factory The current form factory * @param array $options The builder options * * @return <API key> The new builder instance */ protected function newBuilder($name, $dataClass, <API key> $factory, array $options) { if ($this->innerType instanceof ButtonTypeInterface) { return new ButtonBuilder($name, $options); } if ($this->innerType instanceof <API key>) { return new SubmitButtonBuilder($name, $options); } return new FormBuilder($name, $dataClass, new EventDispatcher(), $factory, $options); } /** * Creates a new view instance. * * Override this method if you want to customize the view class. * * @param FormView|null $parent The parent view, if available * * @return FormView A new view instance */ protected function newView(FormView $parent = null) { return new FormView($parent); } }
<!DOCTYPE html> <html lang = "en"> <head> <title> Cultural Blog</title> <link href='http://fonts.googleapis.com/css?family=Italianno' rel='stylesheet' type='text/css'> </head> <style type="text/css"> h1 { text-align: center; margin-top: 3% } p { } body { background: url("http: background-size: cover; font-family: 'Italianno', serif; font-size: 32px } .question { color: #4D4D4D; margin-top: 3% } .answer { } </style> <body> <h1>Here are my answers to Q&A:</h1> <p class="question">Q: When you think of the times in your life where you've been the happiest, the proudest, or the most satisfied, which of the following values come to mind?</p> <p class="answer">A: Accomplishment, Achievement, Adventure, Autonomy, Relationships, Commitment, Courage, Creativity, Competence, Confidence, Credibility, Decisiveness, Effectiveness, Excitement, Faith, Freedom, Fiendships, Growth, Having a family, Health, Helping other people, Independence, Inner harmony, Insight, Justice, Knowledge, Peace, Personal development, Pleasure, Romance, Security, Serenity, Sophistication, Spirituality, Tranquility, Truth, Vibrancy, Wisdom</p> <p class="question">Q: Pick one value and write a couple of sentences about why one of the values you chose is important to you</p> <p class="answer">A: Having faith is the source of everything you need in life. Faith in god and yourself. It brings all other qualities and values you need in life. It brings peace, Inner harmony, Serenity, Courage, Confidence, and all other values I mentioned above.</p> <p class="question">Q: Answer the following for the values you chose in Exercise 1: In general, I try to live up to these values: Disagree 1 <p class="answer">A: I have to say 5. I try my best to live up to those values because they do make me happy and satisfied.</p> <p class="question">Q: What was the last topic that someone asked for your advice on?</p> <p class="answer">A: A close friend of mine got accepted in couple of universities for p.h.d and he asked for my advice about the cities and which university he should attend.</p> </body>
# nepali-wordlist Nepali wordlist for wpa2 cracking. Includes password with length of 8 character or more and mostly contains nepali words including other common words. ## Files * <API key>+.txt.gz:__ `Nepali names passwords with numbered suffix. Contains 80,00,000 words with up to 3 number suffixa. Level 9 compression used to compress. Original size is around 50 MB. ` * __nepali-name.txt:__ `8000+ nepali names which might be helpful to create your own wordlist or in some other projects.` * __wlist.py:__ `This is a wordlist manager script which can strip down larg wordlist to a smaller one according to your need. Codes are all messed up wtihout proper documentation but it works perfectly.. :)` *__Install:__* 1. Copy this script to your path. 2. Make it execuitable by `chmod +x wlist.py` 3. Execuite command by wlist.py from terminal.
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: <API key>/core/example/feature.proto #include "<API key>/core/example/feature.pb.h" #include <algorithm> #include <google/protobuf/stubs/common.h> #include <google/protobuf/stubs/port.h> #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/<API key>.h> #include <google/protobuf/descriptor.h> #include <google/protobuf/<API key>.h> #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> // This is a temporary google only hack #ifdef <API key> #include "third_party/protobuf/version.h" #endif // @@<API key>(includes) namespace <API key> { extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_BytesList; extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_FloatList; extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto ::google::protobuf::internal::SCCInfo<0> scc_info_Int64List; extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto ::google::protobuf::internal::SCCInfo<1> <API key>; extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto ::google::protobuf::internal::SCCInfo<1> <API key>; extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto ::google::protobuf::internal::SCCInfo<1> <API key>; extern PROTOBUF_INTERNAL_EXPORT_protobuf_diplomacy_5ftensorflow_2fcore_2fexample_2ffeature_2eproto ::google::protobuf::internal::SCCInfo<3> scc_info_Feature; } // namespace <API key> namespace diplomacy { namespace tensorflow { class <API key> { public: ::google::protobuf::internal::<API key><BytesList> _instance; } <API key>; class <API key> { public: ::google::protobuf::internal::<API key><FloatList> _instance; } <API key>; class <API key> { public: ::google::protobuf::internal::<API key><Int64List> _instance; } <API key>; class <API key> { public: ::google::protobuf::internal::<API key><Feature> _instance; const ::diplomacy::tensorflow::BytesList* bytes_list_; const ::diplomacy::tensorflow::FloatList* float_list_; const ::diplomacy::tensorflow::Int64List* int64_list_; } <API key>; class <API key> { public: ::google::protobuf::internal::<API key><<API key>> _instance; } <API key>; class <API key> { public: ::google::protobuf::internal::<API key><Features> _instance; } <API key>; class <API key> { public: ::google::protobuf::internal::<API key><FeatureList> _instance; } <API key>; class <API key> { public: ::google::protobuf::internal::<API key><<API key>> _instance; } <API key>; class <API key> { public: ::google::protobuf::internal::<API key><FeatureLists> _instance; } <API key>; } // namespace tensorflow } // namespace diplomacy namespace <API key> { static void <API key>() { <API key>; { void* ptr = &::diplomacy::tensorflow::<API key>; new (ptr) ::diplomacy::tensorflow::BytesList(); ::google::protobuf::internal::<API key>(ptr); } ::diplomacy::tensorflow::BytesList::<API key>(); } ::google::protobuf::internal::SCCInfo<0> scc_info_BytesList = {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, <API key>}, {}}; static void <API key>() { <API key>; { void* ptr = &::diplomacy::tensorflow::<API key>; new (ptr) ::diplomacy::tensorflow::FloatList(); ::google::protobuf::internal::<API key>(ptr); } ::diplomacy::tensorflow::FloatList::<API key>(); } ::google::protobuf::internal::SCCInfo<0> scc_info_FloatList = {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, <API key>}, {}}; static void <API key>() { <API key>; { void* ptr = &::diplomacy::tensorflow::<API key>; new (ptr) ::diplomacy::tensorflow::Int64List(); ::google::protobuf::internal::<API key>(ptr); } ::diplomacy::tensorflow::Int64List::<API key>(); } ::google::protobuf::internal::SCCInfo<0> scc_info_Int64List = {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 0, <API key>}, {}}; static void InitDefaultsFeature() { <API key>; { void* ptr = &::diplomacy::tensorflow::<API key>; new (ptr) ::diplomacy::tensorflow::Feature(); ::google::protobuf::internal::<API key>(ptr); } ::diplomacy::tensorflow::Feature::<API key>(); } ::google::protobuf::internal::SCCInfo<3> scc_info_Feature = {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 3, InitDefaultsFeature}, { &<API key>::scc_info_BytesList.base, &<API key>::scc_info_FloatList.base, &<API key>::scc_info_Int64List.base,}}; static void <API key>() { <API key>; { void* ptr = &::diplomacy::tensorflow::<API key>; new (ptr) ::diplomacy::tensorflow::<API key>(); } ::diplomacy::tensorflow::<API key>::<API key>(); } ::google::protobuf::internal::SCCInfo<1> <API key> = {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, <API key>}, { &<API key>::scc_info_Feature.base,}}; static void <API key>() { <API key>; { void* ptr = &::diplomacy::tensorflow::<API key>; new (ptr) ::diplomacy::tensorflow::Features(); ::google::protobuf::internal::<API key>(ptr); } ::diplomacy::tensorflow::Features::<API key>(); } ::google::protobuf::internal::SCCInfo<1> scc_info_Features = {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, <API key>}, { &<API key>::<API key>.base,}}; static void <API key>() { <API key>; { void* ptr = &::diplomacy::tensorflow::<API key>; new (ptr) ::diplomacy::tensorflow::FeatureList(); ::google::protobuf::internal::<API key>(ptr); } ::diplomacy::tensorflow::FeatureList::<API key>(); } ::google::protobuf::internal::SCCInfo<1> <API key> = {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, <API key>}, { &<API key>::scc_info_Feature.base,}}; static void <API key>() { <API key>; { void* ptr = &::diplomacy::tensorflow::<API key>; new (ptr) ::diplomacy::tensorflow::<API key>(); } ::diplomacy::tensorflow::<API key>::<API key>(); } ::google::protobuf::internal::SCCInfo<1> <API key> = {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, <API key>}, { &<API key>::<API key>.base,}}; static void <API key>() { <API key>; { void* ptr = &::diplomacy::tensorflow::<API key>; new (ptr) ::diplomacy::tensorflow::FeatureLists(); ::google::protobuf::internal::<API key>(ptr); } ::diplomacy::tensorflow::FeatureLists::<API key>(); } ::google::protobuf::internal::SCCInfo<1> <API key> = {{ATOMIC_VAR_INIT(::google::protobuf::internal::SCCInfoBase::kUninitialized), 1, <API key>}, { &<API key>::<API key>.base,}}; void InitDefaults() { ::google::protobuf::internal::InitSCC(&scc_info_BytesList.base); ::google::protobuf::internal::InitSCC(&scc_info_FloatList.base); ::google::protobuf::internal::InitSCC(&scc_info_Int64List.base); ::google::protobuf::internal::InitSCC(&scc_info_Feature.base); ::google::protobuf::internal::InitSCC(&<API key>.base); ::google::protobuf::internal::InitSCC(&scc_info_Features.base); ::google::protobuf::internal::InitSCC(&<API key>.base); ::google::protobuf::internal::InitSCC(&<API key>.base); ::google::protobuf::internal::InitSCC(&<API key>.base); } ::google::protobuf::Metadata file_level_metadata[9]; const ::google::protobuf::uint32 TableStruct::offsets[] <API key>(protodesc_cold) = { ~0u, // no _has_bits_ <API key>(::diplomacy::tensorflow::BytesList, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ <API key>(::diplomacy::tensorflow::BytesList, value_), ~0u, // no _has_bits_ <API key>(::diplomacy::tensorflow::FloatList, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ <API key>(::diplomacy::tensorflow::FloatList, value_), ~0u, // no _has_bits_ <API key>(::diplomacy::tensorflow::Int64List, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ <API key>(::diplomacy::tensorflow::Int64List, value_), ~0u, // no _has_bits_ <API key>(::diplomacy::tensorflow::Feature, _internal_metadata_), ~0u, // no _extensions_ <API key>(::diplomacy::tensorflow::Feature, _oneof_case_[0]), ~0u, // no _weak_field_map_ offsetof(::diplomacy::tensorflow::<API key>, bytes_list_), offsetof(::diplomacy::tensorflow::<API key>, float_list_), offsetof(::diplomacy::tensorflow::<API key>, int64_list_), <API key>(::diplomacy::tensorflow::Feature, kind_), <API key>(::diplomacy::tensorflow::<API key>, _has_bits_), <API key>(::diplomacy::tensorflow::<API key>, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ <API key>(::diplomacy::tensorflow::<API key>, key_), <API key>(::diplomacy::tensorflow::<API key>, value_), 0, 1, ~0u, // no _has_bits_ <API key>(::diplomacy::tensorflow::Features, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ <API key>(::diplomacy::tensorflow::Features, feature_), ~0u, // no _has_bits_ <API key>(::diplomacy::tensorflow::FeatureList, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ <API key>(::diplomacy::tensorflow::FeatureList, feature_), <API key>(::diplomacy::tensorflow::<API key>, _has_bits_), <API key>(::diplomacy::tensorflow::<API key>, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ <API key>(::diplomacy::tensorflow::<API key>, key_), <API key>(::diplomacy::tensorflow::<API key>, value_), 0, 1, ~0u, // no _has_bits_ <API key>(::diplomacy::tensorflow::FeatureLists, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ <API key>(::diplomacy::tensorflow::FeatureLists, feature_list_), }; static const ::google::protobuf::internal::MigrationSchema schemas[] <API key>(protodesc_cold) = { { 0, -1, sizeof(::diplomacy::tensorflow::BytesList)}, { 6, -1, sizeof(::diplomacy::tensorflow::FloatList)}, { 12, -1, sizeof(::diplomacy::tensorflow::Int64List)}, { 18, -1, sizeof(::diplomacy::tensorflow::Feature)}, { 27, 34, sizeof(::diplomacy::tensorflow::<API key>)}, { 36, -1, sizeof(::diplomacy::tensorflow::Features)}, { 42, -1, sizeof(::diplomacy::tensorflow::FeatureList)}, { 48, 55, sizeof(::diplomacy::tensorflow::<API key>)}, { 57, -1, sizeof(::diplomacy::tensorflow::FeatureLists)}, }; static ::google::protobuf::Message const * const <API key>[] = { reinterpret_cast<const ::google::protobuf::Message*>(&::diplomacy::tensorflow::<API key>), reinterpret_cast<const ::google::protobuf::Message*>(&::diplomacy::tensorflow::<API key>), reinterpret_cast<const ::google::protobuf::Message*>(&::diplomacy::tensorflow::<API key>), reinterpret_cast<const ::google::protobuf::Message*>(&::diplomacy::tensorflow::<API key>), reinterpret_cast<const ::google::protobuf::Message*>(&::diplomacy::tensorflow::<API key>), reinterpret_cast<const ::google::protobuf::Message*>(&::diplomacy::tensorflow::<API key>), reinterpret_cast<const ::google::protobuf::Message*>(&::diplomacy::tensorflow::<API key>), reinterpret_cast<const ::google::protobuf::Message*>(&::diplomacy::tensorflow::<API key>), reinterpret_cast<const ::google::protobuf::Message*>(&::diplomacy::tensorflow::<API key>), }; void <API key>() { AddDescriptors(); AssignDescriptors( "<API key>/core/example/feature.proto", schemas, <API key>, TableStruct::offsets, file_level_metadata, NULL, NULL); } void <API key>() { static ::google::protobuf::internal::once_flag once; ::google::protobuf::internal::call_once(once, <API key>); } void <API key>(const ::std::string&) <API key>; void <API key>(const ::std::string&) { <API key>(); ::google::protobuf::internal::RegisterAllTypes(file_level_metadata, 9); } void AddDescriptorsImpl() { InitDefaults(); static const char descriptor[] <API key>(protodesc_cold) = { "\n/<API key>/core/example/feat" "ure.proto\022\024diplomacy.tensorflow\"\032\n\tBytes" "List\022\r\n\005value\030\001 \003(\014\"\036\n\tFloatList\022\021\n\005valu" "e\030\001 \003(\002B\002\020\001\"\036\n\tInt64List\022\021\n\005value\030\001 \003(\003B" "\002\020\001\"\266\001\n\007Feature\0225\n\nbytes_list\030\001 \001(\0132\037.di" "plomacy.tensorflow.BytesListH\000\0225\n\nfloat_" "list\030\002 \001(\0132\037.diplomacy.tensorflow.FloatL" "istH\000\0225\n\nint64_list\030\003 \001(\0132\037.diplomacy.te" "nsorflow.Int64ListH\000B\006\n\004kind\"\227\001\n\010Feature" "s\022<\n\007feature\030\001 \003(\0132+.diplomacy.tensorflo" "w.Features.FeatureEntry\032M\n\014FeatureEntry\022" "\013\n\003key\030\001 \001(\t\022,\n\005value\030\002 \001(\0132\035.diplomacy." "tensorflow.Feature:\0028\001\"=\n\013FeatureList\022.\n" "\007feature\030\001 \003(\0132\035.diplomacy.tensorflow.Fe" "ature\"\260\001\n\014FeatureLists\022I\n\014feature_list\030\001" " \003(\01323.diplomacy.tensorflow.FeatureLists" ".FeatureListEntry\032U\n\020FeatureListEntry\022\013\n" "\003key\030\001 \001(\t\0220\n\005value\030\002 \001(\0132!.diplomacy.te" "nsorflow.FeatureList:\0028\001Bi\n\026org.tensorfl" "ow.exampleB\rFeatureProtosP\001Z;github.com/" "tensorflow/tensorflow/tensorflow/go/core" "/example\370\001\001b\006proto3" }; ::google::protobuf::DescriptorPool::<API key>( descriptor, 859); ::google::protobuf::MessageFactory::<API key>( "<API key>/core/example/feature.proto", &<API key>); } void AddDescriptors() { static ::google::protobuf::internal::once_flag once; ::google::protobuf::internal::call_once(once, AddDescriptorsImpl); } // Force AddDescriptors() to be called at dynamic initialization time. struct <API key> { <API key>() { AddDescriptors(); } } <API key>; } // namespace <API key> namespace diplomacy { namespace tensorflow { void BytesList::<API key>() { } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int BytesList::kValueFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 BytesList::BytesList() : ::google::protobuf::Message(), _internal_metadata_(NULL) { ::google::protobuf::internal::InitSCC( &<API key>::scc_info_BytesList.base); SharedCtor(); // @@<API key>(constructor:diplomacy.tensorflow.BytesList) } BytesList::BytesList(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena), value_(arena) { ::google::protobuf::internal::InitSCC(&<API key>::scc_info_BytesList.base); SharedCtor(); RegisterArenaDtor(arena); // @@<API key>(arena_constructor:diplomacy.tensorflow.BytesList) } BytesList::BytesList(const BytesList& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), value_(from.value_) { _internal_metadata_.MergeFrom(from._internal_metadata_); // @@<API key>(copy_constructor:diplomacy.tensorflow.BytesList) } void BytesList::SharedCtor() { } BytesList::~BytesList() { // @@<API key>(destructor:diplomacy.tensorflow.BytesList) SharedDtor(); } void BytesList::SharedDtor() { GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); } void BytesList::ArenaDtor(void* object) { BytesList* _this = reinterpret_cast< BytesList* >(object); (void)_this; } void BytesList::RegisterArenaDtor(::google::protobuf::Arena* arena) { } void BytesList::SetCachedSize(int size) const { _cached_size_.Set(size); } const ::google::protobuf::Descriptor* BytesList::descriptor() { ::<API key>::<API key>(); return ::<API key>::file_level_metadata[<API key>].descriptor; } const BytesList& BytesList::default_instance() { ::google::protobuf::internal::InitSCC(&<API key>::scc_info_BytesList.base); return *<API key>(); } void BytesList::Clear() { // @@<API key>(message_clear_start:diplomacy.tensorflow.BytesList) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; value_.Clear(); _internal_metadata_.Clear(); } bool BytesList::<API key>( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@<API key>(parse_start:diplomacy.tensorflow.BytesList) for (;;) { ::std::pair<::google::protobuf::uint32, bool> p = input-><API key>(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated bytes value = 1; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( input, this->add_value())); } else { goto handle_unusual; } break; } default: { handle_unusual: if (tag == 0) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, _internal_metadata_.<API key>())); break; } } } success: // @@<API key>(parse_success:diplomacy.tensorflow.BytesList) return true; failure: // @@<API key>(parse_failure:diplomacy.tensorflow.BytesList) return false; #undef DO_ } void BytesList::<API key>( ::google::protobuf::io::CodedOutputStream* output) const { // @@<API key>(serialize_start:diplomacy.tensorflow.BytesList) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // repeated bytes value = 1; for (int i = 0, n = this->value_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteBytes( 1, this->value(i), output); } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); } // @@<API key>(serialize_end:diplomacy.tensorflow.BytesList) } ::google::protobuf::uint8* BytesList::<API key>( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused // @@<API key>(<API key>:diplomacy.tensorflow.BytesList) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // repeated bytes value = 1; for (int i = 0, n = this->value_size(); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: WriteBytesToArray(1, this->value(i), target); } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { target = ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); } // @@<API key>(<API key>:diplomacy.tensorflow.BytesList) return target; } size_t BytesList::ByteSizeLong() const { // @@<API key>(<API key>:diplomacy.tensorflow.BytesList) size_t total_size = 0; if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { total_size += ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); } // repeated bytes value = 1; total_size += 1 * ::google::protobuf::internal::FromIntSize(this->value_size()); for (int i = 0, n = this->value_size(); i < n; i++) { total_size += ::google::protobuf::internal::WireFormatLite::BytesSize( this->value(i)); } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; } void BytesList::MergeFrom(const ::google::protobuf::Message& from) { // @@<API key>(<API key>:diplomacy.tensorflow.BytesList) GOOGLE_DCHECK_NE(&from, this); const BytesList* source = ::google::protobuf::internal::<API key><const BytesList>( &from); if (source == NULL) { // @@<API key>(<API key>:diplomacy.tensorflow.BytesList) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@<API key>(<API key>:diplomacy.tensorflow.BytesList) MergeFrom(*source); } } void BytesList::MergeFrom(const BytesList& from) { // @@<API key>(<API key>:diplomacy.tensorflow.BytesList) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; value_.MergeFrom(from.value_); } void BytesList::CopyFrom(const ::google::protobuf::Message& from) { // @@<API key>(<API key>:diplomacy.tensorflow.BytesList) if (&from == this) return; Clear(); MergeFrom(from); } void BytesList::CopyFrom(const BytesList& from) { // @@<API key>(<API key>:diplomacy.tensorflow.BytesList) if (&from == this) return; Clear(); MergeFrom(from); } bool BytesList::IsInitialized() const { return true; } void BytesList::Swap(BytesList* other) { if (other == this) return; if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { InternalSwap(other); } else { BytesList* temp = New(GetArenaNoVirtual()); temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); if (GetArenaNoVirtual() == NULL) { delete temp; } } } void BytesList::UnsafeArenaSwap(BytesList* other) { if (other == this) return; GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void BytesList::InternalSwap(BytesList* other) { using std::swap; value_.InternalSwap(CastToBase(&other->value_)); _internal_metadata_.Swap(&other->_internal_metadata_); } ::google::protobuf::Metadata BytesList::GetMetadata() const { <API key>::<API key>(); return ::<API key>::file_level_metadata[<API key>]; } void FloatList::<API key>() { } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int FloatList::kValueFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 FloatList::FloatList() : ::google::protobuf::Message(), _internal_metadata_(NULL) { ::google::protobuf::internal::InitSCC( &<API key>::scc_info_FloatList.base); SharedCtor(); // @@<API key>(constructor:diplomacy.tensorflow.FloatList) } FloatList::FloatList(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena), value_(arena) { ::google::protobuf::internal::InitSCC(&<API key>::scc_info_FloatList.base); SharedCtor(); RegisterArenaDtor(arena); // @@<API key>(arena_constructor:diplomacy.tensorflow.FloatList) } FloatList::FloatList(const FloatList& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), value_(from.value_) { _internal_metadata_.MergeFrom(from._internal_metadata_); // @@<API key>(copy_constructor:diplomacy.tensorflow.FloatList) } void FloatList::SharedCtor() { } FloatList::~FloatList() { // @@<API key>(destructor:diplomacy.tensorflow.FloatList) SharedDtor(); } void FloatList::SharedDtor() { GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); } void FloatList::ArenaDtor(void* object) { FloatList* _this = reinterpret_cast< FloatList* >(object); (void)_this; } void FloatList::RegisterArenaDtor(::google::protobuf::Arena* arena) { } void FloatList::SetCachedSize(int size) const { _cached_size_.Set(size); } const ::google::protobuf::Descriptor* FloatList::descriptor() { ::<API key>::<API key>(); return ::<API key>::file_level_metadata[<API key>].descriptor; } const FloatList& FloatList::default_instance() { ::google::protobuf::internal::InitSCC(&<API key>::scc_info_FloatList.base); return *<API key>(); } void FloatList::Clear() { // @@<API key>(message_clear_start:diplomacy.tensorflow.FloatList) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; value_.Clear(); _internal_metadata_.Clear(); } bool FloatList::<API key>( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@<API key>(parse_start:diplomacy.tensorflow.FloatList) for (;;) { ::std::pair<::google::protobuf::uint32, bool> p = input-><API key>(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated float value = 1 [packed = true]; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( input, this->mutable_value()))); } else if ( static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(13u /* 13 & 0xFF */)) { DO_((::google::protobuf::internal::WireFormatLite::<API key>< float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>( 1, 10u, input, this->mutable_value()))); } else { goto handle_unusual; } break; } default: { handle_unusual: if (tag == 0) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, _internal_metadata_.<API key>())); break; } } } success: // @@<API key>(parse_success:diplomacy.tensorflow.FloatList) return true; failure: // @@<API key>(parse_failure:diplomacy.tensorflow.FloatList) return false; #undef DO_ } void FloatList::<API key>( ::google::protobuf::io::CodedOutputStream* output) const { // @@<API key>(serialize_start:diplomacy.tensorflow.FloatList) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // repeated float value = 1 [packed = true]; if (this->value_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::<API key>, output); output->WriteVarint32(static_cast< ::google::protobuf::uint32>( <API key>)); ::google::protobuf::internal::WireFormatLite::WriteFloatArray( this->value().data(), this->value_size(), output); } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); } // @@<API key>(serialize_end:diplomacy.tensorflow.FloatList) } ::google::protobuf::uint8* FloatList::<API key>( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused // @@<API key>(<API key>:diplomacy.tensorflow.FloatList) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // repeated float value = 1 [packed = true]; if (this->value_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 1, ::google::protobuf::internal::WireFormatLite::<API key>, target); target = ::google::protobuf::io::CodedOutputStream::<API key>( static_cast< ::google::protobuf::int32>( <API key>), target); target = ::google::protobuf::internal::WireFormatLite:: <API key>(this->value_, target); } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { target = ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); } // @@<API key>(<API key>:diplomacy.tensorflow.FloatList) return target; } size_t FloatList::ByteSizeLong() const { // @@<API key>(<API key>:diplomacy.tensorflow.FloatList) size_t total_size = 0; if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { total_size += ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); } // repeated float value = 1 [packed = true]; { unsigned int count = static_cast<unsigned int>(this->value_size()); size_t data_size = 4UL * count; if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( static_cast< ::google::protobuf::int32>(data_size)); } int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); <API key>(); <API key> = cached_size; <API key>(); total_size += data_size; } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; } void FloatList::MergeFrom(const ::google::protobuf::Message& from) { // @@<API key>(<API key>:diplomacy.tensorflow.FloatList) GOOGLE_DCHECK_NE(&from, this); const FloatList* source = ::google::protobuf::internal::<API key><const FloatList>( &from); if (source == NULL) { // @@<API key>(<API key>:diplomacy.tensorflow.FloatList) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@<API key>(<API key>:diplomacy.tensorflow.FloatList) MergeFrom(*source); } } void FloatList::MergeFrom(const FloatList& from) { // @@<API key>(<API key>:diplomacy.tensorflow.FloatList) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; value_.MergeFrom(from.value_); } void FloatList::CopyFrom(const ::google::protobuf::Message& from) { // @@<API key>(<API key>:diplomacy.tensorflow.FloatList) if (&from == this) return; Clear(); MergeFrom(from); } void FloatList::CopyFrom(const FloatList& from) { // @@<API key>(<API key>:diplomacy.tensorflow.FloatList) if (&from == this) return; Clear(); MergeFrom(from); } bool FloatList::IsInitialized() const { return true; } void FloatList::Swap(FloatList* other) { if (other == this) return; if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { InternalSwap(other); } else { FloatList* temp = New(GetArenaNoVirtual()); temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); if (GetArenaNoVirtual() == NULL) { delete temp; } } } void FloatList::UnsafeArenaSwap(FloatList* other) { if (other == this) return; GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void FloatList::InternalSwap(FloatList* other) { using std::swap; value_.InternalSwap(&other->value_); _internal_metadata_.Swap(&other->_internal_metadata_); } ::google::protobuf::Metadata FloatList::GetMetadata() const { <API key>::<API key>(); return ::<API key>::file_level_metadata[<API key>]; } void Int64List::<API key>() { } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Int64List::kValueFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Int64List::Int64List() : ::google::protobuf::Message(), _internal_metadata_(NULL) { ::google::protobuf::internal::InitSCC( &<API key>::scc_info_Int64List.base); SharedCtor(); // @@<API key>(constructor:diplomacy.tensorflow.Int64List) } Int64List::Int64List(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena), value_(arena) { ::google::protobuf::internal::InitSCC(&<API key>::scc_info_Int64List.base); SharedCtor(); RegisterArenaDtor(arena); // @@<API key>(arena_constructor:diplomacy.tensorflow.Int64List) } Int64List::Int64List(const Int64List& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), value_(from.value_) { _internal_metadata_.MergeFrom(from._internal_metadata_); // @@<API key>(copy_constructor:diplomacy.tensorflow.Int64List) } void Int64List::SharedCtor() { } Int64List::~Int64List() { // @@<API key>(destructor:diplomacy.tensorflow.Int64List) SharedDtor(); } void Int64List::SharedDtor() { GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); } void Int64List::ArenaDtor(void* object) { Int64List* _this = reinterpret_cast< Int64List* >(object); (void)_this; } void Int64List::RegisterArenaDtor(::google::protobuf::Arena* arena) { } void Int64List::SetCachedSize(int size) const { _cached_size_.Set(size); } const ::google::protobuf::Descriptor* Int64List::descriptor() { ::<API key>::<API key>(); return ::<API key>::file_level_metadata[<API key>].descriptor; } const Int64List& Int64List::default_instance() { ::google::protobuf::internal::InitSCC(&<API key>::scc_info_Int64List.base); return *<API key>(); } void Int64List::Clear() { // @@<API key>(message_clear_start:diplomacy.tensorflow.Int64List) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; value_.Clear(); _internal_metadata_.Clear(); } bool Int64List::<API key>( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@<API key>(parse_start:diplomacy.tensorflow.Int64List) for (;;) { ::std::pair<::google::protobuf::uint32, bool> p = input-><API key>(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated int64 value = 1 [packed = true]; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( input, this->mutable_value()))); } else if ( static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) { DO_((::google::protobuf::internal::WireFormatLite::<API key>< ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( 1, 10u, input, this->mutable_value()))); } else { goto handle_unusual; } break; } default: { handle_unusual: if (tag == 0) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, _internal_metadata_.<API key>())); break; } } } success: // @@<API key>(parse_success:diplomacy.tensorflow.Int64List) return true; failure: // @@<API key>(parse_failure:diplomacy.tensorflow.Int64List) return false; #undef DO_ } void Int64List::<API key>( ::google::protobuf::io::CodedOutputStream* output) const { // @@<API key>(serialize_start:diplomacy.tensorflow.Int64List) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // repeated int64 value = 1 [packed = true]; if (this->value_size() > 0) { ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::<API key>, output); output->WriteVarint32(static_cast< ::google::protobuf::uint32>( <API key>)); } for (int i = 0, n = this->value_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::WriteInt64NoTag( this->value(i), output); } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); } // @@<API key>(serialize_end:diplomacy.tensorflow.Int64List) } ::google::protobuf::uint8* Int64List::<API key>( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused // @@<API key>(<API key>:diplomacy.tensorflow.Int64List) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // repeated int64 value = 1 [packed = true]; if (this->value_size() > 0) { target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( 1, ::google::protobuf::internal::WireFormatLite::<API key>, target); target = ::google::protobuf::io::CodedOutputStream::<API key>( static_cast< ::google::protobuf::int32>( <API key>), target); target = ::google::protobuf::internal::WireFormatLite:: <API key>(this->value_, target); } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { target = ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); } // @@<API key>(<API key>:diplomacy.tensorflow.Int64List) return target; } size_t Int64List::ByteSizeLong() const { // @@<API key>(<API key>:diplomacy.tensorflow.Int64List) size_t total_size = 0; if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { total_size += ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); } // repeated int64 value = 1 [packed = true]; { size_t data_size = ::google::protobuf::internal::WireFormatLite:: Int64Size(this->value_); if (data_size > 0) { total_size += 1 + ::google::protobuf::internal::WireFormatLite::Int32Size( static_cast< ::google::protobuf::int32>(data_size)); } int cached_size = ::google::protobuf::internal::ToCachedSize(data_size); <API key>(); <API key> = cached_size; <API key>(); total_size += data_size; } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; } void Int64List::MergeFrom(const ::google::protobuf::Message& from) { // @@<API key>(<API key>:diplomacy.tensorflow.Int64List) GOOGLE_DCHECK_NE(&from, this); const Int64List* source = ::google::protobuf::internal::<API key><const Int64List>( &from); if (source == NULL) { // @@<API key>(<API key>:diplomacy.tensorflow.Int64List) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@<API key>(<API key>:diplomacy.tensorflow.Int64List) MergeFrom(*source); } } void Int64List::MergeFrom(const Int64List& from) { // @@<API key>(<API key>:diplomacy.tensorflow.Int64List) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; value_.MergeFrom(from.value_); } void Int64List::CopyFrom(const ::google::protobuf::Message& from) { // @@<API key>(<API key>:diplomacy.tensorflow.Int64List) if (&from == this) return; Clear(); MergeFrom(from); } void Int64List::CopyFrom(const Int64List& from) { // @@<API key>(<API key>:diplomacy.tensorflow.Int64List) if (&from == this) return; Clear(); MergeFrom(from); } bool Int64List::IsInitialized() const { return true; } void Int64List::Swap(Int64List* other) { if (other == this) return; if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { InternalSwap(other); } else { Int64List* temp = New(GetArenaNoVirtual()); temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); if (GetArenaNoVirtual() == NULL) { delete temp; } } } void Int64List::UnsafeArenaSwap(Int64List* other) { if (other == this) return; GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void Int64List::InternalSwap(Int64List* other) { using std::swap; value_.InternalSwap(&other->value_); _internal_metadata_.Swap(&other->_internal_metadata_); } ::google::protobuf::Metadata Int64List::GetMetadata() const { <API key>::<API key>(); return ::<API key>::file_level_metadata[<API key>]; } void Feature::<API key>() { ::diplomacy::tensorflow::<API key>.bytes_list_ = const_cast< ::diplomacy::tensorflow::BytesList*>( ::diplomacy::tensorflow::BytesList::<API key>()); ::diplomacy::tensorflow::<API key>.float_list_ = const_cast< ::diplomacy::tensorflow::FloatList*>( ::diplomacy::tensorflow::FloatList::<API key>()); ::diplomacy::tensorflow::<API key>.int64_list_ = const_cast< ::diplomacy::tensorflow::Int64List*>( ::diplomacy::tensorflow::Int64List::<API key>()); } void Feature::<API key>(::diplomacy::tensorflow::BytesList* bytes_list) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); clear_kind(); if (bytes_list) { ::google::protobuf::Arena* submessage_arena = ::google::protobuf::Arena::GetArena(bytes_list); if (message_arena != submessage_arena) { bytes_list = ::google::protobuf::internal::GetOwnedMessage( message_arena, bytes_list, submessage_arena); } set_has_bytes_list(); kind_.bytes_list_ = bytes_list; } // @@<API key>(field_set_allocated:diplomacy.tensorflow.Feature.bytes_list) } void Feature::<API key>(::diplomacy::tensorflow::FloatList* float_list) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); clear_kind(); if (float_list) { ::google::protobuf::Arena* submessage_arena = ::google::protobuf::Arena::GetArena(float_list); if (message_arena != submessage_arena) { float_list = ::google::protobuf::internal::GetOwnedMessage( message_arena, float_list, submessage_arena); } set_has_float_list(); kind_.float_list_ = float_list; } // @@<API key>(field_set_allocated:diplomacy.tensorflow.Feature.float_list) } void Feature::<API key>(::diplomacy::tensorflow::Int64List* int64_list) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); clear_kind(); if (int64_list) { ::google::protobuf::Arena* submessage_arena = ::google::protobuf::Arena::GetArena(int64_list); if (message_arena != submessage_arena) { int64_list = ::google::protobuf::internal::GetOwnedMessage( message_arena, int64_list, submessage_arena); } set_has_int64_list(); kind_.int64_list_ = int64_list; } // @@<API key>(field_set_allocated:diplomacy.tensorflow.Feature.int64_list) } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Feature::<API key>; const int Feature::<API key>; const int Feature::<API key>; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Feature::Feature() : ::google::protobuf::Message(), _internal_metadata_(NULL) { ::google::protobuf::internal::InitSCC( &<API key>::scc_info_Feature.base); SharedCtor(); // @@<API key>(constructor:diplomacy.tensorflow.Feature) } Feature::Feature(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena) { ::google::protobuf::internal::InitSCC(&<API key>::scc_info_Feature.base); SharedCtor(); RegisterArenaDtor(arena); // @@<API key>(arena_constructor:diplomacy.tensorflow.Feature) } Feature::Feature(const Feature& from) : ::google::protobuf::Message(), _internal_metadata_(NULL) { _internal_metadata_.MergeFrom(from._internal_metadata_); clear_has_kind(); switch (from.kind_case()) { case kBytesList: { mutable_bytes_list()->::diplomacy::tensorflow::BytesList::MergeFrom(from.bytes_list()); break; } case kFloatList: { mutable_float_list()->::diplomacy::tensorflow::FloatList::MergeFrom(from.float_list()); break; } case kInt64List: { mutable_int64_list()->::diplomacy::tensorflow::Int64List::MergeFrom(from.int64_list()); break; } case KIND_NOT_SET: { break; } } // @@<API key>(copy_constructor:diplomacy.tensorflow.Feature) } void Feature::SharedCtor() { clear_has_kind(); } Feature::~Feature() { // @@<API key>(destructor:diplomacy.tensorflow.Feature) SharedDtor(); } void Feature::SharedDtor() { GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); if (has_kind()) { clear_kind(); } } void Feature::ArenaDtor(void* object) { Feature* _this = reinterpret_cast< Feature* >(object); (void)_this; } void Feature::RegisterArenaDtor(::google::protobuf::Arena* arena) { } void Feature::SetCachedSize(int size) const { _cached_size_.Set(size); } const ::google::protobuf::Descriptor* Feature::descriptor() { ::<API key>::<API key>(); return ::<API key>::file_level_metadata[<API key>].descriptor; } const Feature& Feature::default_instance() { ::google::protobuf::internal::InitSCC(&<API key>::scc_info_Feature.base); return *<API key>(); } void Feature::clear_kind() { // @@<API key>(one_of_clear_start:diplomacy.tensorflow.Feature) switch (kind_case()) { case kBytesList: { if (GetArenaNoVirtual() == NULL) { delete kind_.bytes_list_; } break; } case kFloatList: { if (GetArenaNoVirtual() == NULL) { delete kind_.float_list_; } break; } case kInt64List: { if (GetArenaNoVirtual() == NULL) { delete kind_.int64_list_; } break; } case KIND_NOT_SET: { break; } } _oneof_case_[0] = KIND_NOT_SET; } void Feature::Clear() { // @@<API key>(message_clear_start:diplomacy.tensorflow.Feature) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; clear_kind(); _internal_metadata_.Clear(); } bool Feature::<API key>( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@<API key>(parse_start:diplomacy.tensorflow.Feature) for (;;) { ::std::pair<::google::protobuf::uint32, bool> p = input-><API key>(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // .diplomacy.tensorflow.BytesList bytes_list = 1; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, mutable_bytes_list())); } else { goto handle_unusual; } break; } // .diplomacy.tensorflow.FloatList float_list = 2; case 2: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, mutable_float_list())); } else { goto handle_unusual; } break; } // .diplomacy.tensorflow.Int64List int64_list = 3; case 3: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(26u /* 26 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, mutable_int64_list())); } else { goto handle_unusual; } break; } default: { handle_unusual: if (tag == 0) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, _internal_metadata_.<API key>())); break; } } } success: // @@<API key>(parse_success:diplomacy.tensorflow.Feature) return true; failure: // @@<API key>(parse_failure:diplomacy.tensorflow.Feature) return false; #undef DO_ } void Feature::<API key>( ::google::protobuf::io::CodedOutputStream* output) const { // @@<API key>(serialize_start:diplomacy.tensorflow.Feature) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // .diplomacy.tensorflow.BytesList bytes_list = 1; if (has_bytes_list()) { ::google::protobuf::internal::WireFormatLite::<API key>( 1, this-><API key>(), output); } // .diplomacy.tensorflow.FloatList float_list = 2; if (has_float_list()) { ::google::protobuf::internal::WireFormatLite::<API key>( 2, this-><API key>(), output); } // .diplomacy.tensorflow.Int64List int64_list = 3; if (has_int64_list()) { ::google::protobuf::internal::WireFormatLite::<API key>( 3, this-><API key>(), output); } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); } // @@<API key>(serialize_end:diplomacy.tensorflow.Feature) } ::google::protobuf::uint8* Feature::<API key>( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused // @@<API key>(<API key>:diplomacy.tensorflow.Feature) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // .diplomacy.tensorflow.BytesList bytes_list = 1; if (has_bytes_list()) { target = ::google::protobuf::internal::WireFormatLite:: <API key>( 1, this-><API key>(), deterministic, target); } // .diplomacy.tensorflow.FloatList float_list = 2; if (has_float_list()) { target = ::google::protobuf::internal::WireFormatLite:: <API key>( 2, this-><API key>(), deterministic, target); } // .diplomacy.tensorflow.Int64List int64_list = 3; if (has_int64_list()) { target = ::google::protobuf::internal::WireFormatLite:: <API key>( 3, this-><API key>(), deterministic, target); } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { target = ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); } // @@<API key>(<API key>:diplomacy.tensorflow.Feature) return target; } size_t Feature::ByteSizeLong() const { // @@<API key>(<API key>:diplomacy.tensorflow.Feature) size_t total_size = 0; if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { total_size += ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); } switch (kind_case()) { // .diplomacy.tensorflow.BytesList bytes_list = 1; case kBytesList: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *kind_.bytes_list_); break; } // .diplomacy.tensorflow.FloatList float_list = 2; case kFloatList: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *kind_.float_list_); break; } // .diplomacy.tensorflow.Int64List int64_list = 3; case kInt64List: { total_size += 1 + ::google::protobuf::internal::WireFormatLite::MessageSize( *kind_.int64_list_); break; } case KIND_NOT_SET: { break; } } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; } void Feature::MergeFrom(const ::google::protobuf::Message& from) { // @@<API key>(<API key>:diplomacy.tensorflow.Feature) GOOGLE_DCHECK_NE(&from, this); const Feature* source = ::google::protobuf::internal::<API key><const Feature>( &from); if (source == NULL) { // @@<API key>(<API key>:diplomacy.tensorflow.Feature) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@<API key>(<API key>:diplomacy.tensorflow.Feature) MergeFrom(*source); } } void Feature::MergeFrom(const Feature& from) { // @@<API key>(<API key>:diplomacy.tensorflow.Feature) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; switch (from.kind_case()) { case kBytesList: { mutable_bytes_list()->::diplomacy::tensorflow::BytesList::MergeFrom(from.bytes_list()); break; } case kFloatList: { mutable_float_list()->::diplomacy::tensorflow::FloatList::MergeFrom(from.float_list()); break; } case kInt64List: { mutable_int64_list()->::diplomacy::tensorflow::Int64List::MergeFrom(from.int64_list()); break; } case KIND_NOT_SET: { break; } } } void Feature::CopyFrom(const ::google::protobuf::Message& from) { // @@<API key>(<API key>:diplomacy.tensorflow.Feature) if (&from == this) return; Clear(); MergeFrom(from); } void Feature::CopyFrom(const Feature& from) { // @@<API key>(<API key>:diplomacy.tensorflow.Feature) if (&from == this) return; Clear(); MergeFrom(from); } bool Feature::IsInitialized() const { return true; } void Feature::Swap(Feature* other) { if (other == this) return; if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { InternalSwap(other); } else { Feature* temp = New(GetArenaNoVirtual()); temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); if (GetArenaNoVirtual() == NULL) { delete temp; } } } void Feature::UnsafeArenaSwap(Feature* other) { if (other == this) return; GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void Feature::InternalSwap(Feature* other) { using std::swap; swap(kind_, other->kind_); swap(_oneof_case_[0], other->_oneof_case_[0]); _internal_metadata_.Swap(&other->_internal_metadata_); } ::google::protobuf::Metadata Feature::GetMetadata() const { <API key>::<API key>(); return ::<API key>::file_level_metadata[<API key>]; } <API key>::<API key>() {} <API key>::<API key>(::google::protobuf::Arena* arena) : SuperType(arena) {} void <API key>::MergeFrom(const <API key>& other) { MergeFromInternal(other); } ::google::protobuf::Metadata <API key>::GetMetadata() const { ::<API key>::<API key>(); return ::<API key>::file_level_metadata[4]; } void <API key>::MergeFrom( const ::google::protobuf::Message& other) { ::google::protobuf::Message::MergeFrom(other); } void Features::<API key>() { } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Features::kFeatureFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Features::Features() : ::google::protobuf::Message(), _internal_metadata_(NULL) { ::google::protobuf::internal::InitSCC( &<API key>::scc_info_Features.base); SharedCtor(); // @@<API key>(constructor:diplomacy.tensorflow.Features) } Features::Features(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena), feature_(arena) { ::google::protobuf::internal::InitSCC(&<API key>::scc_info_Features.base); SharedCtor(); RegisterArenaDtor(arena); // @@<API key>(arena_constructor:diplomacy.tensorflow.Features) } Features::Features(const Features& from) : ::google::protobuf::Message(), _internal_metadata_(NULL) { _internal_metadata_.MergeFrom(from._internal_metadata_); feature_.MergeFrom(from.feature_); // @@<API key>(copy_constructor:diplomacy.tensorflow.Features) } void Features::SharedCtor() { } Features::~Features() { // @@<API key>(destructor:diplomacy.tensorflow.Features) SharedDtor(); } void Features::SharedDtor() { GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); } void Features::ArenaDtor(void* object) { Features* _this = reinterpret_cast< Features* >(object); (void)_this; } void Features::RegisterArenaDtor(::google::protobuf::Arena* arena) { } void Features::SetCachedSize(int size) const { _cached_size_.Set(size); } const ::google::protobuf::Descriptor* Features::descriptor() { ::<API key>::<API key>(); return ::<API key>::file_level_metadata[<API key>].descriptor; } const Features& Features::default_instance() { ::google::protobuf::internal::InitSCC(&<API key>::scc_info_Features.base); return *<API key>(); } void Features::Clear() { // @@<API key>(message_clear_start:diplomacy.tensorflow.Features) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; feature_.Clear(); _internal_metadata_.Clear(); } bool Features::<API key>( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@<API key>(parse_start:diplomacy.tensorflow.Features) for (;;) { ::std::pair<::google::protobuf::uint32, bool> p = input-><API key>(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // map<string, .diplomacy.tensorflow.Feature> feature = 1; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { <API key>::Parser< ::google::protobuf::internal::MapField< <API key>, ::std::string, ::diplomacy::tensorflow::Feature, ::google::protobuf::internal::WireFormatLite::TYPE_STRING, ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, 0 >, ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature > > parser(&feature_); DO_(::google::protobuf::internal::WireFormatLite::<API key>( input, &parser)); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( parser.key().data(), static_cast<int>(parser.key().length()), ::google::protobuf::internal::WireFormatLite::PARSE, "diplomacy.tensorflow.Features.FeatureEntry.key")); } else { goto handle_unusual; } break; } default: { handle_unusual: if (tag == 0) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, _internal_metadata_.<API key>())); break; } } } success: // @@<API key>(parse_success:diplomacy.tensorflow.Features) return true; failure: // @@<API key>(parse_failure:diplomacy.tensorflow.Features) return false; #undef DO_ } void Features::<API key>( ::google::protobuf::io::CodedOutputStream* output) const { // @@<API key>(serialize_start:diplomacy.tensorflow.Features) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // map<string, .diplomacy.tensorflow.Feature> feature = 1; if (!this->feature().empty()) { typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::const_pointer ConstPtr; typedef ConstPtr SortItem; typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less; struct Utf8Check { static void Check(ConstPtr p) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( p->first.data(), static_cast<int>(p->first.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "diplomacy.tensorflow.Features.FeatureEntry.key"); } }; if (output-><API key>() && this->feature().size() > 1) { ::std::unique_ptr<SortItem[]> items( new SortItem[this->feature().size()]); typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::size_type size_type; size_type n = 0; for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::const_iterator it = this->feature().begin(); it != this->feature().end(); ++it, ++n) { items[static_cast<ptrdiff_t>(n)] = SortItem(&*it); } ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less()); ::std::unique_ptr<<API key>> entry; for (size_type i = 0; i < n; i++) { entry.reset(feature_.NewEntryWrapper( items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second)); ::google::protobuf::internal::WireFormatLite::<API key>( 1, *entry, output); if (entry->GetArena() != NULL) { entry.release(); } Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]); } } else { ::std::unique_ptr<<API key>> entry; for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::const_iterator it = this->feature().begin(); it != this->feature().end(); ++it) { entry.reset(feature_.NewEntryWrapper( it->first, it->second)); ::google::protobuf::internal::WireFormatLite::<API key>( 1, *entry, output); if (entry->GetArena() != NULL) { entry.release(); } Utf8Check::Check(&*it); } } } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); } // @@<API key>(serialize_end:diplomacy.tensorflow.Features) } ::google::protobuf::uint8* Features::<API key>( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused // @@<API key>(<API key>:diplomacy.tensorflow.Features) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // map<string, .diplomacy.tensorflow.Feature> feature = 1; if (!this->feature().empty()) { typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::const_pointer ConstPtr; typedef ConstPtr SortItem; typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less; struct Utf8Check { static void Check(ConstPtr p) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( p->first.data(), static_cast<int>(p->first.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "diplomacy.tensorflow.Features.FeatureEntry.key"); } }; if (deterministic && this->feature().size() > 1) { ::std::unique_ptr<SortItem[]> items( new SortItem[this->feature().size()]); typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::size_type size_type; size_type n = 0; for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::const_iterator it = this->feature().begin(); it != this->feature().end(); ++it, ++n) { items[static_cast<ptrdiff_t>(n)] = SortItem(&*it); } ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less()); ::std::unique_ptr<<API key>> entry; for (size_type i = 0; i < n; i++) { entry.reset(feature_.NewEntryWrapper( items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second)); target = ::google::protobuf::internal::WireFormatLite:: <API key>( 1, *entry, deterministic, target); ; if (entry->GetArena() != NULL) { entry.release(); } Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]); } } else { ::std::unique_ptr<<API key>> entry; for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::const_iterator it = this->feature().begin(); it != this->feature().end(); ++it) { entry.reset(feature_.NewEntryWrapper( it->first, it->second)); target = ::google::protobuf::internal::WireFormatLite:: <API key>( 1, *entry, deterministic, target); ; if (entry->GetArena() != NULL) { entry.release(); } Utf8Check::Check(&*it); } } } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { target = ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); } // @@<API key>(<API key>:diplomacy.tensorflow.Features) return target; } size_t Features::ByteSizeLong() const { // @@<API key>(<API key>:diplomacy.tensorflow.Features) size_t total_size = 0; if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { total_size += ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); } // map<string, .diplomacy.tensorflow.Feature> feature = 1; total_size += 1 * ::google::protobuf::internal::FromIntSize(this->feature_size()); { ::std::unique_ptr<<API key>> entry; for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::Feature >::const_iterator it = this->feature().begin(); it != this->feature().end(); ++it) { if (entry.get() != NULL && entry->GetArena() != NULL) { entry.release(); } entry.reset(feature_.NewEntryWrapper(it->first, it->second)); total_size += ::google::protobuf::internal::WireFormatLite:: <API key>(*entry); } if (entry.get() != NULL && entry->GetArena() != NULL) { entry.release(); } } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; } void Features::MergeFrom(const ::google::protobuf::Message& from) { // @@<API key>(<API key>:diplomacy.tensorflow.Features) GOOGLE_DCHECK_NE(&from, this); const Features* source = ::google::protobuf::internal::<API key><const Features>( &from); if (source == NULL) { // @@<API key>(<API key>:diplomacy.tensorflow.Features) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@<API key>(<API key>:diplomacy.tensorflow.Features) MergeFrom(*source); } } void Features::MergeFrom(const Features& from) { // @@<API key>(<API key>:diplomacy.tensorflow.Features) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; feature_.MergeFrom(from.feature_); } void Features::CopyFrom(const ::google::protobuf::Message& from) { // @@<API key>(<API key>:diplomacy.tensorflow.Features) if (&from == this) return; Clear(); MergeFrom(from); } void Features::CopyFrom(const Features& from) { // @@<API key>(<API key>:diplomacy.tensorflow.Features) if (&from == this) return; Clear(); MergeFrom(from); } bool Features::IsInitialized() const { return true; } void Features::Swap(Features* other) { if (other == this) return; if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { InternalSwap(other); } else { Features* temp = New(GetArenaNoVirtual()); temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); if (GetArenaNoVirtual() == NULL) { delete temp; } } } void Features::UnsafeArenaSwap(Features* other) { if (other == this) return; GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void Features::InternalSwap(Features* other) { using std::swap; feature_.Swap(&other->feature_); _internal_metadata_.Swap(&other->_internal_metadata_); } ::google::protobuf::Metadata Features::GetMetadata() const { <API key>::<API key>(); return ::<API key>::file_level_metadata[<API key>]; } void FeatureList::<API key>() { } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int FeatureList::kFeatureFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 FeatureList::FeatureList() : ::google::protobuf::Message(), _internal_metadata_(NULL) { ::google::protobuf::internal::InitSCC( &<API key>::<API key>.base); SharedCtor(); // @@<API key>(constructor:diplomacy.tensorflow.FeatureList) } FeatureList::FeatureList(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena), feature_(arena) { ::google::protobuf::internal::InitSCC(&<API key>::<API key>.base); SharedCtor(); RegisterArenaDtor(arena); // @@<API key>(arena_constructor:diplomacy.tensorflow.FeatureList) } FeatureList::FeatureList(const FeatureList& from) : ::google::protobuf::Message(), _internal_metadata_(NULL), feature_(from.feature_) { _internal_metadata_.MergeFrom(from._internal_metadata_); // @@<API key>(copy_constructor:diplomacy.tensorflow.FeatureList) } void FeatureList::SharedCtor() { } FeatureList::~FeatureList() { // @@<API key>(destructor:diplomacy.tensorflow.FeatureList) SharedDtor(); } void FeatureList::SharedDtor() { GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); } void FeatureList::ArenaDtor(void* object) { FeatureList* _this = reinterpret_cast< FeatureList* >(object); (void)_this; } void FeatureList::RegisterArenaDtor(::google::protobuf::Arena* arena) { } void FeatureList::SetCachedSize(int size) const { _cached_size_.Set(size); } const ::google::protobuf::Descriptor* FeatureList::descriptor() { ::<API key>::<API key>(); return ::<API key>::file_level_metadata[<API key>].descriptor; } const FeatureList& FeatureList::default_instance() { ::google::protobuf::internal::InitSCC(&<API key>::<API key>.base); return *<API key>(); } void FeatureList::Clear() { // @@<API key>(message_clear_start:diplomacy.tensorflow.FeatureList) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; feature_.Clear(); _internal_metadata_.Clear(); } bool FeatureList::<API key>( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@<API key>(parse_start:diplomacy.tensorflow.FeatureList) for (;;) { ::std::pair<::google::protobuf::uint32, bool> p = input-><API key>(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .diplomacy.tensorflow.Feature feature = 1; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { DO_(::google::protobuf::internal::WireFormatLite::ReadMessage( input, add_feature())); } else { goto handle_unusual; } break; } default: { handle_unusual: if (tag == 0) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, _internal_metadata_.<API key>())); break; } } } success: // @@<API key>(parse_success:diplomacy.tensorflow.FeatureList) return true; failure: // @@<API key>(parse_failure:diplomacy.tensorflow.FeatureList) return false; #undef DO_ } void FeatureList::<API key>( ::google::protobuf::io::CodedOutputStream* output) const { // @@<API key>(serialize_start:diplomacy.tensorflow.FeatureList) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // repeated .diplomacy.tensorflow.Feature feature = 1; for (unsigned int i = 0, n = static_cast<unsigned int>(this->feature_size()); i < n; i++) { ::google::protobuf::internal::WireFormatLite::<API key>( 1, this->feature(static_cast<int>(i)), output); } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); } // @@<API key>(serialize_end:diplomacy.tensorflow.FeatureList) } ::google::protobuf::uint8* FeatureList::<API key>( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused // @@<API key>(<API key>:diplomacy.tensorflow.FeatureList) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // repeated .diplomacy.tensorflow.Feature feature = 1; for (unsigned int i = 0, n = static_cast<unsigned int>(this->feature_size()); i < n; i++) { target = ::google::protobuf::internal::WireFormatLite:: <API key>( 1, this->feature(static_cast<int>(i)), deterministic, target); } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { target = ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); } // @@<API key>(<API key>:diplomacy.tensorflow.FeatureList) return target; } size_t FeatureList::ByteSizeLong() const { // @@<API key>(<API key>:diplomacy.tensorflow.FeatureList) size_t total_size = 0; if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { total_size += ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); } // repeated .diplomacy.tensorflow.Feature feature = 1; { unsigned int count = static_cast<unsigned int>(this->feature_size()); total_size += 1UL * count; for (unsigned int i = 0; i < count; i++) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSize( this->feature(static_cast<int>(i))); } } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; } void FeatureList::MergeFrom(const ::google::protobuf::Message& from) { // @@<API key>(<API key>:diplomacy.tensorflow.FeatureList) GOOGLE_DCHECK_NE(&from, this); const FeatureList* source = ::google::protobuf::internal::<API key><const FeatureList>( &from); if (source == NULL) { // @@<API key>(<API key>:diplomacy.tensorflow.FeatureList) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@<API key>(<API key>:diplomacy.tensorflow.FeatureList) MergeFrom(*source); } } void FeatureList::MergeFrom(const FeatureList& from) { // @@<API key>(<API key>:diplomacy.tensorflow.FeatureList) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; feature_.MergeFrom(from.feature_); } void FeatureList::CopyFrom(const ::google::protobuf::Message& from) { // @@<API key>(<API key>:diplomacy.tensorflow.FeatureList) if (&from == this) return; Clear(); MergeFrom(from); } void FeatureList::CopyFrom(const FeatureList& from) { // @@<API key>(<API key>:diplomacy.tensorflow.FeatureList) if (&from == this) return; Clear(); MergeFrom(from); } bool FeatureList::IsInitialized() const { return true; } void FeatureList::Swap(FeatureList* other) { if (other == this) return; if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { InternalSwap(other); } else { FeatureList* temp = New(GetArenaNoVirtual()); temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); if (GetArenaNoVirtual() == NULL) { delete temp; } } } void FeatureList::UnsafeArenaSwap(FeatureList* other) { if (other == this) return; GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void FeatureList::InternalSwap(FeatureList* other) { using std::swap; CastToBase(&feature_)->InternalSwap(CastToBase(&other->feature_)); _internal_metadata_.Swap(&other->_internal_metadata_); } ::google::protobuf::Metadata FeatureList::GetMetadata() const { <API key>::<API key>(); return ::<API key>::file_level_metadata[<API key>]; } <API key>::<API key>() {} <API key>::<API key>(::google::protobuf::Arena* arena) : SuperType(arena) {} void <API key>::MergeFrom(const <API key>& other) { MergeFromInternal(other); } ::google::protobuf::Metadata <API key>::GetMetadata() const { ::<API key>::<API key>(); return ::<API key>::file_level_metadata[7]; } void <API key>::MergeFrom( const ::google::protobuf::Message& other) { ::google::protobuf::Message::MergeFrom(other); } void FeatureLists::<API key>() { } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int FeatureLists::<API key>; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 FeatureLists::FeatureLists() : ::google::protobuf::Message(), _internal_metadata_(NULL) { ::google::protobuf::internal::InitSCC( &<API key>::<API key>.base); SharedCtor(); // @@<API key>(constructor:diplomacy.tensorflow.FeatureLists) } FeatureLists::FeatureLists(::google::protobuf::Arena* arena) : ::google::protobuf::Message(), _internal_metadata_(arena), feature_list_(arena) { ::google::protobuf::internal::InitSCC(&<API key>::<API key>.base); SharedCtor(); RegisterArenaDtor(arena); // @@<API key>(arena_constructor:diplomacy.tensorflow.FeatureLists) } FeatureLists::FeatureLists(const FeatureLists& from) : ::google::protobuf::Message(), _internal_metadata_(NULL) { _internal_metadata_.MergeFrom(from._internal_metadata_); feature_list_.MergeFrom(from.feature_list_); // @@<API key>(copy_constructor:diplomacy.tensorflow.FeatureLists) } void FeatureLists::SharedCtor() { } FeatureLists::~FeatureLists() { // @@<API key>(destructor:diplomacy.tensorflow.FeatureLists) SharedDtor(); } void FeatureLists::SharedDtor() { GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); } void FeatureLists::ArenaDtor(void* object) { FeatureLists* _this = reinterpret_cast< FeatureLists* >(object); (void)_this; } void FeatureLists::RegisterArenaDtor(::google::protobuf::Arena* arena) { } void FeatureLists::SetCachedSize(int size) const { _cached_size_.Set(size); } const ::google::protobuf::Descriptor* FeatureLists::descriptor() { ::<API key>::<API key>(); return ::<API key>::file_level_metadata[<API key>].descriptor; } const FeatureLists& FeatureLists::default_instance() { ::google::protobuf::internal::InitSCC(&<API key>::<API key>.base); return *<API key>(); } void FeatureLists::Clear() { // @@<API key>(message_clear_start:diplomacy.tensorflow.FeatureLists) ::google::protobuf::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; feature_list_.Clear(); _internal_metadata_.Clear(); } bool FeatureLists::<API key>( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@<API key>(parse_start:diplomacy.tensorflow.FeatureLists) for (;;) { ::std::pair<::google::protobuf::uint32, bool> p = input-><API key>(127u); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // map<string, .diplomacy.tensorflow.FeatureList> feature_list = 1; case 1: { if (static_cast< ::google::protobuf::uint8>(tag) == static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) { <API key>::Parser< ::google::protobuf::internal::MapField< <API key>, ::std::string, ::diplomacy::tensorflow::FeatureList, ::google::protobuf::internal::WireFormatLite::TYPE_STRING, ::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE, 0 >, ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList > > parser(&feature_list_); DO_(::google::protobuf::internal::WireFormatLite::<API key>( input, &parser)); DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String( parser.key().data(), static_cast<int>(parser.key().length()), ::google::protobuf::internal::WireFormatLite::PARSE, "diplomacy.tensorflow.FeatureLists.FeatureListEntry.key")); } else { goto handle_unusual; } break; } default: { handle_unusual: if (tag == 0) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, _internal_metadata_.<API key>())); break; } } } success: // @@<API key>(parse_success:diplomacy.tensorflow.FeatureLists) return true; failure: // @@<API key>(parse_failure:diplomacy.tensorflow.FeatureLists) return false; #undef DO_ } void FeatureLists::<API key>( ::google::protobuf::io::CodedOutputStream* output) const { // @@<API key>(serialize_start:diplomacy.tensorflow.FeatureLists) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // map<string, .diplomacy.tensorflow.FeatureList> feature_list = 1; if (!this->feature_list().empty()) { typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::const_pointer ConstPtr; typedef ConstPtr SortItem; typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less; struct Utf8Check { static void Check(ConstPtr p) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( p->first.data(), static_cast<int>(p->first.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "diplomacy.tensorflow.FeatureLists.FeatureListEntry.key"); } }; if (output-><API key>() && this->feature_list().size() > 1) { ::std::unique_ptr<SortItem[]> items( new SortItem[this->feature_list().size()]); typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::size_type size_type; size_type n = 0; for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::const_iterator it = this->feature_list().begin(); it != this->feature_list().end(); ++it, ++n) { items[static_cast<ptrdiff_t>(n)] = SortItem(&*it); } ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less()); ::std::unique_ptr<<API key>> entry; for (size_type i = 0; i < n; i++) { entry.reset(feature_list_.NewEntryWrapper( items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second)); ::google::protobuf::internal::WireFormatLite::<API key>( 1, *entry, output); if (entry->GetArena() != NULL) { entry.release(); } Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]); } } else { ::std::unique_ptr<<API key>> entry; for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::const_iterator it = this->feature_list().begin(); it != this->feature_list().end(); ++it) { entry.reset(feature_list_.NewEntryWrapper( it->first, it->second)); ::google::protobuf::internal::WireFormatLite::<API key>( 1, *entry, output); if (entry->GetArena() != NULL) { entry.release(); } Utf8Check::Check(&*it); } } } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output); } // @@<API key>(serialize_end:diplomacy.tensorflow.FeatureLists) } ::google::protobuf::uint8* FeatureLists::<API key>( bool deterministic, ::google::protobuf::uint8* target) const { (void)deterministic; // Unused // @@<API key>(<API key>:diplomacy.tensorflow.FeatureLists) ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; // map<string, .diplomacy.tensorflow.FeatureList> feature_list = 1; if (!this->feature_list().empty()) { typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::const_pointer ConstPtr; typedef ConstPtr SortItem; typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less; struct Utf8Check { static void Check(ConstPtr p) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( p->first.data(), static_cast<int>(p->first.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "diplomacy.tensorflow.FeatureLists.FeatureListEntry.key"); } }; if (deterministic && this->feature_list().size() > 1) { ::std::unique_ptr<SortItem[]> items( new SortItem[this->feature_list().size()]); typedef ::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::size_type size_type; size_type n = 0; for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::const_iterator it = this->feature_list().begin(); it != this->feature_list().end(); ++it, ++n) { items[static_cast<ptrdiff_t>(n)] = SortItem(&*it); } ::std::sort(&items[0], &items[static_cast<ptrdiff_t>(n)], Less()); ::std::unique_ptr<<API key>> entry; for (size_type i = 0; i < n; i++) { entry.reset(feature_list_.NewEntryWrapper( items[static_cast<ptrdiff_t>(i)]->first, items[static_cast<ptrdiff_t>(i)]->second)); target = ::google::protobuf::internal::WireFormatLite:: <API key>( 1, *entry, deterministic, target); ; if (entry->GetArena() != NULL) { entry.release(); } Utf8Check::Check(items[static_cast<ptrdiff_t>(i)]); } } else { ::std::unique_ptr<<API key>> entry; for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::const_iterator it = this->feature_list().begin(); it != this->feature_list().end(); ++it) { entry.reset(feature_list_.NewEntryWrapper( it->first, it->second)); target = ::google::protobuf::internal::WireFormatLite:: <API key>( 1, *entry, deterministic, target); ; if (entry->GetArena() != NULL) { entry.release(); } Utf8Check::Check(&*it); } } } if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { target = ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target); } // @@<API key>(<API key>:diplomacy.tensorflow.FeatureLists) return target; } size_t FeatureLists::ByteSizeLong() const { // @@<API key>(<API key>:diplomacy.tensorflow.FeatureLists) size_t total_size = 0; if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::<API key>())) { total_size += ::google::protobuf::internal::WireFormat::<API key>( (::google::protobuf::internal::<API key>() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance())); } // map<string, .diplomacy.tensorflow.FeatureList> feature_list = 1; total_size += 1 * ::google::protobuf::internal::FromIntSize(this->feature_list_size()); { ::std::unique_ptr<<API key>> entry; for (::google::protobuf::Map< ::std::string, ::diplomacy::tensorflow::FeatureList >::const_iterator it = this->feature_list().begin(); it != this->feature_list().end(); ++it) { if (entry.get() != NULL && entry->GetArena() != NULL) { entry.release(); } entry.reset(feature_list_.NewEntryWrapper(it->first, it->second)); total_size += ::google::protobuf::internal::WireFormatLite:: <API key>(*entry); } if (entry.get() != NULL && entry->GetArena() != NULL) { entry.release(); } } int cached_size = ::google::protobuf::internal::ToCachedSize(total_size); SetCachedSize(cached_size); return total_size; } void FeatureLists::MergeFrom(const ::google::protobuf::Message& from) { // @@<API key>(<API key>:diplomacy.tensorflow.FeatureLists) GOOGLE_DCHECK_NE(&from, this); const FeatureLists* source = ::google::protobuf::internal::<API key><const FeatureLists>( &from); if (source == NULL) { // @@<API key>(<API key>:diplomacy.tensorflow.FeatureLists) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { // @@<API key>(<API key>:diplomacy.tensorflow.FeatureLists) MergeFrom(*source); } } void FeatureLists::MergeFrom(const FeatureLists& from) { // @@<API key>(<API key>:diplomacy.tensorflow.FeatureLists) GOOGLE_DCHECK_NE(&from, this); _internal_metadata_.MergeFrom(from._internal_metadata_); ::google::protobuf::uint32 cached_has_bits = 0; (void) cached_has_bits; feature_list_.MergeFrom(from.feature_list_); } void FeatureLists::CopyFrom(const ::google::protobuf::Message& from) { // @@<API key>(<API key>:diplomacy.tensorflow.FeatureLists) if (&from == this) return; Clear(); MergeFrom(from); } void FeatureLists::CopyFrom(const FeatureLists& from) { // @@<API key>(<API key>:diplomacy.tensorflow.FeatureLists) if (&from == this) return; Clear(); MergeFrom(from); } bool FeatureLists::IsInitialized() const { return true; } void FeatureLists::Swap(FeatureLists* other) { if (other == this) return; if (GetArenaNoVirtual() == other->GetArenaNoVirtual()) { InternalSwap(other); } else { FeatureLists* temp = New(GetArenaNoVirtual()); temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); if (GetArenaNoVirtual() == NULL) { delete temp; } } } void FeatureLists::UnsafeArenaSwap(FeatureLists* other) { if (other == this) return; GOOGLE_DCHECK(GetArenaNoVirtual() == other->GetArenaNoVirtual()); InternalSwap(other); } void FeatureLists::InternalSwap(FeatureLists* other) { using std::swap; feature_list_.Swap(&other->feature_list_); _internal_metadata_.Swap(&other->_internal_metadata_); } ::google::protobuf::Metadata FeatureLists::GetMetadata() const { <API key>::<API key>(); return ::<API key>::file_level_metadata[<API key>]; } // @@<API key>(namespace_scope) } // namespace tensorflow } // namespace diplomacy namespace google { namespace protobuf { template<> <API key> ::diplomacy::tensorflow::BytesList* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::BytesList >(Arena* arena) { return Arena::<API key>< ::diplomacy::tensorflow::BytesList >(arena); } template<> <API key> ::diplomacy::tensorflow::FloatList* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::FloatList >(Arena* arena) { return Arena::<API key>< ::diplomacy::tensorflow::FloatList >(arena); } template<> <API key> ::diplomacy::tensorflow::Int64List* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::Int64List >(Arena* arena) { return Arena::<API key>< ::diplomacy::tensorflow::Int64List >(arena); } template<> <API key> ::diplomacy::tensorflow::Feature* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::Feature >(Arena* arena) { return Arena::<API key>< ::diplomacy::tensorflow::Feature >(arena); } template<> <API key> ::diplomacy::tensorflow::<API key>* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::<API key> >(Arena* arena) { return Arena::<API key>< ::diplomacy::tensorflow::<API key> >(arena); } template<> <API key> ::diplomacy::tensorflow::Features* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::Features >(Arena* arena) { return Arena::<API key>< ::diplomacy::tensorflow::Features >(arena); } template<> <API key> ::diplomacy::tensorflow::FeatureList* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::FeatureList >(Arena* arena) { return Arena::<API key>< ::diplomacy::tensorflow::FeatureList >(arena); } template<> <API key> ::diplomacy::tensorflow::<API key>* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::<API key> >(Arena* arena) { return Arena::<API key>< ::diplomacy::tensorflow::<API key> >(arena); } template<> <API key> ::diplomacy::tensorflow::FeatureLists* Arena::CreateMaybeMessage< ::diplomacy::tensorflow::FeatureLists >(Arena* arena) { return Arena::<API key>< ::diplomacy::tensorflow::FeatureLists >(arena); } } // namespace protobuf } // namespace google // @@<API key>(global_scope)
require 'spec_helper' require 'gitnesse/cli' module Gitnesse describe Cli, type: :cli do let(:help) do <<-EOS USAGE: gitnesse push Pushes local features to remote git-based wiki Pushes the local features files to the remote git-based wiki, creating/updating wiki pages as necessary. Examples: gitnesse push # will push local features to remote wiki EOS end it "has help info" do expect(gitnesse("help push")).to eq help end end end
// This file is auto-generated. Please don't modify it! package org.opencv.objdetect; import org.opencv.core.Mat; import org.opencv.core.MatOfDouble; import org.opencv.core.MatOfInt; import org.opencv.core.MatOfRect; import org.opencv.core.Size; // C++: class CascadeClassifier //javadoc: CascadeClassifier public class CascadeClassifier { protected final long nativeObj; protected CascadeClassifier(long addr) { nativeObj = addr; } // C++: CascadeClassifier() //javadoc: CascadeClassifier::CascadeClassifier() public CascadeClassifier() { nativeObj = CascadeClassifier_0(); return; } // C++: CascadeClassifier(String filename) //javadoc: CascadeClassifier::CascadeClassifier(filename) public CascadeClassifier(String filename) { nativeObj = CascadeClassifier_1(filename); return; } // C++: bool load(String filename) //javadoc: CascadeClassifier::convert(oldcascade, newcascade) public static boolean convert(String oldcascade, String newcascade) { boolean retVal = convert_0(oldcascade, newcascade); return retVal; } // C++: bool empty() // C++: CascadeClassifier() private static native long CascadeClassifier_0(); // C++: bool read(FileNode node) // Unknown type 'FileNode' (I), skipping the function // C++: void detectMultiScale(Mat image, vector_Rect& objects, double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0, Size minSize = Size(), Size maxSize = Size()) // C++: CascadeClassifier(String filename) private static native long CascadeClassifier_1(String filename); // C++: bool load(String filename) private static native boolean load_0(long nativeObj, String filename); // C++: void detectMultiScale(Mat image, vector_Rect& objects, vector_int& numDetections, double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0, Size minSize = Size(), Size maxSize = Size()) // C++: bool empty() private static native boolean empty_0(long nativeObj); // C++: void detectMultiScale(Mat image, vector_Rect& objects, double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0, Size minSize = Size(), Size maxSize = Size()) private static native void detectMultiScale_0(long nativeObj, long image_nativeObj, long <API key>, double scaleFactor, int minNeighbors, int flags, double minSize_width, double minSize_height, double maxSize_width, double maxSize_height); // C++: void detectMultiScale(Mat image, vector_Rect& objects, vector_int& rejectLevels, vector_double& levelWeights, double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0, Size minSize = Size(), Size maxSize = Size(), bool outputRejectLevels = false) private static native void detectMultiScale_1(long nativeObj, long image_nativeObj, long <API key>); // C++: void detectMultiScale(Mat image, vector_Rect& objects, vector_int& numDetections, double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0, Size minSize = Size(), Size maxSize = Size()) private static native void detectMultiScale2_0(long nativeObj, long image_nativeObj, long <API key>, long <API key>, double scaleFactor, int minNeighbors, int flags, double minSize_width, double minSize_height, double maxSize_width, double maxSize_height); // C++: bool isOldFormatCascade() private static native void detectMultiScale2_1(long nativeObj, long image_nativeObj, long <API key>, long <API key>); // C++: Size <API key>() // C++: void detectMultiScale(Mat image, vector_Rect& objects, vector_int& rejectLevels, vector_double& levelWeights, double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0, Size minSize = Size(), Size maxSize = Size(), bool outputRejectLevels = false) private static native void detectMultiScale3_0(long nativeObj, long image_nativeObj, long <API key>, long <API key>, long <API key>, double scaleFactor, int minNeighbors, int flags, double minSize_width, double minSize_height, double maxSize_width, double maxSize_height, boolean outputRejectLevels); // C++: int getFeatureType() private static native void detectMultiScale3_1(long nativeObj, long image_nativeObj, long <API key>, long <API key>, long <API key>); // C++: static bool convert(String oldcascade, String newcascade) // C++: bool isOldFormatCascade() private static native boolean <API key>(long nativeObj); // C++: Size <API key>() private static native double[] <API key>(long nativeObj); // C++: int getFeatureType() private static native int getFeatureType_0(long nativeObj); // C++: static bool convert(String oldcascade, String newcascade) private static native boolean convert_0(String oldcascade, String newcascade); // native support for java finalize() private static native void delete(long nativeObj); //javadoc: CascadeClassifier::load(filename) public boolean load(String filename) { boolean retVal = load_0(nativeObj, filename); return retVal; } //javadoc: CascadeClassifier::empty() public boolean empty() { boolean retVal = empty_0(nativeObj); return retVal; } //javadoc: CascadeClassifier::detectMultiScale(image, objects, scaleFactor, minNeighbors, flags, minSize, maxSize) public void detectMultiScale(Mat image, MatOfRect objects, double scaleFactor, int minNeighbors, int flags, Size minSize, Size maxSize) { Mat objects_mat = objects; detectMultiScale_0(nativeObj, image.nativeObj, objects_mat.nativeObj, scaleFactor, minNeighbors, flags, minSize.width, minSize.height, maxSize.width, maxSize.height); return; } //javadoc: CascadeClassifier::detectMultiScale(image, objects) public void detectMultiScale(Mat image, MatOfRect objects) { Mat objects_mat = objects; detectMultiScale_1(nativeObj, image.nativeObj, objects_mat.nativeObj); return; } //javadoc: CascadeClassifier::detectMultiScale(image, objects, numDetections, scaleFactor, minNeighbors, flags, minSize, maxSize) public void detectMultiScale2(Mat image, MatOfRect objects, MatOfInt numDetections, double scaleFactor, int minNeighbors, int flags, Size minSize, Size maxSize) { Mat objects_mat = objects; Mat numDetections_mat = numDetections; detectMultiScale2_0(nativeObj, image.nativeObj, objects_mat.nativeObj, numDetections_mat.nativeObj, scaleFactor, minNeighbors, flags, minSize.width, minSize.height, maxSize.width, maxSize.height); return; } //javadoc: CascadeClassifier::detectMultiScale(image, objects, numDetections) public void detectMultiScale2(Mat image, MatOfRect objects, MatOfInt numDetections) { Mat objects_mat = objects; Mat numDetections_mat = numDetections; detectMultiScale2_1(nativeObj, image.nativeObj, objects_mat.nativeObj, numDetections_mat.nativeObj); return; } //javadoc: CascadeClassifier::detectMultiScale(image, objects, rejectLevels, levelWeights, scaleFactor, minNeighbors, flags, minSize, maxSize, outputRejectLevels) public void detectMultiScale3(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights, double scaleFactor, int minNeighbors, int flags, Size minSize, Size maxSize, boolean outputRejectLevels) { Mat objects_mat = objects; Mat rejectLevels_mat = rejectLevels; Mat levelWeights_mat = levelWeights; detectMultiScale3_0(nativeObj, image.nativeObj, objects_mat.nativeObj, rejectLevels_mat.nativeObj, levelWeights_mat.nativeObj, scaleFactor, minNeighbors, flags, minSize.width, minSize.height, maxSize.width, maxSize.height, outputRejectLevels); return; } //javadoc: CascadeClassifier::detectMultiScale(image, objects, rejectLevels, levelWeights) public void detectMultiScale3(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights) { Mat objects_mat = objects; Mat rejectLevels_mat = rejectLevels; Mat levelWeights_mat = levelWeights; detectMultiScale3_1(nativeObj, image.nativeObj, objects_mat.nativeObj, rejectLevels_mat.nativeObj, levelWeights_mat.nativeObj); return; } //javadoc: CascadeClassifier::isOldFormatCascade() public boolean isOldFormatCascade() { boolean retVal = <API key>(nativeObj); return retVal; } //javadoc: CascadeClassifier::<API key>() public Size <API key>() { Size retVal = new Size(<API key>(nativeObj)); return retVal; } //javadoc: CascadeClassifier::getFeatureType() public int getFeatureType() { int retVal = getFeatureType_0(nativeObj); return retVal; } @Override protected void finalize() throws Throwable { delete(nativeObj); } }
package GlidersGrid; import java.util.Iterator; import repast.simphony.context.Context; import repast.simphony.engine.schedule.ScheduledMethod; import repast.simphony.query.space.grid.MooreQuery; import repast.simphony.space.grid.Grid; import repast.simphony.space.grid.GridPoint; import repast.simphony.util.ContextUtils; public class Dead { private Grid<Object> grid; private int state; public Dead(Grid<Object> grid) { this.grid = grid; } // calculate the state for the next time tick for dead cells @ScheduledMethod(start = 1, interval = 1, priority = 4) public void step1() { MooreQuery<Dead> query = new MooreQuery(grid, this); int neighbours = 0; for (Object o : query.query()) { if (o instanceof Living) { neighbours++; if (neighbours ==3) { } } } if (neighbours == 3) { state = 1; } else { state = 0; } } // visualise the change into the underlay and grid @ScheduledMethod(start = 1, interval = 1, priority = 1) public void step2() { if (state == 1) { GridPoint gpt = grid.getLocation(this); Context<Object> context = ContextUtils.getContext(this); context.remove(this); Living livingCell = new Living(grid); context.add(livingCell); grid.moveTo(livingCell, gpt.getX(), gpt.getY()); context.add(livingCell); } } }
#ifndef LM75_H_ #define LM75_H_ #include <stdint.h> #include "BBBTypes.h" #define LM75_DEVICE "/dev/i2c-1" #define LM75_ADDR ( 0x48 ) extern BBBError readTempLm75(int32_t *ps32Temp); #endif /* LM75_H_ */
#endregion using System; using System.ComponentModel; namespace CuttingEdge.Conditions { <summary> The RequiresValidator can be used for precondition checks. </summary> <typeparam name="T">The type of the argument to be validated</typeparam> internal class RequiresValidator<T> : ConditionValidator<T> { internal RequiresValidator(string argumentName, T value) : base(argumentName, value) { } internal virtual Exception <API key>(<API key> type, string message) { switch (type) { case <API key>.OutOfRangeViolation: return new <API key>(this.ArgumentName, message); case <API key>.<API key>: string enumMessage = this.<API key>(message); return new <API key>(enumMessage); default: if (this.Value != null) { return new ArgumentException(message, this.ArgumentName); } else { return new <API key>(this.ArgumentName, message); } } } <summary>Throws an exception.</summary> <param name="condition">Describes the condition that doesn't hold, e.g., "Value should not be null".</param> <param name="additionalMessage">An additional message that will be appended to the exception message, e.g. "The actual value is 3.". This value may be null or empty.</param> <param name="type">Gives extra information on the exception type that must be build. The actual implementation of the validator may ignore some or all values.</param> protected override void ThrowExceptionCore(string condition, string additionalMessage, <API key> type) { string message = <API key>(condition, additionalMessage); Exception exceptionToThrow = this.<API key>(type, message); throw exceptionToThrow; } private static string <API key>(string condition, string additionalMessage) { if (!String.IsNullOrEmpty(additionalMessage)) { return condition + ". " + additionalMessage; } else { return condition + "."; } } private string <API key>(string message) { ArgumentException argumentException = new ArgumentException(message, this.ArgumentName); // Returns the message formatted according to the current culture. // Note that the 'Parameter name' part of the message is culture sensitive. return argumentException.Message; } } }
(function(){ 'use strict'; function ListService($http){ this.getList = function(list_id){ return $http.get('/lists/' + list_id + ".json") } } ListService.$inject = ['$http'] angular .module('app') .service('ListService', ListService) }())
angular.module('movieApp') .directive('movieResult', function () { var directive = { restrict: 'E', replace: true, scope: { result: '=result' }, template: [ '<div class="row">', '<div class="col-sm-4">', '<img ng-src="{{result.Poster}}" alt="{{result.Title}}" width="220px">', '</div>', '<div class="col-sm-8">', '<h3>{{result.Title}}</h3>', '<p>{{result.Plot}}</p>', '<p><strong>Director:</strong> {{result.Director}}</p>', '<p><strong>Actors:</strong> {{result.Actors}}</p>', '<p><strong>Released:</strong> {{result.Released}} ({{result.Released | fromNow}})</p>', '<p><strong>Genre:</strong> {{result.Genre}}</p>', '</div>', '</div>' ].join('') }; return directive; });
<table width="90%" border="0"><tr><td><script>function openfile(url) {fullwin = window.open(url, "fulltext", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");}</script><div class="flayoutclass"><div class="flayoutclass_first"><table class="tableoutfmt2"><tr><th class="std1"><b>&nbsp;</b></th><td class="std2"></td></tr> <tr><th class="std1"><b>&nbsp;</b></th><td class="std2"><sup class="subfont">ˊ</sup><sup class="subfont">ˊ</sup><sup class="subfont">ˋ</sup><sup class="subfont">ˊ</sup><sup class="subfont">ˊ</sup><sup class="subfont">ˊ</sup><sup class="subfont">ˊ</sup></td></tr> <tr><th class="std1"><b>&nbsp;</b></th><td class="std2"><font class="english_word">bó xué qià wén bó xué xiá wēn</font></td></tr> <tr><th class="std1"><b>&nbsp;</b></th><td class="std2">˙˙<img src=/cydic/dicword/fa40.gif border=0 alt=* class=fontimg valign=center><img src=/cydic/dicword/fa41.gif border=0 alt=* class=fontimg valign=center><img src=/cydic/dicword/fa40.gif border=0 alt=* class=fontimg valign=center><img src=/cydic/dicword/fa41.gif border=0 alt=* class=fontimg valign=center></td></tr> <tr><th class="std1"><b><font class="fltypefont"></font>&nbsp;</b></th><td class="std2"></td></tr> </td></tr></table></div> <!-- flayoutclass_first --><div class="flayoutclass_second"></div> <!-- flayoutclass_second --></div> <!-- flayoutclass --></td></tr></table>
/* eslint-env mocha */ const { expect } = chai; import React from './React'; import TestUtils from './TestUtils'; describe('React components', () => { it('should find valid xpath in react component', () => { const component = TestUtils.renderIntoDocument(<blink>hi</blink>); expect(component).to.have.xpath('//blink'); }); it('should find valid xpath in react component twice', () => { const component = TestUtils.renderIntoDocument(<blink>hi</blink>); expect(component).to.have.xpath('//blink'); expect(component).to.have.xpath('//blink'); }); describe('when it does not find valid xpath in react component', () => { it('should throw', () => { const component = TestUtils.renderIntoDocument(<blink>hi</blink>); expect(() => { expect(component).to.have.xpath(' }).to.throw('to have xpath \' }); it('should throw with outerHTML of the component', () => { const component = TestUtils.renderIntoDocument(<blink>hi</blink>); expect(() => { expect(component).to.have.xpath(' }).to.throw('hi</blink>'); }); }); });
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Sandsound</title> <link rel="stylesheet" href="/css/reset.css"> <link rel="stylesheet" href="/css/style.css"> </head> <body> <canvas id="canvas" class="background"></canvas> <!-- Ne s'affiche que si sur mobile :) --> <div class="mobile"> <a href="/"><img class="logo" src="/css/img/logo.png" alt="SandSound"></a> <p>Pour profiter de l'expérience SandSound, rendez-vous sur une tablette ou desktop !</p> </div> <div class="sidebar"> <a href="/"><img class="logo" src="/css/img/logo.png" alt="SandSound"></a> <nav> <ul> <li class="active"><a href="{{ route('profile', ['name' => $user->name]) }}">Profil</a></li> <li>{{ link_to_route('room', 'Rejoindre un salon') }}</li> <li>{{ link_to_route('form-private', 'Nouveau salon') }}</li> <li>{{ link_to_route('rank', 'Classement') }}</li> </ul> </nav> </div> <div class="content"> <div class="content__infos"> <ul> <li class="<API key>">{{ $user->name }}</li> <li class="content__infos--pts">{{ $user->score->xp }}<span> pts </span></li> <li class="content__infos--niv"><span>Niv :</span> {{ $user->score->lvl_total }}</li> </ul> </div> <div class="content__title"> <h1>| {{ $user->name }}</h1> <div class="<API key>"> <p>{{ $user->name }} est niveau <span>{{ $user->score->lvl_total }}</span>.</p> </div> <div class="<API key>"> <p> Découvrez les dernières musiques de <span>{{ $user->name }}</span>. </p> </div> <div class="<API key>"> <ul> <li class="<API key>">| Bass : <span>{{ $user->score->lvl_bass }}</span></li> <li class="<API key>">| Ambiance : <span>{{ $user->score->lvl_ambiance }}</span></li> <li class="<API key>">| Drum : <span>{{ $user->score->lvl_drum }}</span></li> <li class="<API key>">| Lead : <span>{{ $user->score->lvl_lead }}</span></li> </ul> </div> <div class="content__experience"> <ul> <li class="<API key>"></li> <li class="<API key>"></li> <li class="<API key>"></li> <li class="<API key>"></li> </ul> </div> @if (count($songs)) <div class="<API key>"> <table> <thead> <tr> <th scope="col">Nom de la chanson :</th> <th scope="col">Score :</th> </tr> <tbody> @foreach ($songs as $song) <tr> <td> {{ $song->name }}</td> <td>{{ $song->score }}</td> </tr> @endforeach </tbody> </table> </div> @endif </div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="/js/index.js"></script> </body> </html>
require 'lapine/test/exchange' module Lapine module Test module RSpecHelper def self.setup(_example = nil) RSpec::Mocks::AllowanceTarget.new(Lapine::Exchange).to( RSpec::Mocks::Matchers::Receive.new(:new, ->(name, properties) { Lapine::Test::Exchange.new(name, properties) }) ) end def self.teardown Lapine.close_connections! end end end end
#include "config.h" #include "platform/animation/UnitBezier.h" #include <gtest/gtest.h> using namespace WebCore; namespace { TEST(UnitBezierTest, BasicUse) { UnitBezier bezier(0.5, 1.0, 0.5, 1.0); EXPECT_EQ(0.875, bezier.solve(0.5, 0.005)); } TEST(UnitBezierTest, Overshoot) { UnitBezier bezier(0.5, 2.0, 0.5, 2.0); EXPECT_EQ(1.625, bezier.solve(0.5, 0.005)); } TEST(UnitBezierTest, Undershoot) { UnitBezier bezier(0.5, -1.0, 0.5, -1.0); EXPECT_EQ(-0.625, bezier.solve(0.5, 0.005)); } TEST(UnitBezierTest, InputAtEdgeOfRange) { UnitBezier bezier(0.5, 1.0, 0.5, 1.0); EXPECT_EQ(0.0, bezier.solve(0.0, 0.005)); EXPECT_EQ(1.0, bezier.solve(1.0, 0.005)); } TEST(UnitBezierTest, InputOutOfRange) { UnitBezier bezier(0.5, 1.0, 0.5, 1.0); EXPECT_EQ(0.0, bezier.solve(-1.0, 0.005)); EXPECT_EQ(1.0, bezier.solve(2.0, 0.005)); } TEST(UnitBezierTest, <API key>) { UnitBezier bezier(0.5, 1.0, 0.5, 1.0); EXPECT_EQ(0.0, bezier.solve(-1.0, 1.0)); EXPECT_EQ(1.0, bezier.solve(2.0, 1.0)); } } // namespace
using Brandbank.Xml.Logging; using System; namespace Brandbank.Api.Clients { public sealed class <API key> : IFeedbackClient { private readonly ILogger<IFeedbackClient> _logger; private readonly IFeedbackClient _feedbackClient; public <API key>(ILogger<IFeedbackClient> logger, IFeedbackClient feedbackClient) { _logger = logger; _feedbackClient = feedbackClient; } public int <API key>(byte[] compressedFeedback) { _logger.LogDebug("Uploading compressed feedback to Brandbank"); try { var response = _feedbackClient.<API key>(compressedFeedback); _logger.LogDebug(response == 0 ? "Uploaded compressed feedback to Brandbank" : $"Upload compressed feedback to Brandbank failed, response code {response}"); return response; } catch (Exception e) { _logger.LogError($"Upload compressed feedback to Brandbank failed: {e}"); throw; } } public void Dispose() { _logger.LogDebug("Disposing feedback client"); try { _feedbackClient.Dispose(); _logger.LogDebug("Disposed feedback client"); } catch (Exception e) { _logger.LogError($"Disposing feedback client failed: {e}"); throw; } } } }
<?php namespace Zodream\Infrastructure\Http\Input; use Zodream\Infrastructure\Base\MagicObject; abstract class BaseInput extends MagicObject { /** * * @param array|string $data * @return array|string */ protected function _clean($data) { if (is_array($data)) { foreach ($data as $key => $value) { unset($data[$key]); $data[strtolower($this->_clean($key))] = $this->_clean($value); } } else if (defined('APP_SAFE') && APP_SAFE){ $data = htmlspecialchars($data, ENT_COMPAT); } return $data; } protected function setValues(array $data) { $this->set($this->_clean($data)); } public function get($name = null, $default = null) { return parent::get(strtolower($name), $default); } }
<?php namespace Grosona; use Grosona\PhpProcess\Utils\Logger; use Grosona\PhpProcess\TrobuleHandler; /** * Read configurations from the file. * * @author hchsiao */ class TroubleHandler implements TrobuleHandler { protected $logger = null; public function activate(Logger $logger) { $this->logger = $logger; } public function handle(\Exception $err) { if( is_int(stripos($err->getMessage(), "Error validating access token: Session has expired")) || is_int(stripos($err->getMessage(), "Invalid appsecret_proof")) ) { $msg = "token died\n"; echo $msg; } else if(is_int(stripos($err->getMessage(), "Access token mismatch"))) { $msg = "token confilict\n"; echo $msg; } else { $msg = (string) $err; } $this->logger->log("<Exception> $msg", Logger::LEVEL_ERROR); } public function shutdown() { $logger = $this->logger; if(!$logger instanceof Logger) { die(); } $err = error_get_last(); $errMsg = $err['message']; if(is_int(stripos($errMsg, "<API key>' with message 'Connection timed out"))) { $logger->log("facebook server down", Logger::LEVEL_WARN); } else if( is_int(stripos($errMsg, "operation failed")) || is_int(stripos($errMsg, "Gateway Time-out")) || is_int(stripos($errMsg, "HTTP request failed")) || is_int(stripos($errMsg, "Connection timed out")) || // faild to download image, will retry so it's OK is_int(stripos($errMsg, "Undefined variable: <API key>")) || is_int(stripos($errMsg, "Stream returned an empty response")) // facebook http request failed, retry too ) { $logger->log("HTTP request failed", Logger::LEVEL_INFO); } else if($errMsg) { $type = $err['type']; $place = $err['file'] . '(' . $err['line'] . ')'; $logger->log("<Shutdown Type=$type> $errMsg at $place", Logger::LEVEL_ERROR); } } }
class DashboardController < <API key> def index end end # vim: fo=tcq
-- T_Good CREATE TABLE IF NOT EXISTS T_Good ( goodId INTEGER PRIMARY KEY NOT NULL, good TEXT, "createAt" TEXT DEFAULT (datetime('now', 'localtime')) );
const getAllMatchers = require("./getAllMatchers"); describe("unit: getAllMatchers", () => { let handler; let matcherStore; beforeEach(() => { matcherStore = [{}, {}, {}]; handler = getAllMatchers(matcherStore); }); test("it should return all matchers", () => { expect(handler()).toHaveProperty("body", matcherStore); }); test("it should return a status of 200", () => { expect(handler()).toHaveProperty("status", 200); }); });
table { font-family: Consolas, Monaco, monospace; font-size: 1em; line-height: 1.44em; } table th, table td { padding: 0.4em 0.8em; }
layout: post title: "Welcome to Jekyll!" tags: [web, jekyll] Vestibulum vulputate ac sem dapibus sagittis. Phasellus vestibulum ligula quam, vitae porta risus posuere sit amet. Interdum et malesuada fames ac ante ipsum primis in faucibus. Aliquam lobortis nisl ut semper suscipit. Aenean eget sem nisl. Sed gravida suscipit mauris et pellentesque. Sed eget euismod sem. Vivamus volutpat sem odio, ut hendrerit arcu tempor non. Sed at sodales nisl. Mauris dui sem, bibendum vel tortor ac, vulputate sollicitudin massa. Proin mattis rhoncus tempus. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed eget metus purus. Vestibulum sagittis non velit id tempus. ![My helpful screenshot](http://trentwalton.com/assets/uploads/2013/12/work-values.jpg) js const options = { size: 45 }; Mauris posuere arcu eu erat ullamcorper, a auctor elit semper. In quis consectetur leo. In et dictum justo. Fusce at urna ultrices, sodales lacus eget, molestie ex. In eleifend orci et ipsum lacinia, vitae fermentum augue laoreet. Sed a ultricies lorem. Pellentesque varius nisi ac neque aliquam porta. Nunc viverra imperdiet augue, quis vulputate odio pellentesque sit amet. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nullam tristique ante et tristique euismod. Proin rutrum interdum nisl id elementum. Pellentesque lacinia velit orci, a tincidunt tortor porta id. Donec mauris urna, rhoncus nec mauris eget, suscipit feugiat risus. Maecenas in viverra metus. Nulla facilisi. Aliquam porta venenatis enim in congue. Phasellus ut suscipit libero. Vestibulum urna magna, pretium eu lorem vel, dapibus sollicitudin ligula. Maecenas varius aliquam malesuada. Donec consectetur ultricies turpis ultrices gravida. Praesent efficitur nulla ac vehicula consequat. Praesent feugiat, magna dignissim varius eleifend, ligula sapien accumsan nisi, eu tincidunt magna neque a neque. Donec interdum, magna id vestibulum suscipit, neque quam dignissim nibh, ut molestie felis purus vitae sem. Phasellus imperdiet eleifend erat ac posuere. Donec id vehicula enim. Maecenas vel blandit nisl. Sed porta convallis lacinia. Phasellus sit amet aliquet velit. Proin consectetur malesuada tortor sed consequat. Morbi arcu odio, dictum eget nibh eget, tempor gravida risus. Nulla at tortor id libero rutrum luctus et id leo. Nam dolor urna, congue eu dapibus et, ultrices eget magna. Fusce dignissim lacinia elementum. Aenean condimentum nulla iaculis velit dictum gravida. Pellentesque eleifend dignissim est, volutpat consectetur est ornare a. Vestibulum ut nulla commodo, iaculis augue sit amet, volutpat orci. Nullam sit amet lacinia justo. Mauris eu elit quam. Aliquam erat volutpat. Ut pulvinar quis enim ut placerat. Duis dictum varius iaculis. Suspendisse potenti. Nam tellus magna, consequat a dictum a, elementum a nisl. Pellentesque posuere nulla eu gravida rhoncus. Maecenas non ipsum ut felis vulputate consequat ac quis lectus. Nulla in porttitor elit. Nam at metus consectetur, sollicitudin augue ut, vulputate mi. Donec lobortis bibendum mauris vel vehicula. Fusce scelerisque id sapien sed bibendum.
[![](https: [template.js](https://github.com/yanhaijing/template.js) | IE | CH | FF | SF | OP | IOS | Android | Node | | | 6+ | 29+ | 55+ | 9+ | 50+ | 9+ | 4+ | 0.10+ | **ES5ie6-8[es5-shim](http://github.com/es-shims/es5-shim/)[demo/demo-global.html](./demo/demo-global.html)** npm bash $ npm install --save @templatejs/parser node js const parser = require('@templatejs/parser'); const tpl = ` <div><%=a%></div> `; parser.parse(tpl); // return a render string like '<div>' + a + '</div>' js // sTag // eTag // escape parser.parse(tpl, {sTag: '<#', eTag: '#>', escape: true}); [API](https://github.com/yanhaijing/template.js/blob/master/./doc/api.md) [contributors](https://github.com/yanhaijing/template.js/graphs/contributors) [CHANGELOG.md](https://github.com/yanhaijing/template.js/blob/master/TODO.md/CHANGELOG.md) [TODO.md](https://github.com/yanhaijing/template.js/blob/master/TODO.md)
# coding=utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. import functools from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union import warnings from azure.core.exceptions import <API key>, HttpResponseError, ResourceExistsError, <API key>, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.<API key> = False def build_get_request( resource_group_name: str, <API key>: str, database_name: str, query_id: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: api_version = "2020-11-01-preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}') <API key> = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "managedInstanceName": _SERIALIZER.url("<API key>", <API key>, 'str'), "databaseName": _SERIALIZER.url("database_name", database_name, 'str'), "queryId": _SERIALIZER.url("query_id", query_id, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } url = _format_url_section(url, **<API key>) # Construct parameters query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=url, params=query_parameters, headers=header_parameters, **kwargs ) def <API key>( resource_group_name: str, <API key>: str, database_name: str, query_id: str, subscription_id: str, *, start_time: Optional[str] = None, end_time: Optional[str] = None, interval: Optional[Union[str, "_models.QueryTimeGrainType"]] = None, **kwargs: Any ) -> HttpRequest: api_version = "2020-11-01-preview" accept = "application/json" # Construct URL url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}/statistics') <API key> = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "managedInstanceName": _SERIALIZER.url("<API key>", <API key>, 'str'), "databaseName": _SERIALIZER.url("database_name", database_name, 'str'), "queryId": _SERIALIZER.url("query_id", query_id, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } url = _format_url_section(url, **<API key>) # Construct parameters query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if start_time is not None: query_parameters['startTime'] = _SERIALIZER.query("start_time", start_time, 'str') if end_time is not None: query_parameters['endTime'] = _SERIALIZER.query("end_time", end_time, 'str') if interval is not None: query_parameters['interval'] = _SERIALIZER.query("interval", interval, 'str') query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=url, params=query_parameters, headers=header_parameters, **kwargs ) class <API key>(object): """<API key> operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~azure.mgmt.sql.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. """ models = _models def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer self._config = config @distributed_trace def get( self, resource_group_name: str, <API key>: str, database_name: str, query_id: str, **kwargs: Any ) -> "_models.<API key>": """Get query by query id. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str :param <API key>: The name of the managed instance. :type <API key>: str :param database_name: The name of the database. :type database_name: str :param query_id: :type query_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: <API key>, or the result of cls(response) :rtype: ~azure.mgmt.sql.models.<API key> :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.<API key>"] error_map = { 401: <API key>, 404: <API key>, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) request = build_get_request( resource_group_name=resource_group_name, <API key>=<API key>, database_name=database_name, query_id=query_id, subscription_id=self._config.subscription_id, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = self._deserialize('<API key>', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}'} # type: ignore @distributed_trace def list_by_query( self, resource_group_name: str, <API key>: str, database_name: str, query_id: str, start_time: Optional[str] = None, end_time: Optional[str] = None, interval: Optional[Union[str, "_models.QueryTimeGrainType"]] = None, **kwargs: Any ) -> Iterable["_models.<API key>"]: """Get query execution statistics by query id. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str :param <API key>: The name of the managed instance. :type <API key>: str :param database_name: The name of the database. :type database_name: str :param query_id: :type query_id: str :param start_time: Start time for observed period. :type start_time: str :param end_time: End time for observed period. :type end_time: str :param interval: The time step to be used to summarize the metric values. :type interval: str or ~azure.mgmt.sql.models.QueryTimeGrainType :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either <API key> or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.<API key>] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.<API key>"] error_map = { 401: <API key>, 404: <API key>, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) def prepare_request(next_link=None): if not next_link: request = <API key>( resource_group_name=resource_group_name, <API key>=<API key>, database_name=database_name, query_id=query_id, subscription_id=self._config.subscription_id, start_time=start_time, end_time=end_time, interval=interval, template_url=self.list_by_query.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) else: request = <API key>( resource_group_name=resource_group_name, <API key>=<API key>, database_name=database_name, query_id=query_id, subscription_id=self._config.subscription_id, start_time=start_time, end_time=end_time, interval=interval, template_url=next_link, ) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" return request def extract_data(pipeline_response): deserialized = self._deserialize("<API key>", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) list_by_query.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}/statistics'} # type: ignore
<?php namespace Koalamon\IntegrationBundle\Integration; class Integration { private $name; private $image; private $description; private $url; private $activeElements; private $totalElements; /** * Integration constructor. * * @param $name * @param $image * @param $description * @param $url */ public function __construct($name, $image, $description, $url = null, $activeElements = null, $totalElements = null) { $this->name = $name; $this->image = $image; $this->description = $description; $this->url = $url; $this->activeElements = $activeElements; $this->totalElements = $totalElements; } /** * @return mixed */ public function getName() { return $this->name; } /** * @return mixed */ public function getImage() { return $this->image; } /** * @return mixed */ public function getDescription() { return $this->description; } /** * @return mixed */ public function getUrl() { return $this->url; } /** * @return null */ public function getActiveElements() { return $this->activeElements; } /** * @return null */ public function getTotalElements() { return $this->totalElements; } /** * @param null $activeElements */ public function setActiveElements($activeElements) { $this->activeElements = $activeElements; } public function setUrl($url) { $this->url = $url; } }
import redis import logging import simplejson as json import sys from msgpack import Unpacker from flask import Flask, request, render_template from daemon import runner from os.path import dirname, abspath # add the shared settings file to namespace sys.path.insert(0, dirname(dirname(abspath(__file__)))) import settings REDIS_CONN = redis.StrictRedis(unix_socket_path=settings.REDIS_SOCKET_PATH) app = Flask(__name__) app.config['<API key>'] = True @app.route("/") def index(): return render_template('index.html'), 200 @app.route("/app_settings") def app_settings(): app_settings = {'GRAPHITE_HOST': settings.GRAPHITE_HOST, 'OCULUS_HOST': settings.OCULUS_HOST, 'FULL_NAMESPACE': settings.FULL_NAMESPACE, } resp = json.dumps(app_settings) return resp, 200 @app.route("/api", methods=['GET']) def data(): metric = request.args.get('metric', None) try: raw_series = REDIS_CONN.get(metric) if not raw_series: resp = json.dumps({'results': 'Error: No metric by that name'}) return resp, 404 else: unpacker = Unpacker(use_list = False) unpacker.feed(raw_series) timeseries = [item[:2] for item in unpacker] resp = json.dumps({'results': timeseries}) return resp, 200 except Exception as e: error = "Error: " + e resp = json.dumps({'results': error}) return resp, 500 class App(): def __init__(self): self.stdin_path = '/dev/null' self.stdout_path = settings.LOG_PATH + '/webapp.log' self.stderr_path = settings.LOG_PATH + '/webapp.log' self.pidfile_path = settings.PID_PATH + '/webapp.pid' self.pidfile_timeout = 5 def run(self): logger.info('starting webapp') logger.info('hosted at %s' % settings.WEBAPP_IP) logger.info('running on port %d' % settings.WEBAPP_PORT) app.run(settings.WEBAPP_IP, settings.WEBAPP_PORT) if __name__ == "__main__": """ Start the server """ webapp = App() logger = logging.getLogger("AppLog") logger.setLevel(logging.DEBUG) formatter = logging.Formatter("%(asctime)s :: %(message)s", datefmt="%Y-%m-%d %H:%M:%S") handler = logging.FileHandler(settings.LOG_PATH + '/webapp.log') handler.setFormatter(formatter) logger.addHandler(handler) if len(sys.argv) > 1 and sys.argv[1] == 'run': webapp.run() else: daemon_runner = runner.DaemonRunner(webapp) daemon_runner.daemon_context.files_preserve = [handler.stream] daemon_runner.do_action()
#include "clipper.hpp" #include <cmath> #include <vector> #include <algorithm> #include <stdexcept> #include <cstring> #include <cstdlib> #include <ostream> #include <functional> namespace ClipperLib { static double const pi = 3.141592653589793238; static double const two_pi = pi *2; static double const def_arc_tolerance = 0.25; enum Direction { dRightToLeft, dLeftToRight }; static int const Unassigned = -1; //edge not currently 'owning' a solution static int const Skip = -2; //edge that would otherwise close a path #define HORIZONTAL (-1.0E+40) #define TOLERANCE (1.0e-20) #define NEAR_ZERO(val) (((val) > -TOLERANCE) && ((val) < TOLERANCE)) struct TEdge { IntPoint Bot; IntPoint Curr; //current (updated for every new scanbeam) IntPoint Top; double Dx; PolyType PolyTyp; EdgeSide Side; //side only refers to current side of solution poly int WindDelta; //1 or -1 depending on winding direction int WindCnt; int WindCnt2; //winding count of the opposite polytype int OutIdx; TEdge *Next; TEdge *Prev; TEdge *NextInLML; TEdge *NextInAEL; TEdge *PrevInAEL; TEdge *NextInSEL; TEdge *PrevInSEL; }; struct IntersectNode { TEdge *Edge1; TEdge *Edge2; IntPoint Pt; }; struct LocalMinimum { cInt Y; TEdge *LeftBound; TEdge *RightBound; }; struct OutPt; //OutRec: contains a path in the clipping solution. Edges in the AEL will //carry a pointer to an OutRec when they are part of the clipping solution. struct OutRec { int Idx; bool IsHole; bool IsOpen; OutRec *FirstLeft; //see comments in clipper.pas PolyNode *PolyNd; OutPt *Pts; OutPt *BottomPt; }; struct OutPt { int Idx; IntPoint Pt; OutPt *Next; OutPt *Prev; }; struct Join { OutPt *OutPt1; OutPt *OutPt2; IntPoint OffPt; }; struct LocMinSorter { inline bool operator()(const LocalMinimum& locMin1, const LocalMinimum& locMin2) { return locMin2.Y < locMin1.Y; } }; inline cInt Round(double val) { if ((val < 0)) return static_cast<cInt>(val - 0.5); else return static_cast<cInt>(val + 0.5); } inline cInt Abs(cInt val) { return val < 0 ? -val : val; } // PolyTree methods ... void PolyTree::Clear() { for (PolyNodes::size_type i = 0; i < AllNodes.size(); ++i) delete AllNodes[i]; AllNodes.resize(0); Childs.resize(0); } PolyNode* PolyTree::GetFirst() const { if (!Childs.empty()) return Childs[0]; else return 0; } int PolyTree::Total() const { int result = (int)AllNodes.size(); //with negative offsets, ignore the hidden outer polygon ... if (result > 0 && Childs[0] != AllNodes[0]) result return result; } // PolyNode methods ... PolyNode::PolyNode(): Parent(0), Index(0), m_IsOpen(false) { } int PolyNode::ChildCount() const { return (int)Childs.size(); } void PolyNode::AddChild(PolyNode& child) { unsigned cnt = (unsigned)Childs.size(); Childs.push_back(&child); child.Parent = this; child.Index = cnt; } PolyNode* PolyNode::GetNext() const { if (!Childs.empty()) return Childs[0]; else return GetNextSiblingUp(); } PolyNode* PolyNode::GetNextSiblingUp() const { if (!Parent) //protects against PolyTree.GetNextSiblingUp() return 0; else if (Index == Parent->Childs.size() - 1) return Parent->GetNextSiblingUp(); else return Parent->Childs[Index + 1]; } bool PolyNode::IsHole() const { bool result = true; PolyNode* node = Parent; while (node) { result = !result; node = node->Parent; } return result; } bool PolyNode::IsOpen() const { return m_IsOpen; } #ifndef use_int32 // Int128 class (enables safe math on signed 64bit integers) // eg Int128 val1((long64)9223372036854775807); //ie 2^63 -1 // Int128 val2((long64)9223372036854775807); // Int128 val3 = val1 * val2; // val3.AsString => "<API key>" (8.5e+37) class Int128 { public: ulong64 lo; long64 hi; Int128(long64 _lo = 0) { lo = (ulong64)_lo; if (_lo < 0) hi = -1; else hi = 0; } Int128(const Int128 &val): lo(val.lo), hi(val.hi){} Int128(const long64& _hi, const ulong64& _lo): lo(_lo), hi(_hi){} Int128& operator = (const long64 &val) { lo = (ulong64)val; if (val < 0) hi = -1; else hi = 0; return *this; } bool operator == (const Int128 &val) const {return (hi == val.hi && lo == val.lo);} bool operator != (const Int128 &val) const { return !(*this == val);} bool operator > (const Int128 &val) const { if (hi != val.hi) return hi > val.hi; else return lo > val.lo; } bool operator < (const Int128 &val) const { if (hi != val.hi) return hi < val.hi; else return lo < val.lo; } bool operator >= (const Int128 &val) const { return !(*this < val);} bool operator <= (const Int128 &val) const { return !(*this > val);} Int128& operator += (const Int128 &rhs) { hi += rhs.hi; lo += rhs.lo; if (lo < rhs.lo) hi++; return *this; } Int128 operator + (const Int128 &rhs) const { Int128 result(*this); result+= rhs; return result; } Int128& operator -= (const Int128 &rhs) { *this += -rhs; return *this; } Int128 operator - (const Int128 &rhs) const { Int128 result(*this); result -= rhs; return result; } Int128 operator-() const //unary negation { if (lo == 0) return Int128(-hi, 0); else return Int128(~hi, ~lo + 1); } operator double() const { const double shift64 = <API key>.0; //2^64 if (hi < 0) { if (lo == 0) return (double)hi * shift64; else return -(double)(~lo + ~hi * shift64); } else return (double)(lo + hi * shift64); } }; Int128 Int128Mul (long64 lhs, long64 rhs) { bool negate = (lhs < 0) != (rhs < 0); if (lhs < 0) lhs = -lhs; ulong64 int1Hi = ulong64(lhs) >> 32; ulong64 int1Lo = ulong64(lhs & 0xFFFFFFFF); if (rhs < 0) rhs = -rhs; ulong64 int2Hi = ulong64(rhs) >> 32; ulong64 int2Lo = ulong64(rhs & 0xFFFFFFFF); //nb: see comments in clipper.pas ulong64 a = int1Hi * int2Hi; ulong64 b = int1Lo * int2Lo; ulong64 c = int1Hi * int2Lo + int1Lo * int2Hi; Int128 tmp; tmp.hi = long64(a + (c >> 32)); tmp.lo = long64(c << 32); tmp.lo += long64(b); if (tmp.lo < b) tmp.hi++; if (negate) tmp = -tmp; return tmp; }; #endif // Miscellaneous global functions bool Orientation(const Path &poly) { return Area(poly) >= 0; } double Area(const Path &poly) { int size = (int)poly.size(); if (size < 3) return 0; double a = 0; for (int i = 0, j = size -1; i < size; ++i) { a += ((double)poly[j].X + poly[i].X) * ((double)poly[j].Y - poly[i].Y); j = i; } return -a * 0.5; } double Area(const OutPt *op) { const OutPt *startOp = op; if (!op) return 0; double a = 0; do { a += (double)(op->Prev->Pt.X + op->Pt.X) * (double)(op->Prev->Pt.Y - op->Pt.Y); op = op->Next; } while (op != startOp); return a * 0.5; } double Area(const OutRec &outRec) { return Area(outRec.Pts); } bool PointIsVertex(const IntPoint &Pt, OutPt *pp) { OutPt *pp2 = pp; do { if (pp2->Pt == Pt) return true; pp2 = pp2->Next; } while (pp2 != pp); return false; } //See "The Point in Polygon Problem for Arbitrary Polygons" by Hormann & Agathos int PointInPolygon(const IntPoint &pt, const Path &path) { //returns 0 if false, +1 if true, -1 if pt ON polygon boundary int result = 0; size_t cnt = path.size(); if (cnt < 3) return 0; IntPoint ip = path[0]; for(size_t i = 1; i <= cnt; ++i) { IntPoint ipNext = (i == cnt ? path[0] : path[i]); if (ipNext.Y == pt.Y) { if ((ipNext.X == pt.X) || (ip.Y == pt.Y && ((ipNext.X > pt.X) == (ip.X < pt.X)))) return -1; } if ((ip.Y < pt.Y) != (ipNext.Y < pt.Y)) { if (ip.X >= pt.X) { if (ipNext.X > pt.X) result = 1 - result; else { double d = (double)(ip.X - pt.X) * (ipNext.Y - pt.Y) - (double)(ipNext.X - pt.X) * (ip.Y - pt.Y); if (!d) return -1; if ((d > 0) == (ipNext.Y > ip.Y)) result = 1 - result; } } else { if (ipNext.X > pt.X) { double d = (double)(ip.X - pt.X) * (ipNext.Y - pt.Y) - (double)(ipNext.X - pt.X) * (ip.Y - pt.Y); if (!d) return -1; if ((d > 0) == (ipNext.Y > ip.Y)) result = 1 - result; } } } ip = ipNext; } return result; } int PointInPolygon (const IntPoint &pt, OutPt *op) { //returns 0 if false, +1 if true, -1 if pt ON polygon boundary int result = 0; OutPt* startOp = op; for(;;) { if (op->Next->Pt.Y == pt.Y) { if ((op->Next->Pt.X == pt.X) || (op->Pt.Y == pt.Y && ((op->Next->Pt.X > pt.X) == (op->Pt.X < pt.X)))) return -1; } if ((op->Pt.Y < pt.Y) != (op->Next->Pt.Y < pt.Y)) { if (op->Pt.X >= pt.X) { if (op->Next->Pt.X > pt.X) result = 1 - result; else { double d = (double)(op->Pt.X - pt.X) * (op->Next->Pt.Y - pt.Y) - (double)(op->Next->Pt.X - pt.X) * (op->Pt.Y - pt.Y); if (!d) return -1; if ((d > 0) == (op->Next->Pt.Y > op->Pt.Y)) result = 1 - result; } } else { if (op->Next->Pt.X > pt.X) { double d = (double)(op->Pt.X - pt.X) * (op->Next->Pt.Y - pt.Y) - (double)(op->Next->Pt.X - pt.X) * (op->Pt.Y - pt.Y); if (!d) return -1; if ((d > 0) == (op->Next->Pt.Y > op->Pt.Y)) result = 1 - result; } } } op = op->Next; if (startOp == op) break; } return result; } bool Poly2ContainsPoly1(OutPt *OutPt1, OutPt *OutPt2) { OutPt* op = OutPt1; do { //nb: PointInPolygon returns 0 if false, +1 if true, -1 if pt on polygon int res = PointInPolygon(op->Pt, OutPt2); if (res >= 0) return res > 0; op = op->Next; } while (op != OutPt1); return true; } bool SlopesEqual(const TEdge &e1, const TEdge &e2, bool UseFullInt64Range) { #ifndef use_int32 if (UseFullInt64Range) return Int128Mul(e1.Top.Y - e1.Bot.Y, e2.Top.X - e2.Bot.X) == Int128Mul(e1.Top.X - e1.Bot.X, e2.Top.Y - e2.Bot.Y); else #endif return (e1.Top.Y - e1.Bot.Y) * (e2.Top.X - e2.Bot.X) == (e1.Top.X - e1.Bot.X) * (e2.Top.Y - e2.Bot.Y); } bool SlopesEqual(const IntPoint pt1, const IntPoint pt2, const IntPoint pt3, bool UseFullInt64Range) { #ifndef use_int32 if (UseFullInt64Range) return Int128Mul(pt1.Y-pt2.Y, pt2.X-pt3.X) == Int128Mul(pt1.X-pt2.X, pt2.Y-pt3.Y); else #endif return (pt1.Y-pt2.Y)*(pt2.X-pt3.X) == (pt1.X-pt2.X)*(pt2.Y-pt3.Y); } bool SlopesEqual(const IntPoint pt1, const IntPoint pt2, const IntPoint pt3, const IntPoint pt4, bool UseFullInt64Range) { #ifndef use_int32 if (UseFullInt64Range) return Int128Mul(pt1.Y-pt2.Y, pt3.X-pt4.X) == Int128Mul(pt1.X-pt2.X, pt3.Y-pt4.Y); else #endif return (pt1.Y-pt2.Y)*(pt3.X-pt4.X) == (pt1.X-pt2.X)*(pt3.Y-pt4.Y); } inline bool IsHorizontal(TEdge &e) { return e.Dx == HORIZONTAL; } inline double GetDx(const IntPoint pt1, const IntPoint pt2) { return (pt1.Y == pt2.Y) ? HORIZONTAL : (double)(pt2.X - pt1.X) / (pt2.Y - pt1.Y); } inline void SetDx(TEdge &e) { cInt dy = (e.Top.Y - e.Bot.Y); if (dy == 0) e.Dx = HORIZONTAL; else e.Dx = (double)(e.Top.X - e.Bot.X) / dy; } inline void SwapSides(TEdge &Edge1, TEdge &Edge2) { EdgeSide Side = Edge1.Side; Edge1.Side = Edge2.Side; Edge2.Side = Side; } inline void SwapPolyIndexes(TEdge &Edge1, TEdge &Edge2) { int OutIdx = Edge1.OutIdx; Edge1.OutIdx = Edge2.OutIdx; Edge2.OutIdx = OutIdx; } inline cInt TopX(TEdge &edge, const cInt currentY) { return ( currentY == edge.Top.Y ) ? edge.Top.X : edge.Bot.X + Round(edge.Dx *(currentY - edge.Bot.Y)); } void IntersectPoint(TEdge &Edge1, TEdge &Edge2, IntPoint &ip) { #ifdef use_xyz ip.Z = 0; #endif double b1, b2; if (Edge1.Dx == Edge2.Dx) { ip.Y = Edge1.Curr.Y; ip.X = TopX(Edge1, ip.Y); return; } else if (Edge1.Dx == 0) { ip.X = Edge1.Bot.X; if (IsHorizontal(Edge2)) ip.Y = Edge2.Bot.Y; else { b2 = Edge2.Bot.Y - (Edge2.Bot.X / Edge2.Dx); ip.Y = Round(ip.X / Edge2.Dx + b2); } } else if (Edge2.Dx == 0) { ip.X = Edge2.Bot.X; if (IsHorizontal(Edge1)) ip.Y = Edge1.Bot.Y; else { b1 = Edge1.Bot.Y - (Edge1.Bot.X / Edge1.Dx); ip.Y = Round(ip.X / Edge1.Dx + b1); } } else { b1 = Edge1.Bot.X - Edge1.Bot.Y * Edge1.Dx; b2 = Edge2.Bot.X - Edge2.Bot.Y * Edge2.Dx; double q = (b2-b1) / (Edge1.Dx - Edge2.Dx); ip.Y = Round(q); if (std::fabs(Edge1.Dx) < std::fabs(Edge2.Dx)) ip.X = Round(Edge1.Dx * q + b1); else ip.X = Round(Edge2.Dx * q + b2); } if (ip.Y < Edge1.Top.Y || ip.Y < Edge2.Top.Y) { if (Edge1.Top.Y > Edge2.Top.Y) ip.Y = Edge1.Top.Y; else ip.Y = Edge2.Top.Y; if (std::fabs(Edge1.Dx) < std::fabs(Edge2.Dx)) ip.X = TopX(Edge1, ip.Y); else ip.X = TopX(Edge2, ip.Y); } //finally, don't allow 'ip' to be BELOW curr.Y (ie bottom of scanbeam) ... if (ip.Y > Edge1.Curr.Y) { ip.Y = Edge1.Curr.Y; //use the more vertical edge to derive X ... if (std::fabs(Edge1.Dx) > std::fabs(Edge2.Dx)) ip.X = TopX(Edge2, ip.Y); else ip.X = TopX(Edge1, ip.Y); } } void ReversePolyPtLinks(OutPt *pp) { if (!pp) return; OutPt *pp1, *pp2; pp1 = pp; do { pp2 = pp1->Next; pp1->Next = pp1->Prev; pp1->Prev = pp2; pp1 = pp2; } while( pp1 != pp ); } void DisposeOutPts(OutPt*& pp) { if (pp == 0) return; pp->Prev->Next = 0; while( pp ) { OutPt *tmpPp = pp; pp = pp->Next; delete tmpPp; } } inline void InitEdge(TEdge* e, TEdge* eNext, TEdge* ePrev, const IntPoint& Pt) { std::memset(e, 0, sizeof(TEdge)); e->Next = eNext; e->Prev = ePrev; e->Curr = Pt; e->OutIdx = Unassigned; } void InitEdge2(TEdge& e, PolyType Pt) { if (e.Curr.Y >= e.Next->Curr.Y) { e.Bot = e.Curr; e.Top = e.Next->Curr; } else { e.Top = e.Curr; e.Bot = e.Next->Curr; } SetDx(e); e.PolyTyp = Pt; } TEdge* RemoveEdge(TEdge* e) { //removes e from double_linked_list (but without removing from memory) e->Prev->Next = e->Next; e->Next->Prev = e->Prev; TEdge* result = e->Next; e->Prev = 0; //flag as removed (see ClipperBase.Clear) return result; } inline void ReverseHorizontal(TEdge &e) { //swap horizontal edges' Top and Bottom x's so they follow the natural //progression of the bounds - ie so their xbots will align with the //adjoining lower edge. [Helpful in the ProcessHorizontal() method.] std::swap(e.Top.X, e.Bot.X); #ifdef use_xyz std::swap(e.Top.Z, e.Bot.Z); #endif } void SwapPoints(IntPoint &pt1, IntPoint &pt2) { IntPoint tmp = pt1; pt1 = pt2; pt2 = tmp; } bool GetOverlapSegment(IntPoint pt1a, IntPoint pt1b, IntPoint pt2a, IntPoint pt2b, IntPoint &pt1, IntPoint &pt2) { //precondition: segments are Collinear. if (Abs(pt1a.X - pt1b.X) > Abs(pt1a.Y - pt1b.Y)) { if (pt1a.X > pt1b.X) SwapPoints(pt1a, pt1b); if (pt2a.X > pt2b.X) SwapPoints(pt2a, pt2b); if (pt1a.X > pt2a.X) pt1 = pt1a; else pt1 = pt2a; if (pt1b.X < pt2b.X) pt2 = pt1b; else pt2 = pt2b; return pt1.X < pt2.X; } else { if (pt1a.Y < pt1b.Y) SwapPoints(pt1a, pt1b); if (pt2a.Y < pt2b.Y) SwapPoints(pt2a, pt2b); if (pt1a.Y < pt2a.Y) pt1 = pt1a; else pt1 = pt2a; if (pt1b.Y > pt2b.Y) pt2 = pt1b; else pt2 = pt2b; return pt1.Y > pt2.Y; } } bool FirstIsBottomPt(const OutPt* btmPt1, const OutPt* btmPt2) { OutPt *p = btmPt1->Prev; while ((p->Pt == btmPt1->Pt) && (p != btmPt1)) p = p->Prev; double dx1p = std::fabs(GetDx(btmPt1->Pt, p->Pt)); p = btmPt1->Next; while ((p->Pt == btmPt1->Pt) && (p != btmPt1)) p = p->Next; double dx1n = std::fabs(GetDx(btmPt1->Pt, p->Pt)); p = btmPt2->Prev; while ((p->Pt == btmPt2->Pt) && (p != btmPt2)) p = p->Prev; double dx2p = std::fabs(GetDx(btmPt2->Pt, p->Pt)); p = btmPt2->Next; while ((p->Pt == btmPt2->Pt) && (p != btmPt2)) p = p->Next; double dx2n = std::fabs(GetDx(btmPt2->Pt, p->Pt)); if (std::max(dx1p, dx1n) == std::max(dx2p, dx2n) && std::min(dx1p, dx1n) == std::min(dx2p, dx2n)) return Area(btmPt1) > 0; //if otherwise identical use orientation else return (dx1p >= dx2p && dx1p >= dx2n) || (dx1n >= dx2p && dx1n >= dx2n); } OutPt* GetBottomPt(OutPt *pp) { OutPt* dups = 0; OutPt* p = pp->Next; while (p != pp) { if (p->Pt.Y > pp->Pt.Y) { pp = p; dups = 0; } else if (p->Pt.Y == pp->Pt.Y && p->Pt.X <= pp->Pt.X) { if (p->Pt.X < pp->Pt.X) { dups = 0; pp = p; } else { if (p->Next != pp && p->Prev != pp) dups = p; } } p = p->Next; } if (dups) { //there appears to be at least 2 vertices at BottomPt so ... while (dups != p) { if (!FirstIsBottomPt(p, dups)) pp = dups; dups = dups->Next; while (dups->Pt != pp->Pt) dups = dups->Next; } } return pp; } bool <API key>(const IntPoint pt1, const IntPoint pt2, const IntPoint pt3) { if ((pt1 == pt3) || (pt1 == pt2) || (pt3 == pt2)) return false; else if (pt1.X != pt3.X) return (pt2.X > pt1.X) == (pt2.X < pt3.X); else return (pt2.Y > pt1.Y) == (pt2.Y < pt3.Y); } bool HorzSegmentsOverlap(cInt seg1a, cInt seg1b, cInt seg2a, cInt seg2b) { if (seg1a > seg1b) std::swap(seg1a, seg1b); if (seg2a > seg2b) std::swap(seg2a, seg2b); return (seg1a < seg2b) && (seg2a < seg1b); } // ClipperBase class methods ... ClipperBase::ClipperBase() //constructor { m_CurrentLM = m_MinimaList.begin(); //begin() == end() here m_UseFullRange = false; } ClipperBase::~ClipperBase() //destructor { Clear(); } void RangeTest(const IntPoint& Pt, bool& useFullRange) { if (useFullRange) { if (Pt.X > hiRange || Pt.Y > hiRange || -Pt.X > hiRange || -Pt.Y > hiRange) throw clipperException("Coordinate outside allowed range"); } else if (Pt.X > loRange|| Pt.Y > loRange || -Pt.X > loRange || -Pt.Y > loRange) { useFullRange = true; RangeTest(Pt, useFullRange); } } TEdge* FindNextLocMin(TEdge* E) { for (;;) { while (E->Bot != E->Prev->Bot || E->Curr == E->Top) E = E->Next; if (!IsHorizontal(*E) && !IsHorizontal(*E->Prev)) break; while (IsHorizontal(*E->Prev)) E = E->Prev; TEdge* E2 = E; while (IsHorizontal(*E)) E = E->Next; if (E->Top.Y == E->Prev->Bot.Y) continue; //ie just an intermediate horz. if (E2->Prev->Bot.X < E->Bot.X) E = E2; break; } return E; } TEdge* ClipperBase::ProcessBound(TEdge* E, bool NextIsForward) { TEdge *Result = E; TEdge *Horz = 0; if (E->OutIdx == Skip) { //if edges still remain in the current bound beyond the skip edge then //create another LocMin and call ProcessBound once more if (NextIsForward) { while (E->Top.Y == E->Next->Bot.Y) E = E->Next; //don't include top horizontals when parsing a bound a second time, //they will be contained in the opposite bound ... while (E != Result && IsHorizontal(*E)) E = E->Prev; } else { while (E->Top.Y == E->Prev->Bot.Y) E = E->Prev; while (E != Result && IsHorizontal(*E)) E = E->Next; } if (E == Result) { if (NextIsForward) Result = E->Next; else Result = E->Prev; } else { //there are more edges in the bound beyond result starting with E if (NextIsForward) E = Result->Next; else E = Result->Prev; MinimaList::value_type locMin; locMin.Y = E->Bot.Y; locMin.LeftBound = 0; locMin.RightBound = E; E->WindDelta = 0; Result = ProcessBound(E, NextIsForward); m_MinimaList.push_back(locMin); } return Result; } TEdge *EStart; if (IsHorizontal(*E)) { //We need to be careful with open paths because this may not be a //true local minima (ie E may be following a skip edge). //Also, consecutive horz. edges may start heading left before going right. if (NextIsForward) EStart = E->Prev; else EStart = E->Next; if (IsHorizontal(*EStart)) //ie an adjoining horizontal skip edge { if (EStart->Bot.X != E->Bot.X && EStart->Top.X != E->Bot.X) ReverseHorizontal(*E); } else if (EStart->Bot.X != E->Bot.X) ReverseHorizontal(*E); } EStart = E; if (NextIsForward) { while (Result->Top.Y == Result->Next->Bot.Y && Result->Next->OutIdx != Skip) Result = Result->Next; if (IsHorizontal(*Result) && Result->Next->OutIdx != Skip) { //nb: at the top of a bound, horizontals are added to the bound //only when the preceding edge attaches to the horizontal's left vertex //unless a Skip edge is encountered when that becomes the top divide Horz = Result; while (IsHorizontal(*Horz->Prev)) Horz = Horz->Prev; if (Horz->Prev->Top.X > Result->Next->Top.X) Result = Horz->Prev; } while (E != Result) { E->NextInLML = E->Next; if (IsHorizontal(*E) && E != EStart && E->Bot.X != E->Prev->Top.X) ReverseHorizontal(*E); E = E->Next; } if (IsHorizontal(*E) && E != EStart && E->Bot.X != E->Prev->Top.X) ReverseHorizontal(*E); Result = Result->Next; //move to the edge just beyond current bound } else { while (Result->Top.Y == Result->Prev->Bot.Y && Result->Prev->OutIdx != Skip) Result = Result->Prev; if (IsHorizontal(*Result) && Result->Prev->OutIdx != Skip) { Horz = Result; while (IsHorizontal(*Horz->Next)) Horz = Horz->Next; if (Horz->Next->Top.X == Result->Prev->Top.X || Horz->Next->Top.X > Result->Prev->Top.X) Result = Horz->Next; } while (E != Result) { E->NextInLML = E->Prev; if (IsHorizontal(*E) && E != EStart && E->Bot.X != E->Next->Top.X) ReverseHorizontal(*E); E = E->Prev; } if (IsHorizontal(*E) && E != EStart && E->Bot.X != E->Next->Top.X) ReverseHorizontal(*E); Result = Result->Prev; //move to the edge just beyond current bound } return Result; } bool ClipperBase::AddPath(const Path &pg, PolyType PolyTyp, bool Closed) { #ifdef use_lines if (!Closed && PolyTyp == ptClip) throw clipperException("AddPath: Open paths must be subject."); #else if (!Closed) throw clipperException("AddPath: Open paths have been disabled."); #endif int highI = (int)pg.size() -1; if (Closed) while (highI > 0 && (pg[highI] == pg[0])) --highI; while (highI > 0 && (pg[highI] == pg[highI -1])) --highI; if ((Closed && highI < 2) || (!Closed && highI < 1)) return false; //create a new edge array ... TEdge *edges = new TEdge [highI +1]; bool IsFlat = true; //1. Basic (first) edge initialization ... try { edges[1].Curr = pg[1]; RangeTest(pg[0], m_UseFullRange); RangeTest(pg[highI], m_UseFullRange); InitEdge(&edges[0], &edges[1], &edges[highI], pg[0]); InitEdge(&edges[highI], &edges[0], &edges[highI-1], pg[highI]); for (int i = highI - 1; i >= 1; --i) { RangeTest(pg[i], m_UseFullRange); InitEdge(&edges[i], &edges[i+1], &edges[i-1], pg[i]); } } catch(...) { delete [] edges; throw; //range test fails } TEdge *eStart = &edges[0]; //2. Remove duplicate vertices, and (when closed) collinear edges ... TEdge *E = eStart, *eLoopStop = eStart; for (;;) { //nb: allows matching start and end points when not Closed ... if (E->Curr == E->Next->Curr && (Closed || E->Next != eStart)) { if (E == E->Next) break; if (E == eStart) eStart = E->Next; E = RemoveEdge(E); eLoopStop = E; continue; } if (E->Prev == E->Next) break; //only two vertices else if (Closed && SlopesEqual(E->Prev->Curr, E->Curr, E->Next->Curr, m_UseFullRange) && (!m_PreserveCollinear || !<API key>(E->Prev->Curr, E->Curr, E->Next->Curr))) { //Collinear edges are allowed for open paths but in closed paths //the default is to merge adjacent collinear edges into a single edge. //However, if the PreserveCollinear property is enabled, only overlapping //collinear edges (ie spikes) will be removed from closed paths. if (E == eStart) eStart = E->Next; E = RemoveEdge(E); E = E->Prev; eLoopStop = E; continue; } E = E->Next; if ((E == eLoopStop) || (!Closed && E->Next == eStart)) break; } if ((!Closed && (E == E->Next)) || (Closed && (E->Prev == E->Next))) { delete [] edges; return false; } if (!Closed) { m_HasOpenPaths = true; eStart->Prev->OutIdx = Skip; } //3. Do second stage of edge initialization ... E = eStart; do { InitEdge2(*E, PolyTyp); E = E->Next; if (IsFlat && E->Curr.Y != eStart->Curr.Y) IsFlat = false; } while (E != eStart); //4. Finally, add edge bounds to LocalMinima list ... //Totally flat paths must be handled differently when adding them //to LocalMinima list to avoid endless loops etc ... if (IsFlat) { if (Closed) { delete [] edges; return false; } E->Prev->OutIdx = Skip; MinimaList::value_type locMin; locMin.Y = E->Bot.Y; locMin.LeftBound = 0; locMin.RightBound = E; locMin.RightBound->Side = esRight; locMin.RightBound->WindDelta = 0; for (;;) { if (E->Bot.X != E->Prev->Top.X) ReverseHorizontal(*E); if (E->Next->OutIdx == Skip) break; E->NextInLML = E->Next; E = E->Next; } m_MinimaList.push_back(locMin); m_edges.push_back(edges); return true; } m_edges.push_back(edges); bool leftBoundIsForward; TEdge* EMin = 0; //workaround to avoid an endless loop in the while loop below when //open paths have matching start and end points ... if (E->Prev->Bot == E->Prev->Top) E = E->Next; for (;;) { E = FindNextLocMin(E); if (E == EMin) break; else if (!EMin) EMin = E; //E and E.Prev now share a local minima (left aligned if horizontal). //Compare their slopes to find which starts which bound ... MinimaList::value_type locMin; locMin.Y = E->Bot.Y; if (E->Dx < E->Prev->Dx) { locMin.LeftBound = E->Prev; locMin.RightBound = E; leftBoundIsForward = false; //Q.nextInLML = Q.prev } else { locMin.LeftBound = E; locMin.RightBound = E->Prev; leftBoundIsForward = true; //Q.nextInLML = Q.next } if (!Closed) locMin.LeftBound->WindDelta = 0; else if (locMin.LeftBound->Next == locMin.RightBound) locMin.LeftBound->WindDelta = -1; else locMin.LeftBound->WindDelta = 1; locMin.RightBound->WindDelta = -locMin.LeftBound->WindDelta; E = ProcessBound(locMin.LeftBound, leftBoundIsForward); if (E->OutIdx == Skip) E = ProcessBound(E, leftBoundIsForward); TEdge* E2 = ProcessBound(locMin.RightBound, !leftBoundIsForward); if (E2->OutIdx == Skip) E2 = ProcessBound(E2, !leftBoundIsForward); if (locMin.LeftBound->OutIdx == Skip) locMin.LeftBound = 0; else if (locMin.RightBound->OutIdx == Skip) locMin.RightBound = 0; m_MinimaList.push_back(locMin); if (!leftBoundIsForward) E = E2; } return true; } bool ClipperBase::AddPaths(const Paths &ppg, PolyType PolyTyp, bool Closed) { bool result = false; for (Paths::size_type i = 0; i < ppg.size(); ++i) if (AddPath(ppg[i], PolyTyp, Closed)) result = true; return result; } void ClipperBase::Clear() { <API key>(); for (EdgeList::size_type i = 0; i < m_edges.size(); ++i) { TEdge* edges = m_edges[i]; delete [] edges; } m_edges.clear(); m_UseFullRange = false; m_HasOpenPaths = false; } void ClipperBase::Reset() { m_CurrentLM = m_MinimaList.begin(); if (m_CurrentLM == m_MinimaList.end()) return; //ie nothing to process std::sort(m_MinimaList.begin(), m_MinimaList.end(), LocMinSorter()); m_Scanbeam = ScanbeamList(); //clears/resets priority_queue //reset all edges ... for (MinimaList::iterator lm = m_MinimaList.begin(); lm != m_MinimaList.end(); ++lm) { InsertScanbeam(lm->Y); TEdge* e = lm->LeftBound; if (e) { e->Curr = e->Bot; e->Side = esLeft; e->OutIdx = Unassigned; } e = lm->RightBound; if (e) { e->Curr = e->Bot; e->Side = esRight; e->OutIdx = Unassigned; } } m_ActiveEdges = 0; m_CurrentLM = m_MinimaList.begin(); } void ClipperBase::<API key>() { m_MinimaList.clear(); m_CurrentLM = m_MinimaList.begin(); } bool ClipperBase::PopLocalMinima(cInt Y, const LocalMinimum *&locMin) { if (m_CurrentLM == m_MinimaList.end() || (*m_CurrentLM).Y != Y) return false; locMin = &(*m_CurrentLM); ++m_CurrentLM; return true; } IntRect ClipperBase::GetBounds() { IntRect result; MinimaList::iterator lm = m_MinimaList.begin(); if (lm == m_MinimaList.end()) { result.left = result.top = result.right = result.bottom = 0; return result; } result.left = lm->LeftBound->Bot.X; result.top = lm->LeftBound->Bot.Y; result.right = lm->LeftBound->Bot.X; result.bottom = lm->LeftBound->Bot.Y; while (lm != m_MinimaList.end()) { //todo - needs fixing for open paths result.bottom = std::max(result.bottom, lm->LeftBound->Bot.Y); TEdge* e = lm->LeftBound; for (;;) { TEdge* bottomE = e; while (e->NextInLML) { if (e->Bot.X < result.left) result.left = e->Bot.X; if (e->Bot.X > result.right) result.right = e->Bot.X; e = e->NextInLML; } result.left = std::min(result.left, e->Bot.X); result.right = std::max(result.right, e->Bot.X); result.left = std::min(result.left, e->Top.X); result.right = std::max(result.right, e->Top.X); result.top = std::min(result.top, e->Top.Y); if (bottomE == lm->LeftBound) e = lm->RightBound; else break; } ++lm; } return result; } void ClipperBase::InsertScanbeam(const cInt Y) { m_Scanbeam.push(Y); } bool ClipperBase::PopScanbeam(cInt &Y) { if (m_Scanbeam.empty()) return false; Y = m_Scanbeam.top(); m_Scanbeam.pop(); while (!m_Scanbeam.empty() && Y == m_Scanbeam.top()) { m_Scanbeam.pop(); } // Pop duplicates. return true; } void ClipperBase::DisposeAllOutRecs(){ for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i) DisposeOutRec(i); m_PolyOuts.clear(); } void ClipperBase::DisposeOutRec(PolyOutList::size_type index) { OutRec *outRec = m_PolyOuts[index]; if (outRec->Pts) DisposeOutPts(outRec->Pts); delete outRec; m_PolyOuts[index] = 0; } void ClipperBase::DeleteFromAEL(TEdge *e) { TEdge* AelPrev = e->PrevInAEL; TEdge* AelNext = e->NextInAEL; if (!AelPrev && !AelNext && (e != m_ActiveEdges)) return; //already deleted if (AelPrev) AelPrev->NextInAEL = AelNext; else m_ActiveEdges = AelNext; if (AelNext) AelNext->PrevInAEL = AelPrev; e->NextInAEL = 0; e->PrevInAEL = 0; } OutRec* ClipperBase::CreateOutRec() { OutRec* result = new OutRec; result->IsHole = false; result->IsOpen = false; result->FirstLeft = 0; result->Pts = 0; result->BottomPt = 0; result->PolyNd = 0; m_PolyOuts.push_back(result); result->Idx = (int)m_PolyOuts.size() - 1; return result; } void ClipperBase::SwapPositionsInAEL(TEdge *Edge1, TEdge *Edge2) { //check that one or other edge hasn't already been removed from AEL ... if (Edge1->NextInAEL == Edge1->PrevInAEL || Edge2->NextInAEL == Edge2->PrevInAEL) return; if (Edge1->NextInAEL == Edge2) { TEdge* Next = Edge2->NextInAEL; if (Next) Next->PrevInAEL = Edge1; TEdge* Prev = Edge1->PrevInAEL; if (Prev) Prev->NextInAEL = Edge2; Edge2->PrevInAEL = Prev; Edge2->NextInAEL = Edge1; Edge1->PrevInAEL = Edge2; Edge1->NextInAEL = Next; } else if (Edge2->NextInAEL == Edge1) { TEdge* Next = Edge1->NextInAEL; if (Next) Next->PrevInAEL = Edge2; TEdge* Prev = Edge2->PrevInAEL; if (Prev) Prev->NextInAEL = Edge1; Edge1->PrevInAEL = Prev; Edge1->NextInAEL = Edge2; Edge2->PrevInAEL = Edge1; Edge2->NextInAEL = Next; } else { TEdge* Next = Edge1->NextInAEL; TEdge* Prev = Edge1->PrevInAEL; Edge1->NextInAEL = Edge2->NextInAEL; if (Edge1->NextInAEL) Edge1->NextInAEL->PrevInAEL = Edge1; Edge1->PrevInAEL = Edge2->PrevInAEL; if (Edge1->PrevInAEL) Edge1->PrevInAEL->NextInAEL = Edge1; Edge2->NextInAEL = Next; if (Edge2->NextInAEL) Edge2->NextInAEL->PrevInAEL = Edge2; Edge2->PrevInAEL = Prev; if (Edge2->PrevInAEL) Edge2->PrevInAEL->NextInAEL = Edge2; } if (!Edge1->PrevInAEL) m_ActiveEdges = Edge1; else if (!Edge2->PrevInAEL) m_ActiveEdges = Edge2; } void ClipperBase::UpdateEdgeIntoAEL(TEdge *&e) { if (!e->NextInLML) throw clipperException("UpdateEdgeIntoAEL: invalid call"); e->NextInLML->OutIdx = e->OutIdx; TEdge* AelPrev = e->PrevInAEL; TEdge* AelNext = e->NextInAEL; if (AelPrev) AelPrev->NextInAEL = e->NextInLML; else m_ActiveEdges = e->NextInLML; if (AelNext) AelNext->PrevInAEL = e->NextInLML; e->NextInLML->Side = e->Side; e->NextInLML->WindDelta = e->WindDelta; e->NextInLML->WindCnt = e->WindCnt; e->NextInLML->WindCnt2 = e->WindCnt2; e = e->NextInLML; e->Curr = e->Bot; e->PrevInAEL = AelPrev; e->NextInAEL = AelNext; if (!IsHorizontal(*e)) InsertScanbeam(e->Top.Y); } bool ClipperBase::LocalMinimaPending() { return (m_CurrentLM != m_MinimaList.end()); } // TClipper methods ... Clipper::Clipper(int initOptions) : ClipperBase() //constructor { m_ExecuteLocked = false; m_UseFullRange = false; m_ReverseOutput = ((initOptions & ioReverseSolution) != 0); m_StrictSimple = ((initOptions & ioStrictlySimple) != 0); m_PreserveCollinear = ((initOptions & ioPreserveCollinear) != 0); m_HasOpenPaths = false; #ifdef use_xyz m_ZFill = 0; #endif } #ifdef use_xyz void Clipper::ZFillFunction(ZFillCallback zFillFunc) { m_ZFill = zFillFunc; } #endif bool Clipper::Execute(ClipType clipType, Paths &solution, PolyFillType fillType) { return Execute(clipType, solution, fillType, fillType); } bool Clipper::Execute(ClipType clipType, PolyTree &polytree, PolyFillType fillType) { return Execute(clipType, polytree, fillType, fillType); } bool Clipper::Execute(ClipType clipType, Paths &solution, PolyFillType subjFillType, PolyFillType clipFillType) { if( m_ExecuteLocked ) return false; if (m_HasOpenPaths) throw clipperException("Error: PolyTree struct is needed for open path clipping."); m_ExecuteLocked = true; solution.resize(0); m_SubjFillType = subjFillType; m_ClipFillType = clipFillType; m_ClipType = clipType; m_UsingPolyTree = false; bool succeeded = ExecuteInternal(); if (succeeded) BuildResult(solution); DisposeAllOutRecs(); m_ExecuteLocked = false; return succeeded; } bool Clipper::Execute(ClipType clipType, PolyTree& polytree, PolyFillType subjFillType, PolyFillType clipFillType) { if( m_ExecuteLocked ) return false; m_ExecuteLocked = true; m_SubjFillType = subjFillType; m_ClipFillType = clipFillType; m_ClipType = clipType; m_UsingPolyTree = true; bool succeeded = ExecuteInternal(); if (succeeded) BuildResult2(polytree); DisposeAllOutRecs(); m_ExecuteLocked = false; return succeeded; } void Clipper::FixHoleLinkage(OutRec &outrec) { //skip OutRecs that (a) contain outermost polygons or //(b) already have the correct owner/child linkage ... if (!outrec.FirstLeft || (outrec.IsHole != outrec.FirstLeft->IsHole && outrec.FirstLeft->Pts)) return; OutRec* orfl = outrec.FirstLeft; while (orfl && ((orfl->IsHole == outrec.IsHole) || !orfl->Pts)) orfl = orfl->FirstLeft; outrec.FirstLeft = orfl; } bool Clipper::ExecuteInternal() { bool succeeded = true; try { Reset(); m_Maxima = MaximaList(); m_SortedEdges = 0; succeeded = true; cInt botY, topY; if (!PopScanbeam(botY)) return false; <API key>(botY); while (PopScanbeam(topY) || LocalMinimaPending()) { ProcessHorizontals(); ClearGhostJoins(); if (!<API key>(topY)) { succeeded = false; break; } <API key>(topY); botY = topY; <API key>(botY); } } catch(...) { succeeded = false; } if (succeeded) { //fix orientations ... for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i) { OutRec *outRec = m_PolyOuts[i]; if (!outRec->Pts || outRec->IsOpen) continue; if ((outRec->IsHole ^ m_ReverseOutput) == (Area(*outRec) > 0)) ReversePolyPtLinks(outRec->Pts); } if (!m_Joins.empty()) JoinCommonEdges(); //unfortunately FixupOutPolygon() must be done after JoinCommonEdges() for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i) { OutRec *outRec = m_PolyOuts[i]; if (!outRec->Pts) continue; if (outRec->IsOpen) FixupOutPolyline(*outRec); else FixupOutPolygon(*outRec); } if (m_StrictSimple) DoSimplePolygons(); } ClearJoins(); ClearGhostJoins(); return succeeded; } void Clipper::SetWindingCount(TEdge &edge) { TEdge *e = edge.PrevInAEL; //find the edge of the same polytype that immediately preceeds 'edge' in AEL while (e && ((e->PolyTyp != edge.PolyTyp) || (e->WindDelta == 0))) e = e->PrevInAEL; if (!e) { if (edge.WindDelta == 0) { PolyFillType pft = (edge.PolyTyp == ptSubject ? m_SubjFillType : m_ClipFillType); edge.WindCnt = (pft == pftNegative ? -1 : 1); } else edge.WindCnt = edge.WindDelta; edge.WindCnt2 = 0; e = m_ActiveEdges; //ie get ready to calc WindCnt2 } else if (edge.WindDelta == 0 && m_ClipType != ctUnion) { edge.WindCnt = 1; edge.WindCnt2 = e->WindCnt2; e = e->NextInAEL; //ie get ready to calc WindCnt2 } else if (IsEvenOddFillType(edge)) { //EvenOdd filling ... if (edge.WindDelta == 0) { //are we inside a subj polygon ... bool Inside = true; TEdge *e2 = e->PrevInAEL; while (e2) { if (e2->PolyTyp == e->PolyTyp && e2->WindDelta != 0) Inside = !Inside; e2 = e2->PrevInAEL; } edge.WindCnt = (Inside ? 0 : 1); } else { edge.WindCnt = edge.WindDelta; } edge.WindCnt2 = e->WindCnt2; e = e->NextInAEL; //ie get ready to calc WindCnt2 } else { //nonZero, Positive or Negative filling ... if (e->WindCnt * e->WindDelta < 0) { //prev edge is 'decreasing' WindCount (WC) toward zero //so we're outside the previous polygon ... if (Abs(e->WindCnt) > 1) { //outside prev poly but still inside another. //when reversing direction of prev poly use the same WC if (e->WindDelta * edge.WindDelta < 0) edge.WindCnt = e->WindCnt; //otherwise continue to 'decrease' WC ... else edge.WindCnt = e->WindCnt + edge.WindDelta; } else //now outside all polys of same polytype so set own WC ... edge.WindCnt = (edge.WindDelta == 0 ? 1 : edge.WindDelta); } else { //prev edge is 'increasing' WindCount (WC) away from zero //so we're inside the previous polygon ... if (edge.WindDelta == 0) edge.WindCnt = (e->WindCnt < 0 ? e->WindCnt - 1 : e->WindCnt + 1); //if wind direction is reversing prev then use same WC else if (e->WindDelta * edge.WindDelta < 0) edge.WindCnt = e->WindCnt; //otherwise add to WC ... else edge.WindCnt = e->WindCnt + edge.WindDelta; } edge.WindCnt2 = e->WindCnt2; e = e->NextInAEL; //ie get ready to calc WindCnt2 } //update WindCnt2 ... if (<API key>(edge)) { //EvenOdd filling ... while (e != &edge) { if (e->WindDelta != 0) edge.WindCnt2 = (edge.WindCnt2 == 0 ? 1 : 0); e = e->NextInAEL; } } else { //nonZero, Positive or Negative filling ... while ( e != &edge ) { edge.WindCnt2 += e->WindDelta; e = e->NextInAEL; } } } bool Clipper::IsEvenOddFillType(const TEdge& edge) const { if (edge.PolyTyp == ptSubject) return m_SubjFillType == pftEvenOdd; else return m_ClipFillType == pftEvenOdd; } bool Clipper::<API key>(const TEdge& edge) const { if (edge.PolyTyp == ptSubject) return m_ClipFillType == pftEvenOdd; else return m_SubjFillType == pftEvenOdd; } bool Clipper::IsContributing(const TEdge& edge) const { PolyFillType pft, pft2; if (edge.PolyTyp == ptSubject) { pft = m_SubjFillType; pft2 = m_ClipFillType; } else { pft = m_ClipFillType; pft2 = m_SubjFillType; } switch(pft) { case pftEvenOdd: //return false if a subj line has been flagged as inside a subj polygon if (edge.WindDelta == 0 && edge.WindCnt != 1) return false; break; case pftNonZero: if (Abs(edge.WindCnt) != 1) return false; break; case pftPositive: if (edge.WindCnt != 1) return false; break; default: //pftNegative if (edge.WindCnt != -1) return false; } switch(m_ClipType) { case ctIntersection: switch(pft2) { case pftEvenOdd: case pftNonZero: return (edge.WindCnt2 != 0); case pftPositive: return (edge.WindCnt2 > 0); default: return (edge.WindCnt2 < 0); } break; case ctUnion: switch(pft2) { case pftEvenOdd: case pftNonZero: return (edge.WindCnt2 == 0); case pftPositive: return (edge.WindCnt2 <= 0); default: return (edge.WindCnt2 >= 0); } break; case ctDifference: if (edge.PolyTyp == ptSubject) switch(pft2) { case pftEvenOdd: case pftNonZero: return (edge.WindCnt2 == 0); case pftPositive: return (edge.WindCnt2 <= 0); default: return (edge.WindCnt2 >= 0); } else switch(pft2) { case pftEvenOdd: case pftNonZero: return (edge.WindCnt2 != 0); case pftPositive: return (edge.WindCnt2 > 0); default: return (edge.WindCnt2 < 0); } break; case ctXor: if (edge.WindDelta == 0) //XOr always contributing unless open switch(pft2) { case pftEvenOdd: case pftNonZero: return (edge.WindCnt2 == 0); case pftPositive: return (edge.WindCnt2 <= 0); default: return (edge.WindCnt2 >= 0); } else return true; break; default: return true; } } OutPt* Clipper::AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &Pt) { OutPt* result; TEdge *e, *prevE; if (IsHorizontal(*e2) || ( e1->Dx > e2->Dx )) { result = AddOutPt(e1, Pt); e2->OutIdx = e1->OutIdx; e1->Side = esLeft; e2->Side = esRight; e = e1; if (e->PrevInAEL == e2) prevE = e2->PrevInAEL; else prevE = e->PrevInAEL; } else { result = AddOutPt(e2, Pt); e1->OutIdx = e2->OutIdx; e1->Side = esRight; e2->Side = esLeft; e = e2; if (e->PrevInAEL == e1) prevE = e1->PrevInAEL; else prevE = e->PrevInAEL; } if (prevE && prevE->OutIdx >= 0 && prevE->Top.Y < Pt.Y && e->Top.Y < Pt.Y) { cInt xPrev = TopX(*prevE, Pt.Y); cInt xE = TopX(*e, Pt.Y); if (xPrev == xE && (e->WindDelta != 0) && (prevE->WindDelta != 0) && SlopesEqual(IntPoint(xPrev, Pt.Y), prevE->Top, IntPoint(xE, Pt.Y), e->Top, m_UseFullRange)) { OutPt* outPt = AddOutPt(prevE, Pt); AddJoin(result, outPt, e->Top); } } return result; } void Clipper::AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &Pt) { AddOutPt( e1, Pt ); if (e2->WindDelta == 0) AddOutPt(e2, Pt); if( e1->OutIdx == e2->OutIdx ) { e1->OutIdx = Unassigned; e2->OutIdx = Unassigned; } else if (e1->OutIdx < e2->OutIdx) AppendPolygon(e1, e2); else AppendPolygon(e2, e1); } void Clipper::AddEdgeToSEL(TEdge *edge) { //SEL pointers in PEdge are reused to build a list of horizontal edges. //However, we don't need to worry about order with horizontal edge processing. if( !m_SortedEdges ) { m_SortedEdges = edge; edge->PrevInSEL = 0; edge->NextInSEL = 0; } else { edge->NextInSEL = m_SortedEdges; edge->PrevInSEL = 0; m_SortedEdges->PrevInSEL = edge; m_SortedEdges = edge; } } bool Clipper::PopEdgeFromSEL(TEdge *&edge) { if (!m_SortedEdges) return false; edge = m_SortedEdges; DeleteFromSEL(m_SortedEdges); return true; } void Clipper::CopyAELToSEL() { TEdge* e = m_ActiveEdges; m_SortedEdges = e; while ( e ) { e->PrevInSEL = e->PrevInAEL; e->NextInSEL = e->NextInAEL; e = e->NextInAEL; } } void Clipper::AddJoin(OutPt *op1, OutPt *op2, const IntPoint OffPt) { Join* j = new Join; j->OutPt1 = op1; j->OutPt2 = op2; j->OffPt = OffPt; m_Joins.push_back(j); } void Clipper::ClearJoins() { for (JoinList::size_type i = 0; i < m_Joins.size(); i++) delete m_Joins[i]; m_Joins.resize(0); } void Clipper::ClearGhostJoins() { for (JoinList::size_type i = 0; i < m_GhostJoins.size(); i++) delete m_GhostJoins[i]; m_GhostJoins.resize(0); } void Clipper::AddGhostJoin(OutPt *op, const IntPoint OffPt) { Join* j = new Join; j->OutPt1 = op; j->OutPt2 = 0; j->OffPt = OffPt; m_GhostJoins.push_back(j); } void Clipper::<API key>(const cInt botY) { const LocalMinimum *lm; while (PopLocalMinima(botY, lm)) { TEdge* lb = lm->LeftBound; TEdge* rb = lm->RightBound; OutPt *Op1 = 0; if (!lb) { //nb: don't insert LB into either AEL or SEL InsertEdgeIntoAEL(rb, 0); SetWindingCount(*rb); if (IsContributing(*rb)) Op1 = AddOutPt(rb, rb->Bot); } else if (!rb) { InsertEdgeIntoAEL(lb, 0); SetWindingCount(*lb); if (IsContributing(*lb)) Op1 = AddOutPt(lb, lb->Bot); InsertScanbeam(lb->Top.Y); } else { InsertEdgeIntoAEL(lb, 0); InsertEdgeIntoAEL(rb, lb); SetWindingCount( *lb ); rb->WindCnt = lb->WindCnt; rb->WindCnt2 = lb->WindCnt2; if (IsContributing(*lb)) Op1 = AddLocalMinPoly(lb, rb, lb->Bot); InsertScanbeam(lb->Top.Y); } if (rb) { if (IsHorizontal(*rb)) { AddEdgeToSEL(rb); if (rb->NextInLML) InsertScanbeam(rb->NextInLML->Top.Y); } else InsertScanbeam( rb->Top.Y ); } if (!lb || !rb) continue; //if any output polygons share an edge, they'll need joining later ... if (Op1 && IsHorizontal(*rb) && m_GhostJoins.size() > 0 && (rb->WindDelta != 0)) { for (JoinList::size_type i = 0; i < m_GhostJoins.size(); ++i) { Join* jr = m_GhostJoins[i]; //if the horizontal Rb and a 'ghost' horizontal overlap, then convert //the 'ghost' join to a real join ready for later ... if (HorzSegmentsOverlap(jr->OutPt1->Pt.X, jr->OffPt.X, rb->Bot.X, rb->Top.X)) AddJoin(jr->OutPt1, Op1, jr->OffPt); } } if (lb->OutIdx >= 0 && lb->PrevInAEL && lb->PrevInAEL->Curr.X == lb->Bot.X && lb->PrevInAEL->OutIdx >= 0 && SlopesEqual(lb->PrevInAEL->Bot, lb->PrevInAEL->Top, lb->Curr, lb->Top, m_UseFullRange) && (lb->WindDelta != 0) && (lb->PrevInAEL->WindDelta != 0)) { OutPt *Op2 = AddOutPt(lb->PrevInAEL, lb->Bot); AddJoin(Op1, Op2, lb->Top); } if(lb->NextInAEL != rb) { if (rb->OutIdx >= 0 && rb->PrevInAEL->OutIdx >= 0 && SlopesEqual(rb->PrevInAEL->Curr, rb->PrevInAEL->Top, rb->Curr, rb->Top, m_UseFullRange) && (rb->WindDelta != 0) && (rb->PrevInAEL->WindDelta != 0)) { OutPt *Op2 = AddOutPt(rb->PrevInAEL, rb->Bot); AddJoin(Op1, Op2, rb->Top); } TEdge* e = lb->NextInAEL; if (e) { while( e != rb ) { //nb: For calculating winding counts etc, IntersectEdges() assumes //that param1 will be to the Right of param2 ABOVE the intersection ... IntersectEdges(rb , e , lb->Curr); //order important here e = e->NextInAEL; } } } } } void Clipper::DeleteFromSEL(TEdge *e) { TEdge* SelPrev = e->PrevInSEL; TEdge* SelNext = e->NextInSEL; if( !SelPrev && !SelNext && (e != m_SortedEdges) ) return; //already deleted if( SelPrev ) SelPrev->NextInSEL = SelNext; else m_SortedEdges = SelNext; if( SelNext ) SelNext->PrevInSEL = SelPrev; e->NextInSEL = 0; e->PrevInSEL = 0; } #ifdef use_xyz void Clipper::SetZ(IntPoint& pt, TEdge& e1, TEdge& e2) { if (pt.Z != 0 || !m_ZFill) return; else if (pt == e1.Bot) pt.Z = e1.Bot.Z; else if (pt == e1.Top) pt.Z = e1.Top.Z; else if (pt == e2.Bot) pt.Z = e2.Bot.Z; else if (pt == e2.Top) pt.Z = e2.Top.Z; else (*m_ZFill)(e1.Bot, e1.Top, e2.Bot, e2.Top, pt); } #endif void Clipper::IntersectEdges(TEdge *e1, TEdge *e2, IntPoint &Pt) { bool e1Contributing = ( e1->OutIdx >= 0 ); bool e2Contributing = ( e2->OutIdx >= 0 ); #ifdef use_xyz SetZ(Pt, *e1, *e2); #endif #ifdef use_lines //if either edge is on an OPEN path ... if (e1->WindDelta == 0 || e2->WindDelta == 0) { //ignore subject-subject open path intersections UNLESS they //are both open paths, AND they are both 'contributing maximas' ... if (e1->WindDelta == 0 && e2->WindDelta == 0) return; //if intersecting a subj line with a subj poly ... else if (e1->PolyTyp == e2->PolyTyp && e1->WindDelta != e2->WindDelta && m_ClipType == ctUnion) { if (e1->WindDelta == 0) { if (e2Contributing) { AddOutPt(e1, Pt); if (e1Contributing) e1->OutIdx = Unassigned; } } else { if (e1Contributing) { AddOutPt(e2, Pt); if (e2Contributing) e2->OutIdx = Unassigned; } } } else if (e1->PolyTyp != e2->PolyTyp) { //toggle subj open path OutIdx on/off when Abs(clip.WndCnt) == 1 ... if ((e1->WindDelta == 0) && abs(e2->WindCnt) == 1 && (m_ClipType != ctUnion || e2->WindCnt2 == 0)) { AddOutPt(e1, Pt); if (e1Contributing) e1->OutIdx = Unassigned; } else if ((e2->WindDelta == 0) && (abs(e1->WindCnt) == 1) && (m_ClipType != ctUnion || e1->WindCnt2 == 0)) { AddOutPt(e2, Pt); if (e2Contributing) e2->OutIdx = Unassigned; } } return; } #endif //update winding counts... //assumes that e1 will be to the Right of e2 ABOVE the intersection if ( e1->PolyTyp == e2->PolyTyp ) { if ( IsEvenOddFillType( *e1) ) { int oldE1WindCnt = e1->WindCnt; e1->WindCnt = e2->WindCnt; e2->WindCnt = oldE1WindCnt; } else { if (e1->WindCnt + e2->WindDelta == 0 ) e1->WindCnt = -e1->WindCnt; else e1->WindCnt += e2->WindDelta; if ( e2->WindCnt - e1->WindDelta == 0 ) e2->WindCnt = -e2->WindCnt; else e2->WindCnt -= e1->WindDelta; } } else { if (!IsEvenOddFillType(*e2)) e1->WindCnt2 += e2->WindDelta; else e1->WindCnt2 = ( e1->WindCnt2 == 0 ) ? 1 : 0; if (!IsEvenOddFillType(*e1)) e2->WindCnt2 -= e1->WindDelta; else e2->WindCnt2 = ( e2->WindCnt2 == 0 ) ? 1 : 0; } PolyFillType e1FillType, e2FillType, e1FillType2, e2FillType2; if (e1->PolyTyp == ptSubject) { e1FillType = m_SubjFillType; e1FillType2 = m_ClipFillType; } else { e1FillType = m_ClipFillType; e1FillType2 = m_SubjFillType; } if (e2->PolyTyp == ptSubject) { e2FillType = m_SubjFillType; e2FillType2 = m_ClipFillType; } else { e2FillType = m_ClipFillType; e2FillType2 = m_SubjFillType; } cInt e1Wc, e2Wc; switch (e1FillType) { case pftPositive: e1Wc = e1->WindCnt; break; case pftNegative: e1Wc = -e1->WindCnt; break; default: e1Wc = Abs(e1->WindCnt); } switch(e2FillType) { case pftPositive: e2Wc = e2->WindCnt; break; case pftNegative: e2Wc = -e2->WindCnt; break; default: e2Wc = Abs(e2->WindCnt); } if ( e1Contributing && e2Contributing ) { if ((e1Wc != 0 && e1Wc != 1) || (e2Wc != 0 && e2Wc != 1) || (e1->PolyTyp != e2->PolyTyp && m_ClipType != ctXor) ) { AddLocalMaxPoly(e1, e2, Pt); } else { AddOutPt(e1, Pt); AddOutPt(e2, Pt); SwapSides( *e1 , *e2 ); SwapPolyIndexes( *e1 , *e2 ); } } else if ( e1Contributing ) { if (e2Wc == 0 || e2Wc == 1) { AddOutPt(e1, Pt); SwapSides(*e1, *e2); SwapPolyIndexes(*e1, *e2); } } else if ( e2Contributing ) { if (e1Wc == 0 || e1Wc == 1) { AddOutPt(e2, Pt); SwapSides(*e1, *e2); SwapPolyIndexes(*e1, *e2); } } else if ( (e1Wc == 0 || e1Wc == 1) && (e2Wc == 0 || e2Wc == 1)) { //neither edge is currently contributing ... cInt e1Wc2, e2Wc2; switch (e1FillType2) { case pftPositive: e1Wc2 = e1->WindCnt2; break; case pftNegative : e1Wc2 = -e1->WindCnt2; break; default: e1Wc2 = Abs(e1->WindCnt2); } switch (e2FillType2) { case pftPositive: e2Wc2 = e2->WindCnt2; break; case pftNegative: e2Wc2 = -e2->WindCnt2; break; default: e2Wc2 = Abs(e2->WindCnt2); } if (e1->PolyTyp != e2->PolyTyp) { AddLocalMinPoly(e1, e2, Pt); } else if (e1Wc == 1 && e2Wc == 1) switch( m_ClipType ) { case ctIntersection: if (e1Wc2 > 0 && e2Wc2 > 0) AddLocalMinPoly(e1, e2, Pt); break; case ctUnion: if ( e1Wc2 <= 0 && e2Wc2 <= 0 ) AddLocalMinPoly(e1, e2, Pt); break; case ctDifference: if (((e1->PolyTyp == ptClip) && (e1Wc2 > 0) && (e2Wc2 > 0)) || ((e1->PolyTyp == ptSubject) && (e1Wc2 <= 0) && (e2Wc2 <= 0))) AddLocalMinPoly(e1, e2, Pt); break; case ctXor: AddLocalMinPoly(e1, e2, Pt); } else SwapSides( *e1, *e2 ); } } void Clipper::SetHoleState(TEdge *e, OutRec *outrec) { TEdge *e2 = e->PrevInAEL; TEdge *eTmp = 0; while (e2) { if (e2->OutIdx >= 0 && e2->WindDelta != 0) { if (!eTmp) eTmp = e2; else if (eTmp->OutIdx == e2->OutIdx) eTmp = 0; } e2 = e2->PrevInAEL; } if (!eTmp) { outrec->FirstLeft = 0; outrec->IsHole = false; } else { outrec->FirstLeft = m_PolyOuts[eTmp->OutIdx]; outrec->IsHole = !outrec->FirstLeft->IsHole; } } OutRec* GetLowermostRec(OutRec *outRec1, OutRec *outRec2) { //work out which polygon fragment has the correct hole state ... if (!outRec1->BottomPt) outRec1->BottomPt = GetBottomPt(outRec1->Pts); if (!outRec2->BottomPt) outRec2->BottomPt = GetBottomPt(outRec2->Pts); OutPt *OutPt1 = outRec1->BottomPt; OutPt *OutPt2 = outRec2->BottomPt; if (OutPt1->Pt.Y > OutPt2->Pt.Y) return outRec1; else if (OutPt1->Pt.Y < OutPt2->Pt.Y) return outRec2; else if (OutPt1->Pt.X < OutPt2->Pt.X) return outRec1; else if (OutPt1->Pt.X > OutPt2->Pt.X) return outRec2; else if (OutPt1->Next == OutPt1) return outRec2; else if (OutPt2->Next == OutPt2) return outRec1; else if (FirstIsBottomPt(OutPt1, OutPt2)) return outRec1; else return outRec2; } bool <API key>(OutRec* outRec1, OutRec* outRec2) { do { outRec1 = outRec1->FirstLeft; if (outRec1 == outRec2) return true; } while (outRec1); return false; } OutRec* Clipper::GetOutRec(int Idx) { OutRec* outrec = m_PolyOuts[Idx]; while (outrec != m_PolyOuts[outrec->Idx]) outrec = m_PolyOuts[outrec->Idx]; return outrec; } void Clipper::AppendPolygon(TEdge *e1, TEdge *e2) { //get the start and ends of both output polygons ... OutRec *outRec1 = m_PolyOuts[e1->OutIdx]; OutRec *outRec2 = m_PolyOuts[e2->OutIdx]; OutRec *holeStateRec; if (<API key>(outRec1, outRec2)) holeStateRec = outRec2; else if (<API key>(outRec2, outRec1)) holeStateRec = outRec1; else holeStateRec = GetLowermostRec(outRec1, outRec2); //get the start and ends of both output polygons and //join e2 poly onto e1 poly and delete pointers to e2 ... OutPt* p1_lft = outRec1->Pts; OutPt* p1_rt = p1_lft->Prev; OutPt* p2_lft = outRec2->Pts; OutPt* p2_rt = p2_lft->Prev; //join e2 poly onto e1 poly and delete pointers to e2 ... if( e1->Side == esLeft ) { if( e2->Side == esLeft ) { //z y x a b c ReversePolyPtLinks(p2_lft); p2_lft->Next = p1_lft; p1_lft->Prev = p2_lft; p1_rt->Next = p2_rt; p2_rt->Prev = p1_rt; outRec1->Pts = p2_rt; } else { //x y z a b c p2_rt->Next = p1_lft; p1_lft->Prev = p2_rt; p2_lft->Prev = p1_rt; p1_rt->Next = p2_lft; outRec1->Pts = p2_lft; } } else { if( e2->Side == esRight ) { //a b c z y x ReversePolyPtLinks(p2_lft); p1_rt->Next = p2_rt; p2_rt->Prev = p1_rt; p2_lft->Next = p1_lft; p1_lft->Prev = p2_lft; } else { //a b c x y z p1_rt->Next = p2_lft; p2_lft->Prev = p1_rt; p1_lft->Prev = p2_rt; p2_rt->Next = p1_lft; } } outRec1->BottomPt = 0; if (holeStateRec == outRec2) { if (outRec2->FirstLeft != outRec1) outRec1->FirstLeft = outRec2->FirstLeft; outRec1->IsHole = outRec2->IsHole; } outRec2->Pts = 0; outRec2->BottomPt = 0; outRec2->FirstLeft = outRec1; int OKIdx = e1->OutIdx; int ObsoleteIdx = e2->OutIdx; e1->OutIdx = Unassigned; //nb: safe because we only get here via AddLocalMaxPoly e2->OutIdx = Unassigned; TEdge* e = m_ActiveEdges; while( e ) { if( e->OutIdx == ObsoleteIdx ) { e->OutIdx = OKIdx; e->Side = e1->Side; break; } e = e->NextInAEL; } outRec2->Idx = outRec1->Idx; } OutPt* Clipper::AddOutPt(TEdge *e, const IntPoint &pt) { if( e->OutIdx < 0 ) { OutRec *outRec = CreateOutRec(); outRec->IsOpen = (e->WindDelta == 0); OutPt* newOp = new OutPt; outRec->Pts = newOp; newOp->Idx = outRec->Idx; newOp->Pt = pt; newOp->Next = newOp; newOp->Prev = newOp; if (!outRec->IsOpen) SetHoleState(e, outRec); e->OutIdx = outRec->Idx; return newOp; } else { OutRec *outRec = m_PolyOuts[e->OutIdx]; //OutRec.Pts is the 'Left-most' point & OutRec.Pts.Prev is the 'Right-most' OutPt* op = outRec->Pts; bool ToFront = (e->Side == esLeft); if (ToFront && (pt == op->Pt)) return op; else if (!ToFront && (pt == op->Prev->Pt)) return op->Prev; OutPt* newOp = new OutPt; newOp->Idx = outRec->Idx; newOp->Pt = pt; newOp->Next = op; newOp->Prev = op->Prev; newOp->Prev->Next = newOp; op->Prev = newOp; if (ToFront) outRec->Pts = newOp; return newOp; } } OutPt* Clipper::GetLastOutPt(TEdge *e) { OutRec *outRec = m_PolyOuts[e->OutIdx]; if (e->Side == esLeft) return outRec->Pts; else return outRec->Pts->Prev; } void Clipper::ProcessHorizontals() { TEdge* horzEdge; while (PopEdgeFromSEL(horzEdge)) ProcessHorizontal(horzEdge); } inline bool IsMinima(TEdge *e) { return e && (e->Prev->NextInLML != e) && (e->Next->NextInLML != e); } inline bool IsMaxima(TEdge *e, const cInt Y) { return e && e->Top.Y == Y && !e->NextInLML; } inline bool IsIntermediate(TEdge *e, const cInt Y) { return e->Top.Y == Y && e->NextInLML; } TEdge *GetMaximaPair(TEdge *e) { if ((e->Next->Top == e->Top) && !e->Next->NextInLML) return e->Next; else if ((e->Prev->Top == e->Top) && !e->Prev->NextInLML) return e->Prev; else return 0; } TEdge *GetMaximaPairEx(TEdge *e) { //as GetMaximaPair() but returns 0 if MaxPair isn't in AEL (unless it's horizontal) TEdge* result = GetMaximaPair(e); if (result && (result->OutIdx == Skip || (result->NextInAEL == result->PrevInAEL && !IsHorizontal(*result)))) return 0; return result; } void Clipper::SwapPositionsInSEL(TEdge *Edge1, TEdge *Edge2) { if( !( Edge1->NextInSEL ) && !( Edge1->PrevInSEL ) ) return; if( !( Edge2->NextInSEL ) && !( Edge2->PrevInSEL ) ) return; if( Edge1->NextInSEL == Edge2 ) { TEdge* Next = Edge2->NextInSEL; if( Next ) Next->PrevInSEL = Edge1; TEdge* Prev = Edge1->PrevInSEL; if( Prev ) Prev->NextInSEL = Edge2; Edge2->PrevInSEL = Prev; Edge2->NextInSEL = Edge1; Edge1->PrevInSEL = Edge2; Edge1->NextInSEL = Next; } else if( Edge2->NextInSEL == Edge1 ) { TEdge* Next = Edge1->NextInSEL; if( Next ) Next->PrevInSEL = Edge2; TEdge* Prev = Edge2->PrevInSEL; if( Prev ) Prev->NextInSEL = Edge1; Edge1->PrevInSEL = Prev; Edge1->NextInSEL = Edge2; Edge2->PrevInSEL = Edge1; Edge2->NextInSEL = Next; } else { TEdge* Next = Edge1->NextInSEL; TEdge* Prev = Edge1->PrevInSEL; Edge1->NextInSEL = Edge2->NextInSEL; if( Edge1->NextInSEL ) Edge1->NextInSEL->PrevInSEL = Edge1; Edge1->PrevInSEL = Edge2->PrevInSEL; if( Edge1->PrevInSEL ) Edge1->PrevInSEL->NextInSEL = Edge1; Edge2->NextInSEL = Next; if( Edge2->NextInSEL ) Edge2->NextInSEL->PrevInSEL = Edge2; Edge2->PrevInSEL = Prev; if( Edge2->PrevInSEL ) Edge2->PrevInSEL->NextInSEL = Edge2; } if( !Edge1->PrevInSEL ) m_SortedEdges = Edge1; else if( !Edge2->PrevInSEL ) m_SortedEdges = Edge2; } TEdge* GetNextInAEL(TEdge *e, Direction dir) { return dir == dLeftToRight ? e->NextInAEL : e->PrevInAEL; } void GetHorzDirection(TEdge& HorzEdge, Direction& Dir, cInt& Left, cInt& Right) { if (HorzEdge.Bot.X < HorzEdge.Top.X) { Left = HorzEdge.Bot.X; Right = HorzEdge.Top.X; Dir = dLeftToRight; } else { Left = HorzEdge.Top.X; Right = HorzEdge.Bot.X; Dir = dRightToLeft; } } void Clipper::ProcessHorizontal(TEdge *horzEdge) { Direction dir; cInt horzLeft, horzRight; bool IsOpen = (horzEdge->WindDelta == 0); GetHorzDirection(*horzEdge, dir, horzLeft, horzRight); TEdge* eLastHorz = horzEdge, *eMaxPair = 0; while (eLastHorz->NextInLML && IsHorizontal(*eLastHorz->NextInLML)) eLastHorz = eLastHorz->NextInLML; if (!eLastHorz->NextInLML) eMaxPair = GetMaximaPair(eLastHorz); MaximaList::const_iterator maxIt; MaximaList::<API key> maxRit; if (m_Maxima.size() > 0) { //get the first maxima in range (X) ... if (dir == dLeftToRight) { maxIt = m_Maxima.begin(); while (maxIt != m_Maxima.end() && *maxIt <= horzEdge->Bot.X) maxIt++; if (maxIt != m_Maxima.end() && *maxIt >= eLastHorz->Top.X) maxIt = m_Maxima.end(); } else { maxRit = m_Maxima.rbegin(); while (maxRit != m_Maxima.rend() && *maxRit > horzEdge->Bot.X) maxRit++; if (maxRit != m_Maxima.rend() && *maxRit <= eLastHorz->Top.X) maxRit = m_Maxima.rend(); } } OutPt* op1 = 0; for (;;) //loop through consec. horizontal edges { bool IsLastHorz = (horzEdge == eLastHorz); TEdge* e = GetNextInAEL(horzEdge, dir); while(e) { //this code block inserts extra coords into horizontal edges (in output //polygons) whereever maxima touch these horizontal edges. This helps //'simplifying' polygons (ie if the Simplify property is set). if (m_Maxima.size() > 0) { if (dir == dLeftToRight) { while (maxIt != m_Maxima.end() && *maxIt < e->Curr.X) { if (horzEdge->OutIdx >= 0 && !IsOpen) AddOutPt(horzEdge, IntPoint(*maxIt, horzEdge->Bot.Y)); maxIt++; } } else { while (maxRit != m_Maxima.rend() && *maxRit > e->Curr.X) { if (horzEdge->OutIdx >= 0 && !IsOpen) AddOutPt(horzEdge, IntPoint(*maxRit, horzEdge->Bot.Y)); maxRit++; } } }; if ((dir == dLeftToRight && e->Curr.X > horzRight) || (dir == dRightToLeft && e->Curr.X < horzLeft)) break; //Also break if we've got to the end of an intermediate horizontal edge ... //nb: Smaller Dx's are to the right of larger Dx's ABOVE the horizontal. if (e->Curr.X == horzEdge->Top.X && horzEdge->NextInLML && e->Dx < horzEdge->NextInLML->Dx) break; if (horzEdge->OutIdx >= 0 && !IsOpen) //note: may be done multiple times { #ifdef use_xyz if (dir == dLeftToRight) SetZ(e->Curr, *horzEdge, *e); else SetZ(e->Curr, *e, *horzEdge); #endif op1 = AddOutPt(horzEdge, e->Curr); TEdge* eNextHorz = m_SortedEdges; while (eNextHorz) { if (eNextHorz->OutIdx >= 0 && HorzSegmentsOverlap(horzEdge->Bot.X, horzEdge->Top.X, eNextHorz->Bot.X, eNextHorz->Top.X)) { OutPt* op2 = GetLastOutPt(eNextHorz); AddJoin(op2, op1, eNextHorz->Top); } eNextHorz = eNextHorz->NextInSEL; } AddGhostJoin(op1, horzEdge->Bot); } //OK, so far we're still in range of the horizontal Edge but make sure //we're at the last of consec. horizontals when matching with eMaxPair if(e == eMaxPair && IsLastHorz) { if (horzEdge->OutIdx >= 0) AddLocalMaxPoly(horzEdge, eMaxPair, horzEdge->Top); DeleteFromAEL(horzEdge); DeleteFromAEL(eMaxPair); return; } if(dir == dLeftToRight) { IntPoint Pt = IntPoint(e->Curr.X, horzEdge->Curr.Y); IntersectEdges(horzEdge, e, Pt); } else { IntPoint Pt = IntPoint(e->Curr.X, horzEdge->Curr.Y); IntersectEdges( e, horzEdge, Pt); } TEdge* eNext = GetNextInAEL(e, dir); SwapPositionsInAEL( horzEdge, e ); e = eNext; } //end while(e) //Break out of loop if HorzEdge.NextInLML is not also horizontal ... if (!horzEdge->NextInLML || !IsHorizontal(*horzEdge->NextInLML)) break; UpdateEdgeIntoAEL(horzEdge); if (horzEdge->OutIdx >= 0) AddOutPt(horzEdge, horzEdge->Bot); GetHorzDirection(*horzEdge, dir, horzLeft, horzRight); } //end for (;;) if (horzEdge->OutIdx >= 0 && !op1) { op1 = GetLastOutPt(horzEdge); TEdge* eNextHorz = m_SortedEdges; while (eNextHorz) { if (eNextHorz->OutIdx >= 0 && HorzSegmentsOverlap(horzEdge->Bot.X, horzEdge->Top.X, eNextHorz->Bot.X, eNextHorz->Top.X)) { OutPt* op2 = GetLastOutPt(eNextHorz); AddJoin(op2, op1, eNextHorz->Top); } eNextHorz = eNextHorz->NextInSEL; } AddGhostJoin(op1, horzEdge->Top); } if (horzEdge->NextInLML) { if(horzEdge->OutIdx >= 0) { op1 = AddOutPt( horzEdge, horzEdge->Top); UpdateEdgeIntoAEL(horzEdge); if (horzEdge->WindDelta == 0) return; //nb: HorzEdge is no longer horizontal here TEdge* ePrev = horzEdge->PrevInAEL; TEdge* eNext = horzEdge->NextInAEL; if (ePrev && ePrev->Curr.X == horzEdge->Bot.X && ePrev->Curr.Y == horzEdge->Bot.Y && ePrev->WindDelta != 0 && (ePrev->OutIdx >= 0 && ePrev->Curr.Y > ePrev->Top.Y && SlopesEqual(*horzEdge, *ePrev, m_UseFullRange))) { OutPt* op2 = AddOutPt(ePrev, horzEdge->Bot); AddJoin(op1, op2, horzEdge->Top); } else if (eNext && eNext->Curr.X == horzEdge->Bot.X && eNext->Curr.Y == horzEdge->Bot.Y && eNext->WindDelta != 0 && eNext->OutIdx >= 0 && eNext->Curr.Y > eNext->Top.Y && SlopesEqual(*horzEdge, *eNext, m_UseFullRange)) { OutPt* op2 = AddOutPt(eNext, horzEdge->Bot); AddJoin(op1, op2, horzEdge->Top); } } else UpdateEdgeIntoAEL(horzEdge); } else { if (horzEdge->OutIdx >= 0) AddOutPt(horzEdge, horzEdge->Top); DeleteFromAEL(horzEdge); } } bool Clipper::<API key>(const cInt topY) { if( !m_ActiveEdges ) return true; try { BuildIntersectList(topY); size_t IlSize = m_IntersectList.size(); if (IlSize == 0) return true; if (IlSize == 1 || <API key>()) <API key>(); else return false; } catch(...) { m_SortedEdges = 0; <API key>(); throw clipperException("<API key> error"); } m_SortedEdges = 0; return true; } void Clipper::<API key>() { for (size_t i = 0; i < m_IntersectList.size(); ++i ) delete m_IntersectList[i]; m_IntersectList.clear(); } void Clipper::BuildIntersectList(const cInt topY) { if ( !m_ActiveEdges ) return; //prepare for sorting ... TEdge* e = m_ActiveEdges; m_SortedEdges = e; while( e ) { e->PrevInSEL = e->PrevInAEL; e->NextInSEL = e->NextInAEL; e->Curr.X = TopX( *e, topY ); e = e->NextInAEL; } //bubblesort ... bool isModified; do { isModified = false; e = m_SortedEdges; while( e->NextInSEL ) { TEdge *eNext = e->NextInSEL; IntPoint Pt; if(e->Curr.X > eNext->Curr.X) { IntersectPoint(*e, *eNext, Pt); if (Pt.Y < topY) Pt = IntPoint(TopX(*e, topY), topY); IntersectNode * newNode = new IntersectNode; newNode->Edge1 = e; newNode->Edge2 = eNext; newNode->Pt = Pt; m_IntersectList.push_back(newNode); SwapPositionsInSEL(e, eNext); isModified = true; } else e = eNext; } if( e->PrevInSEL ) e->PrevInSEL->NextInSEL = 0; else break; } while ( isModified ); m_SortedEdges = 0; //important } void Clipper::<API key>() { for (size_t i = 0; i < m_IntersectList.size(); ++i) { IntersectNode* iNode = m_IntersectList[i]; { IntersectEdges( iNode->Edge1, iNode->Edge2, iNode->Pt); SwapPositionsInAEL( iNode->Edge1 , iNode->Edge2 ); } delete iNode; } m_IntersectList.clear(); } bool IntersectListSort(IntersectNode* node1, IntersectNode* node2) { return node2->Pt.Y < node1->Pt.Y; } inline bool EdgesAdjacent(const IntersectNode &inode) { return (inode.Edge1->NextInSEL == inode.Edge2) || (inode.Edge1->PrevInSEL == inode.Edge2); } bool Clipper::<API key>() { //pre-condition: intersections are sorted Bottom-most first. //Now it's crucial that intersections are made only between adjacent edges, //so to ensure this the order of intersections may need adjusting ... CopyAELToSEL(); std::sort(m_IntersectList.begin(), m_IntersectList.end(), IntersectListSort); size_t cnt = m_IntersectList.size(); for (size_t i = 0; i < cnt; ++i) { if (!EdgesAdjacent(*m_IntersectList[i])) { size_t j = i + 1; while (j < cnt && !EdgesAdjacent(*m_IntersectList[j])) j++; if (j == cnt) return false; std::swap(m_IntersectList[i], m_IntersectList[j]); } SwapPositionsInSEL(m_IntersectList[i]->Edge1, m_IntersectList[i]->Edge2); } return true; } void Clipper::DoMaxima(TEdge *e) { TEdge* eMaxPair = GetMaximaPairEx(e); if (!eMaxPair) { if (e->OutIdx >= 0) AddOutPt(e, e->Top); DeleteFromAEL(e); return; } TEdge* eNext = e->NextInAEL; while(eNext && eNext != eMaxPair) { IntersectEdges(e, eNext, e->Top); SwapPositionsInAEL(e, eNext); eNext = e->NextInAEL; } if(e->OutIdx == Unassigned && eMaxPair->OutIdx == Unassigned) { DeleteFromAEL(e); DeleteFromAEL(eMaxPair); } else if( e->OutIdx >= 0 && eMaxPair->OutIdx >= 0 ) { if (e->OutIdx >= 0) AddLocalMaxPoly(e, eMaxPair, e->Top); DeleteFromAEL(e); DeleteFromAEL(eMaxPair); } #ifdef use_lines else if (e->WindDelta == 0) { if (e->OutIdx >= 0) { AddOutPt(e, e->Top); e->OutIdx = Unassigned; } DeleteFromAEL(e); if (eMaxPair->OutIdx >= 0) { AddOutPt(eMaxPair, e->Top); eMaxPair->OutIdx = Unassigned; } DeleteFromAEL(eMaxPair); } #endif else throw clipperException("DoMaxima error"); } void Clipper::<API key>(const cInt topY) { TEdge* e = m_ActiveEdges; while( e ) { //1. process maxima, treating them as if they're 'bent' horizontal edges, // but exclude maxima with horizontal edges. nb: e can't be a horizontal. bool IsMaximaEdge = IsMaxima(e, topY); if(IsMaximaEdge) { TEdge* eMaxPair = GetMaximaPairEx(e); IsMaximaEdge = (!eMaxPair || !IsHorizontal(*eMaxPair)); } if(IsMaximaEdge) { if (m_StrictSimple) m_Maxima.push_back(e->Top.X); TEdge* ePrev = e->PrevInAEL; DoMaxima(e); if( !ePrev ) e = m_ActiveEdges; else e = ePrev->NextInAEL; } else { //2. promote horizontal edges, otherwise update Curr.X and Curr.Y ... if (IsIntermediate(e, topY) && IsHorizontal(*e->NextInLML)) { UpdateEdgeIntoAEL(e); if (e->OutIdx >= 0) AddOutPt(e, e->Bot); AddEdgeToSEL(e); } else { e->Curr.X = TopX( *e, topY ); e->Curr.Y = topY; #ifdef use_xyz e->Curr.Z = topY == e->Top.Y ? e->Top.Z : (topY == e->Bot.Y ? e->Bot.Z : 0); #endif } //When StrictlySimple and 'e' is being touched by another edge, then //make sure both edges have a vertex here ... if (m_StrictSimple) { TEdge* ePrev = e->PrevInAEL; if ((e->OutIdx >= 0) && (e->WindDelta != 0) && ePrev && (ePrev->OutIdx >= 0) && (ePrev->Curr.X == e->Curr.X) && (ePrev->WindDelta != 0)) { IntPoint pt = e->Curr; #ifdef use_xyz SetZ(pt, *ePrev, *e); #endif OutPt* op = AddOutPt(ePrev, pt); OutPt* op2 = AddOutPt(e, pt); AddJoin(op, op2, pt); //StrictlySimple (type-3) join } } e = e->NextInAEL; } } //3. Process horizontals at the Top of the scanbeam ... m_Maxima.sort(); ProcessHorizontals(); m_Maxima.clear(); //4. Promote intermediate vertices ... e = m_ActiveEdges; while(e) { if(IsIntermediate(e, topY)) { OutPt* op = 0; if( e->OutIdx >= 0 ) op = AddOutPt(e, e->Top); UpdateEdgeIntoAEL(e); //if output polygons share an edge, they'll need joining later ... TEdge* ePrev = e->PrevInAEL; TEdge* eNext = e->NextInAEL; if (ePrev && ePrev->Curr.X == e->Bot.X && ePrev->Curr.Y == e->Bot.Y && op && ePrev->OutIdx >= 0 && ePrev->Curr.Y > ePrev->Top.Y && SlopesEqual(e->Curr, e->Top, ePrev->Curr, ePrev->Top, m_UseFullRange) && (e->WindDelta != 0) && (ePrev->WindDelta != 0)) { OutPt* op2 = AddOutPt(ePrev, e->Bot); AddJoin(op, op2, e->Top); } else if (eNext && eNext->Curr.X == e->Bot.X && eNext->Curr.Y == e->Bot.Y && op && eNext->OutIdx >= 0 && eNext->Curr.Y > eNext->Top.Y && SlopesEqual(e->Curr, e->Top, eNext->Curr, eNext->Top, m_UseFullRange) && (e->WindDelta != 0) && (eNext->WindDelta != 0)) { OutPt* op2 = AddOutPt(eNext, e->Bot); AddJoin(op, op2, e->Top); } } e = e->NextInAEL; } } void Clipper::FixupOutPolyline(OutRec &outrec) { OutPt *pp = outrec.Pts; OutPt *lastPP = pp->Prev; while (pp != lastPP) { pp = pp->Next; if (pp->Pt == pp->Prev->Pt) { if (pp == lastPP) lastPP = pp->Prev; OutPt *tmpPP = pp->Prev; tmpPP->Next = pp->Next; pp->Next->Prev = tmpPP; delete pp; pp = tmpPP; } } if (pp == pp->Prev) { DisposeOutPts(pp); outrec.Pts = 0; return; } } void Clipper::FixupOutPolygon(OutRec &outrec) { //FixupOutPolygon() - removes duplicate points and simplifies consecutive //parallel edges by removing the middle vertex. OutPt *lastOK = 0; outrec.BottomPt = 0; OutPt *pp = outrec.Pts; bool preserveCol = m_PreserveCollinear || m_StrictSimple; for (;;) { if (pp->Prev == pp || pp->Prev == pp->Next) { DisposeOutPts(pp); outrec.Pts = 0; return; } //test for duplicate points and collinear edges ... if ((pp->Pt == pp->Next->Pt) || (pp->Pt == pp->Prev->Pt) || (SlopesEqual(pp->Prev->Pt, pp->Pt, pp->Next->Pt, m_UseFullRange) && (!preserveCol || !<API key>(pp->Prev->Pt, pp->Pt, pp->Next->Pt)))) { lastOK = 0; OutPt *tmp = pp; pp->Prev->Next = pp->Next; pp->Next->Prev = pp->Prev; pp = pp->Prev; delete tmp; } else if (pp == lastOK) break; else { if (!lastOK) lastOK = pp; pp = pp->Next; } } outrec.Pts = pp; } int PointCount(OutPt *Pts) { if (!Pts) return 0; int result = 0; OutPt* p = Pts; do { result++; p = p->Next; } while (p != Pts); return result; } void Clipper::BuildResult(Paths &polys) { polys.reserve(m_PolyOuts.size()); for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i) { if (!m_PolyOuts[i]->Pts) continue; Path pg; OutPt* p = m_PolyOuts[i]->Pts->Prev; int cnt = PointCount(p); if (cnt < 2) continue; pg.reserve(cnt); for (int i = 0; i < cnt; ++i) { pg.push_back(p->Pt); p = p->Prev; } polys.push_back(pg); } } void Clipper::BuildResult2(PolyTree& polytree) { polytree.Clear(); polytree.AllNodes.reserve(m_PolyOuts.size()); //add each output polygon/contour to polytree ... for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); i++) { OutRec* outRec = m_PolyOuts[i]; int cnt = PointCount(outRec->Pts); if ((outRec->IsOpen && cnt < 2) || (!outRec->IsOpen && cnt < 3)) continue; FixHoleLinkage(*outRec); PolyNode* pn = new PolyNode(); //nb: polytree takes ownership of all the PolyNodes polytree.AllNodes.push_back(pn); outRec->PolyNd = pn; pn->Parent = 0; pn->Index = 0; pn->Contour.reserve(cnt); OutPt *op = outRec->Pts->Prev; for (int j = 0; j < cnt; j++) { pn->Contour.push_back(op->Pt); op = op->Prev; } } //fixup PolyNode links etc ... polytree.Childs.reserve(m_PolyOuts.size()); for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); i++) { OutRec* outRec = m_PolyOuts[i]; if (!outRec->PolyNd) continue; if (outRec->IsOpen) { outRec->PolyNd->m_IsOpen = true; polytree.AddChild(*outRec->PolyNd); } else if (outRec->FirstLeft && outRec->FirstLeft->PolyNd) outRec->FirstLeft->PolyNd->AddChild(*outRec->PolyNd); else polytree.AddChild(*outRec->PolyNd); } } void SwapIntersectNodes(IntersectNode &int1, IntersectNode &int2) { //just swap the contents (because fIntersectNodes is a single-linked-list) IntersectNode inode = int1; //gets a copy of Int1 int1.Edge1 = int2.Edge1; int1.Edge2 = int2.Edge2; int1.Pt = int2.Pt; int2.Edge1 = inode.Edge1; int2.Edge2 = inode.Edge2; int2.Pt = inode.Pt; } inline bool E2InsertsBeforeE1(TEdge &e1, TEdge &e2) { if (e2.Curr.X == e1.Curr.X) { if (e2.Top.Y > e1.Top.Y) return e2.Top.X < TopX(e1, e2.Top.Y); else return e1.Top.X > TopX(e2, e1.Top.Y); } else return e2.Curr.X < e1.Curr.X; } bool GetOverlap(const cInt a1, const cInt a2, const cInt b1, const cInt b2, cInt& Left, cInt& Right) { if (a1 < a2) { if (b1 < b2) {Left = std::max(a1,b1); Right = std::min(a2,b2);} else {Left = std::max(a1,b2); Right = std::min(a2,b1);} } else { if (b1 < b2) {Left = std::max(a2,b1); Right = std::min(a1,b2);} else {Left = std::max(a2,b2); Right = std::min(a1,b1);} } return Left < Right; } inline void UpdateOutPtIdxs(OutRec& outrec) { OutPt* op = outrec.Pts; do { op->Idx = outrec.Idx; op = op->Prev; } while(op != outrec.Pts); } void Clipper::InsertEdgeIntoAEL(TEdge *edge, TEdge* startEdge) { if(!m_ActiveEdges) { edge->PrevInAEL = 0; edge->NextInAEL = 0; m_ActiveEdges = edge; } else if(!startEdge && E2InsertsBeforeE1(*m_ActiveEdges, *edge)) { edge->PrevInAEL = 0; edge->NextInAEL = m_ActiveEdges; m_ActiveEdges->PrevInAEL = edge; m_ActiveEdges = edge; } else { if(!startEdge) startEdge = m_ActiveEdges; while(startEdge->NextInAEL && !E2InsertsBeforeE1(*startEdge->NextInAEL , *edge)) startEdge = startEdge->NextInAEL; edge->NextInAEL = startEdge->NextInAEL; if(startEdge->NextInAEL) startEdge->NextInAEL->PrevInAEL = edge; edge->PrevInAEL = startEdge; startEdge->NextInAEL = edge; } } OutPt* DupOutPt(OutPt* outPt, bool InsertAfter) { OutPt* result = new OutPt; result->Pt = outPt->Pt; result->Idx = outPt->Idx; if (InsertAfter) { result->Next = outPt->Next; result->Prev = outPt; outPt->Next->Prev = result; outPt->Next = result; } else { result->Prev = outPt->Prev; result->Next = outPt; outPt->Prev->Next = result; outPt->Prev = result; } return result; } bool JoinHorz(OutPt* op1, OutPt* op1b, OutPt* op2, OutPt* op2b, const IntPoint Pt, bool DiscardLeft) { Direction Dir1 = (op1->Pt.X > op1b->Pt.X ? dRightToLeft : dLeftToRight); Direction Dir2 = (op2->Pt.X > op2b->Pt.X ? dRightToLeft : dLeftToRight); if (Dir1 == Dir2) return false; //When DiscardLeft, we want Op1b to be on the Left of Op1, otherwise we //want Op1b to be on the Right. (And likewise with Op2 and Op2b.) //So, to facilitate this while inserting Op1b and Op2b ... //when DiscardLeft, make sure we're AT or RIGHT of Pt before adding Op1b, //otherwise make sure we're AT or LEFT of Pt. (Likewise with Op2b.) if (Dir1 == dLeftToRight) { while (op1->Next->Pt.X <= Pt.X && op1->Next->Pt.X >= op1->Pt.X && op1->Next->Pt.Y == Pt.Y) op1 = op1->Next; if (DiscardLeft && (op1->Pt.X != Pt.X)) op1 = op1->Next; op1b = DupOutPt(op1, !DiscardLeft); if (op1b->Pt != Pt) { op1 = op1b; op1->Pt = Pt; op1b = DupOutPt(op1, !DiscardLeft); } } else { while (op1->Next->Pt.X >= Pt.X && op1->Next->Pt.X <= op1->Pt.X && op1->Next->Pt.Y == Pt.Y) op1 = op1->Next; if (!DiscardLeft && (op1->Pt.X != Pt.X)) op1 = op1->Next; op1b = DupOutPt(op1, DiscardLeft); if (op1b->Pt != Pt) { op1 = op1b; op1->Pt = Pt; op1b = DupOutPt(op1, DiscardLeft); } } if (Dir2 == dLeftToRight) { while (op2->Next->Pt.X <= Pt.X && op2->Next->Pt.X >= op2->Pt.X && op2->Next->Pt.Y == Pt.Y) op2 = op2->Next; if (DiscardLeft && (op2->Pt.X != Pt.X)) op2 = op2->Next; op2b = DupOutPt(op2, !DiscardLeft); if (op2b->Pt != Pt) { op2 = op2b; op2->Pt = Pt; op2b = DupOutPt(op2, !DiscardLeft); }; } else { while (op2->Next->Pt.X >= Pt.X && op2->Next->Pt.X <= op2->Pt.X && op2->Next->Pt.Y == Pt.Y) op2 = op2->Next; if (!DiscardLeft && (op2->Pt.X != Pt.X)) op2 = op2->Next; op2b = DupOutPt(op2, DiscardLeft); if (op2b->Pt != Pt) { op2 = op2b; op2->Pt = Pt; op2b = DupOutPt(op2, DiscardLeft); }; }; if ((Dir1 == dLeftToRight) == DiscardLeft) { op1->Prev = op2; op2->Next = op1; op1b->Next = op2b; op2b->Prev = op1b; } else { op1->Next = op2; op2->Prev = op1; op1b->Prev = op2b; op2b->Next = op1b; } return true; } bool Clipper::JoinPoints(Join *j, OutRec* outRec1, OutRec* outRec2) { OutPt *op1 = j->OutPt1, *op1b; OutPt *op2 = j->OutPt2, *op2b; //There are 3 kinds of joins for output polygons ... //1. Horizontal joins where Join.OutPt1 & Join.OutPt2 are vertices anywhere //along (horizontal) collinear edges (& Join.OffPt is on the same horizontal). //2. Non-horizontal joins where Join.OutPt1 & Join.OutPt2 are at the same //location at the Bottom of the overlapping segment (& Join.OffPt is above). //3. StrictSimple joins where edges touch but are not collinear and where //Join.OutPt1, Join.OutPt2 & Join.OffPt all share the same point. bool isHorizontal = (j->OutPt1->Pt.Y == j->OffPt.Y); if (isHorizontal && (j->OffPt == j->OutPt1->Pt) && (j->OffPt == j->OutPt2->Pt)) { //Strictly Simple join ... if (outRec1 != outRec2) return false; op1b = j->OutPt1->Next; while (op1b != op1 && (op1b->Pt == j->OffPt)) op1b = op1b->Next; bool reverse1 = (op1b->Pt.Y > j->OffPt.Y); op2b = j->OutPt2->Next; while (op2b != op2 && (op2b->Pt == j->OffPt)) op2b = op2b->Next; bool reverse2 = (op2b->Pt.Y > j->OffPt.Y); if (reverse1 == reverse2) return false; if (reverse1) { op1b = DupOutPt(op1, false); op2b = DupOutPt(op2, true); op1->Prev = op2; op2->Next = op1; op1b->Next = op2b; op2b->Prev = op1b; j->OutPt1 = op1; j->OutPt2 = op1b; return true; } else { op1b = DupOutPt(op1, true); op2b = DupOutPt(op2, false); op1->Next = op2; op2->Prev = op1; op1b->Prev = op2b; op2b->Next = op1b; j->OutPt1 = op1; j->OutPt2 = op1b; return true; } } else if (isHorizontal) { //treat horizontal joins differently to non-horizontal joins since with //them we're not yet sure where the overlapping is. OutPt1.Pt & OutPt2.Pt //may be anywhere along the horizontal edge. op1b = op1; while (op1->Prev->Pt.Y == op1->Pt.Y && op1->Prev != op1b && op1->Prev != op2) op1 = op1->Prev; while (op1b->Next->Pt.Y == op1b->Pt.Y && op1b->Next != op1 && op1b->Next != op2) op1b = op1b->Next; if (op1b->Next == op1 || op1b->Next == op2) return false; //a flat 'polygon' op2b = op2; while (op2->Prev->Pt.Y == op2->Pt.Y && op2->Prev != op2b && op2->Prev != op1b) op2 = op2->Prev; while (op2b->Next->Pt.Y == op2b->Pt.Y && op2b->Next != op2 && op2b->Next != op1) op2b = op2b->Next; if (op2b->Next == op2 || op2b->Next == op1) return false; //a flat 'polygon' cInt Left, Right; //Op1 --> Op1b & Op2 --> Op2b are the extremites of the horizontal edges if (!GetOverlap(op1->Pt.X, op1b->Pt.X, op2->Pt.X, op2b->Pt.X, Left, Right)) return false; //DiscardLeftSide: when overlapping edges are joined, a spike will created //which needs to be cleaned up. However, we don't want Op1 or Op2 caught up //on the discard Side as either may still be needed for other joins ... IntPoint Pt; bool DiscardLeftSide; if (op1->Pt.X >= Left && op1->Pt.X <= Right) { Pt = op1->Pt; DiscardLeftSide = (op1->Pt.X > op1b->Pt.X); } else if (op2->Pt.X >= Left&& op2->Pt.X <= Right) { Pt = op2->Pt; DiscardLeftSide = (op2->Pt.X > op2b->Pt.X); } else if (op1b->Pt.X >= Left && op1b->Pt.X <= Right) { Pt = op1b->Pt; DiscardLeftSide = op1b->Pt.X > op1->Pt.X; } else { Pt = op2b->Pt; DiscardLeftSide = (op2b->Pt.X > op2->Pt.X); } j->OutPt1 = op1; j->OutPt2 = op2; return JoinHorz(op1, op1b, op2, op2b, Pt, DiscardLeftSide); } else { //nb: For non-horizontal joins ... // 1. Jr.OutPt1.Pt.Y == Jr.OutPt2.Pt.Y // 2. Jr.OutPt1.Pt > Jr.OffPt.Y //make sure the polygons are correctly oriented ... op1b = op1->Next; while ((op1b->Pt == op1->Pt) && (op1b != op1)) op1b = op1b->Next; bool Reverse1 = ((op1b->Pt.Y > op1->Pt.Y) || !SlopesEqual(op1->Pt, op1b->Pt, j->OffPt, m_UseFullRange)); if (Reverse1) { op1b = op1->Prev; while ((op1b->Pt == op1->Pt) && (op1b != op1)) op1b = op1b->Prev; if ((op1b->Pt.Y > op1->Pt.Y) || !SlopesEqual(op1->Pt, op1b->Pt, j->OffPt, m_UseFullRange)) return false; }; op2b = op2->Next; while ((op2b->Pt == op2->Pt) && (op2b != op2))op2b = op2b->Next; bool Reverse2 = ((op2b->Pt.Y > op2->Pt.Y) || !SlopesEqual(op2->Pt, op2b->Pt, j->OffPt, m_UseFullRange)); if (Reverse2) { op2b = op2->Prev; while ((op2b->Pt == op2->Pt) && (op2b != op2)) op2b = op2b->Prev; if ((op2b->Pt.Y > op2->Pt.Y) || !SlopesEqual(op2->Pt, op2b->Pt, j->OffPt, m_UseFullRange)) return false; } if ((op1b == op1) || (op2b == op2) || (op1b == op2b) || ((outRec1 == outRec2) && (Reverse1 == Reverse2))) return false; if (Reverse1) { op1b = DupOutPt(op1, false); op2b = DupOutPt(op2, true); op1->Prev = op2; op2->Next = op1; op1b->Next = op2b; op2b->Prev = op1b; j->OutPt1 = op1; j->OutPt2 = op1b; return true; } else { op1b = DupOutPt(op1, true); op2b = DupOutPt(op2, false); op1->Next = op2; op2->Prev = op1; op1b->Prev = op2b; op2b->Next = op1b; j->OutPt1 = op1; j->OutPt2 = op1b; return true; } } } static OutRec* ParseFirstLeft(OutRec* FirstLeft) { while (FirstLeft && !FirstLeft->Pts) FirstLeft = FirstLeft->FirstLeft; return FirstLeft; } void Clipper::FixupFirstLefts1(OutRec* OldOutRec, OutRec* NewOutRec) { //tests if NewOutRec contains the polygon before reassigning FirstLeft for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i) { OutRec* outRec = m_PolyOuts[i]; OutRec* firstLeft = ParseFirstLeft(outRec->FirstLeft); if (outRec->Pts && firstLeft == OldOutRec) { if (Poly2ContainsPoly1(outRec->Pts, NewOutRec->Pts)) outRec->FirstLeft = NewOutRec; } } } void Clipper::FixupFirstLefts2(OutRec* InnerOutRec, OutRec* OuterOutRec) { //A polygon has split into two such that one is now the inner of the other. //It's possible that these polygons now wrap around other polygons, so check //every polygon that's also contained by OuterOutRec's FirstLeft container //(including 0) to see if they've become inner to the new inner polygon ... OutRec* orfl = OuterOutRec->FirstLeft; for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i) { OutRec* outRec = m_PolyOuts[i]; if (!outRec->Pts || outRec == OuterOutRec || outRec == InnerOutRec) continue; OutRec* firstLeft = ParseFirstLeft(outRec->FirstLeft); if (firstLeft != orfl && firstLeft != InnerOutRec && firstLeft != OuterOutRec) continue; if (Poly2ContainsPoly1(outRec->Pts, InnerOutRec->Pts)) outRec->FirstLeft = InnerOutRec; else if (Poly2ContainsPoly1(outRec->Pts, OuterOutRec->Pts)) outRec->FirstLeft = OuterOutRec; else if (outRec->FirstLeft == InnerOutRec || outRec->FirstLeft == OuterOutRec) outRec->FirstLeft = orfl; } } void Clipper::FixupFirstLefts3(OutRec* OldOutRec, OutRec* NewOutRec) { //reassigns FirstLeft WITHOUT testing if NewOutRec contains the polygon for (PolyOutList::size_type i = 0; i < m_PolyOuts.size(); ++i) { OutRec* outRec = m_PolyOuts[i]; OutRec* firstLeft = ParseFirstLeft(outRec->FirstLeft); if (outRec->Pts && firstLeft == OldOutRec) outRec->FirstLeft = NewOutRec; } } void Clipper::JoinCommonEdges() { for (JoinList::size_type i = 0; i < m_Joins.size(); i++) { Join* join = m_Joins[i]; OutRec *outRec1 = GetOutRec(join->OutPt1->Idx); OutRec *outRec2 = GetOutRec(join->OutPt2->Idx); if (!outRec1->Pts || !outRec2->Pts) continue; if (outRec1->IsOpen || outRec2->IsOpen) continue; //get the polygon fragment with the correct hole state (FirstLeft) //before calling JoinPoints() ... OutRec *holeStateRec; if (outRec1 == outRec2) holeStateRec = outRec1; else if (<API key>(outRec1, outRec2)) holeStateRec = outRec2; else if (<API key>(outRec2, outRec1)) holeStateRec = outRec1; else holeStateRec = GetLowermostRec(outRec1, outRec2); if (!JoinPoints(join, outRec1, outRec2)) continue; if (outRec1 == outRec2) { //instead of joining two polygons, we've just created a new one by //splitting one polygon into two. outRec1->Pts = join->OutPt1; outRec1->BottomPt = 0; outRec2 = CreateOutRec(); outRec2->Pts = join->OutPt2; //update all OutRec2.Pts Idx's ... UpdateOutPtIdxs(*outRec2); if (Poly2ContainsPoly1(outRec2->Pts, outRec1->Pts)) { //outRec1 contains outRec2 ... outRec2->IsHole = !outRec1->IsHole; outRec2->FirstLeft = outRec1; if (m_UsingPolyTree) FixupFirstLefts2(outRec2, outRec1); if ((outRec2->IsHole ^ m_ReverseOutput) == (Area(*outRec2) > 0)) ReversePolyPtLinks(outRec2->Pts); } else if (Poly2ContainsPoly1(outRec1->Pts, outRec2->Pts)) { //outRec2 contains outRec1 ... outRec2->IsHole = outRec1->IsHole; outRec1->IsHole = !outRec2->IsHole; outRec2->FirstLeft = outRec1->FirstLeft; outRec1->FirstLeft = outRec2; if (m_UsingPolyTree) FixupFirstLefts2(outRec1, outRec2); if ((outRec1->IsHole ^ m_ReverseOutput) == (Area(*outRec1) > 0)) ReversePolyPtLinks(outRec1->Pts); } else { //the 2 polygons are completely separate ... outRec2->IsHole = outRec1->IsHole; outRec2->FirstLeft = outRec1->FirstLeft; //fixup FirstLeft pointers that may need reassigning to OutRec2 if (m_UsingPolyTree) FixupFirstLefts1(outRec1, outRec2); } } else { //joined 2 polygons together ... outRec2->Pts = 0; outRec2->BottomPt = 0; outRec2->Idx = outRec1->Idx; outRec1->IsHole = holeStateRec->IsHole; if (holeStateRec == outRec2) outRec1->FirstLeft = outRec2->FirstLeft; outRec2->FirstLeft = outRec1; if (m_UsingPolyTree) FixupFirstLefts3(outRec2, outRec1); } } } // ClipperOffset support functions ... DoublePoint GetUnitNormal(const IntPoint &pt1, const IntPoint &pt2) { if(pt2.X == pt1.X && pt2.Y == pt1.Y) return DoublePoint(0, 0); double Dx = (double)(pt2.X - pt1.X); double dy = (double)(pt2.Y - pt1.Y); double f = 1 *1.0/ std::sqrt( Dx*Dx + dy*dy ); Dx *= f; dy *= f; return DoublePoint(dy, -Dx); } // ClipperOffset class ClipperOffset::ClipperOffset(double miterLimit, double arcTolerance) { this->MiterLimit = miterLimit; this->ArcTolerance = arcTolerance; m_lowest.X = -1; } ClipperOffset::~ClipperOffset() { Clear(); } void ClipperOffset::Clear() { for (int i = 0; i < m_polyNodes.ChildCount(); ++i) delete m_polyNodes.Childs[i]; m_polyNodes.Childs.clear(); m_lowest.X = -1; } void ClipperOffset::AddPath(const Path& path, JoinType joinType, EndType endType) { int highI = (int)path.size() - 1; if (highI < 0) return; PolyNode* newNode = new PolyNode(); newNode->m_jointype = joinType; newNode->m_endtype = endType; //strip duplicate points from path and also get index to the lowest point ... if (endType == etClosedLine || endType == etClosedPolygon) while (highI > 0 && path[0] == path[highI]) highI newNode->Contour.reserve(highI + 1); newNode->Contour.push_back(path[0]); int j = 0, k = 0; for (int i = 1; i <= highI; i++) if (newNode->Contour[j] != path[i]) { j++; newNode->Contour.push_back(path[i]); if (path[i].Y > newNode->Contour[k].Y || (path[i].Y == newNode->Contour[k].Y && path[i].X < newNode->Contour[k].X)) k = j; } if (endType == etClosedPolygon && j < 2) { delete newNode; return; } m_polyNodes.AddChild(*newNode); //if this path's lowest pt is lower than all the others then update m_lowest if (endType != etClosedPolygon) return; if (m_lowest.X < 0) m_lowest = IntPoint(m_polyNodes.ChildCount() - 1, k); else { IntPoint ip = m_polyNodes.Childs[(int)m_lowest.X]->Contour[(int)m_lowest.Y]; if (newNode->Contour[k].Y > ip.Y || (newNode->Contour[k].Y == ip.Y && newNode->Contour[k].X < ip.X)) m_lowest = IntPoint(m_polyNodes.ChildCount() - 1, k); } } void ClipperOffset::AddPaths(const Paths& paths, JoinType joinType, EndType endType) { for (Paths::size_type i = 0; i < paths.size(); ++i) AddPath(paths[i], joinType, endType); } void ClipperOffset::FixOrientations() { //fixup orientations of all closed paths if the orientation of the //closed path with the lowermost vertex is wrong ... if (m_lowest.X >= 0 && !Orientation(m_polyNodes.Childs[(int)m_lowest.X]->Contour)) { for (int i = 0; i < m_polyNodes.ChildCount(); ++i) { PolyNode& node = *m_polyNodes.Childs[i]; if (node.m_endtype == etClosedPolygon || (node.m_endtype == etClosedLine && Orientation(node.Contour))) ReversePath(node.Contour); } } else { for (int i = 0; i < m_polyNodes.ChildCount(); ++i) { PolyNode& node = *m_polyNodes.Childs[i]; if (node.m_endtype == etClosedLine && !Orientation(node.Contour)) ReversePath(node.Contour); } } } void ClipperOffset::Execute(Paths& solution, double delta) { solution.clear(); FixOrientations(); DoOffset(delta); //now clean up 'corners' ... Clipper clpr; clpr.AddPaths(m_destPolys, ptSubject, true); if (delta > 0) { clpr.Execute(ctUnion, solution, pftPositive, pftPositive); } else { IntRect r = clpr.GetBounds(); Path outer(4); outer[0] = IntPoint(r.left - 10, r.bottom + 10); outer[1] = IntPoint(r.right + 10, r.bottom + 10); outer[2] = IntPoint(r.right + 10, r.top - 10); outer[3] = IntPoint(r.left - 10, r.top - 10); clpr.AddPath(outer, ptSubject, true); clpr.ReverseSolution(true); clpr.Execute(ctUnion, solution, pftNegative, pftNegative); if (solution.size() > 0) solution.erase(solution.begin()); } } void ClipperOffset::Execute(PolyTree& solution, double delta) { solution.Clear(); FixOrientations(); DoOffset(delta); //now clean up 'corners' ... Clipper clpr; clpr.AddPaths(m_destPolys, ptSubject, true); if (delta > 0) { clpr.Execute(ctUnion, solution, pftPositive, pftPositive); } else { IntRect r = clpr.GetBounds(); Path outer(4); outer[0] = IntPoint(r.left - 10, r.bottom + 10); outer[1] = IntPoint(r.right + 10, r.bottom + 10); outer[2] = IntPoint(r.right + 10, r.top - 10); outer[3] = IntPoint(r.left - 10, r.top - 10); clpr.AddPath(outer, ptSubject, true); clpr.ReverseSolution(true); clpr.Execute(ctUnion, solution, pftNegative, pftNegative); //remove the outer PolyNode rectangle ... if (solution.ChildCount() == 1 && solution.Childs[0]->ChildCount() > 0) { PolyNode* outerNode = solution.Childs[0]; solution.Childs.reserve(outerNode->ChildCount()); solution.Childs[0] = outerNode->Childs[0]; solution.Childs[0]->Parent = outerNode->Parent; for (int i = 1; i < outerNode->ChildCount(); ++i) solution.AddChild(*outerNode->Childs[i]); } else solution.Clear(); } } void ClipperOffset::DoOffset(double delta) { m_destPolys.clear(); m_delta = delta; //if Zero offset, just copy any CLOSED polygons to m_p and return ... if (NEAR_ZERO(delta)) { m_destPolys.reserve(m_polyNodes.ChildCount()); for (int i = 0; i < m_polyNodes.ChildCount(); i++) { PolyNode& node = *m_polyNodes.Childs[i]; if (node.m_endtype == etClosedPolygon) m_destPolys.push_back(node.Contour); } return; } //see <API key>.svg in the documentation folder ... if (MiterLimit > 2) m_miterLim = 2/(MiterLimit * MiterLimit); else m_miterLim = 0.5; double y; if (ArcTolerance <= 0.0) y = def_arc_tolerance; else if (ArcTolerance > std::fabs(delta) * def_arc_tolerance) y = std::fabs(delta) * def_arc_tolerance; else y = ArcTolerance; //see <API key>.svg in the documentation folder ... double steps = pi / std::acos(1 - y / std::fabs(delta)); if (steps > std::fabs(delta) * pi) steps = std::fabs(delta) * pi; //ie excessive precision check m_sin = std::sin(two_pi / steps); m_cos = std::cos(two_pi / steps); m_StepsPerRad = steps / two_pi; if (delta < 0.0) m_sin = -m_sin; m_destPolys.reserve(m_polyNodes.ChildCount() * 2); for (int i = 0; i < m_polyNodes.ChildCount(); i++) { PolyNode& node = *m_polyNodes.Childs[i]; m_srcPoly = node.Contour; int len = (int)m_srcPoly.size(); if (len == 0 || (delta <= 0 && (len < 3 || node.m_endtype != etClosedPolygon))) continue; m_destPoly.clear(); if (len == 1) { if (node.m_jointype == jtRound) { double X = 1.0, Y = 0.0; for (cInt j = 1; j <= steps; j++) { m_destPoly.push_back(IntPoint( Round(m_srcPoly[0].X + X * delta), Round(m_srcPoly[0].Y + Y * delta))); double X2 = X; X = X * m_cos - m_sin * Y; Y = X2 * m_sin + Y * m_cos; } } else { double X = -1.0, Y = -1.0; for (int j = 0; j < 4; ++j) { m_destPoly.push_back(IntPoint( Round(m_srcPoly[0].X + X * delta), Round(m_srcPoly[0].Y + Y * delta))); if (X < 0) X = 1; else if (Y < 0) Y = 1; else X = -1; } } m_destPolys.push_back(m_destPoly); continue; } //build m_normals ... m_normals.clear(); m_normals.reserve(len); for (int j = 0; j < len - 1; ++j) m_normals.push_back(GetUnitNormal(m_srcPoly[j], m_srcPoly[j + 1])); if (node.m_endtype == etClosedLine || node.m_endtype == etClosedPolygon) m_normals.push_back(GetUnitNormal(m_srcPoly[len - 1], m_srcPoly[0])); else m_normals.push_back(DoublePoint(m_normals[len - 2])); if (node.m_endtype == etClosedPolygon) { int k = len - 1; for (int j = 0; j < len; ++j) OffsetPoint(j, k, node.m_jointype); m_destPolys.push_back(m_destPoly); } else if (node.m_endtype == etClosedLine) { int k = len - 1; for (int j = 0; j < len; ++j) OffsetPoint(j, k, node.m_jointype); m_destPolys.push_back(m_destPoly); m_destPoly.clear(); //re-build m_normals ... DoublePoint n = m_normals[len -1]; for (int j = len - 1; j > 0; j m_normals[j] = DoublePoint(-m_normals[j - 1].X, -m_normals[j - 1].Y); m_normals[0] = DoublePoint(-n.X, -n.Y); k = 0; for (int j = len - 1; j >= 0; j OffsetPoint(j, k, node.m_jointype); m_destPolys.push_back(m_destPoly); } else { int k = 0; for (int j = 1; j < len - 1; ++j) OffsetPoint(j, k, node.m_jointype); IntPoint pt1; if (node.m_endtype == etOpenButt) { int j = len - 1; pt1 = IntPoint((cInt)Round(m_srcPoly[j].X + m_normals[j].X * delta), (cInt)Round(m_srcPoly[j].Y + m_normals[j].Y * delta)); m_destPoly.push_back(pt1); pt1 = IntPoint((cInt)Round(m_srcPoly[j].X - m_normals[j].X * delta), (cInt)Round(m_srcPoly[j].Y - m_normals[j].Y * delta)); m_destPoly.push_back(pt1); } else { int j = len - 1; k = len - 2; m_sinA = 0; m_normals[j] = DoublePoint(-m_normals[j].X, -m_normals[j].Y); if (node.m_endtype == etOpenSquare) DoSquare(j, k); else DoRound(j, k); } //re-build m_normals ... for (int j = len - 1; j > 0; j m_normals[j] = DoublePoint(-m_normals[j - 1].X, -m_normals[j - 1].Y); m_normals[0] = DoublePoint(-m_normals[1].X, -m_normals[1].Y); k = len - 1; for (int j = k - 1; j > 0; --j) OffsetPoint(j, k, node.m_jointype); if (node.m_endtype == etOpenButt) { pt1 = IntPoint((cInt)Round(m_srcPoly[0].X - m_normals[0].X * delta), (cInt)Round(m_srcPoly[0].Y - m_normals[0].Y * delta)); m_destPoly.push_back(pt1); pt1 = IntPoint((cInt)Round(m_srcPoly[0].X + m_normals[0].X * delta), (cInt)Round(m_srcPoly[0].Y + m_normals[0].Y * delta)); m_destPoly.push_back(pt1); } else { k = 1; m_sinA = 0; if (node.m_endtype == etOpenSquare) DoSquare(0, 1); else DoRound(0, 1); } m_destPolys.push_back(m_destPoly); } } } void ClipperOffset::OffsetPoint(int j, int& k, JoinType jointype) { //cross product ... m_sinA = (m_normals[k].X * m_normals[j].Y - m_normals[j].X * m_normals[k].Y); if (std::fabs(m_sinA * m_delta) < 1.0) { //dot product ... double cosA = (m_normals[k].X * m_normals[j].X + m_normals[j].Y * m_normals[k].Y ); if (cosA > 0) // angle => 0 degrees { m_destPoly.push_back(IntPoint(Round(m_srcPoly[j].X + m_normals[k].X * m_delta), Round(m_srcPoly[j].Y + m_normals[k].Y * m_delta))); return; } //else angle => 180 degrees } else if (m_sinA > 1.0) m_sinA = 1.0; else if (m_sinA < -1.0) m_sinA = -1.0; if (m_sinA * m_delta < 0) { m_destPoly.push_back(IntPoint(Round(m_srcPoly[j].X + m_normals[k].X * m_delta), Round(m_srcPoly[j].Y + m_normals[k].Y * m_delta))); m_destPoly.push_back(m_srcPoly[j]); m_destPoly.push_back(IntPoint(Round(m_srcPoly[j].X + m_normals[j].X * m_delta), Round(m_srcPoly[j].Y + m_normals[j].Y * m_delta))); } else switch (jointype) { case jtMiter: { double r = 1 + (m_normals[j].X * m_normals[k].X + m_normals[j].Y * m_normals[k].Y); if (r >= m_miterLim) DoMiter(j, k, r); else DoSquare(j, k); break; } case jtSquare: DoSquare(j, k); break; case jtRound: DoRound(j, k); break; } k = j; } void ClipperOffset::DoSquare(int j, int k) { double dx = std::tan(std::atan2(m_sinA, m_normals[k].X * m_normals[j].X + m_normals[k].Y * m_normals[j].Y) / 4); m_destPoly.push_back(IntPoint( Round(m_srcPoly[j].X + m_delta * (m_normals[k].X - m_normals[k].Y * dx)), Round(m_srcPoly[j].Y + m_delta * (m_normals[k].Y + m_normals[k].X * dx)))); m_destPoly.push_back(IntPoint( Round(m_srcPoly[j].X + m_delta * (m_normals[j].X + m_normals[j].Y * dx)), Round(m_srcPoly[j].Y + m_delta * (m_normals[j].Y - m_normals[j].X * dx)))); } void ClipperOffset::DoMiter(int j, int k, double r) { double q = m_delta / r; m_destPoly.push_back(IntPoint(Round(m_srcPoly[j].X + (m_normals[k].X + m_normals[j].X) * q), Round(m_srcPoly[j].Y + (m_normals[k].Y + m_normals[j].Y) * q))); } void ClipperOffset::DoRound(int j, int k) { double a = std::atan2(m_sinA, m_normals[k].X * m_normals[j].X + m_normals[k].Y * m_normals[j].Y); int steps = std::max((int)Round(m_StepsPerRad * std::fabs(a)), 1); double X = m_normals[k].X, Y = m_normals[k].Y, X2; for (int i = 0; i < steps; ++i) { m_destPoly.push_back(IntPoint( Round(m_srcPoly[j].X + X * m_delta), Round(m_srcPoly[j].Y + Y * m_delta))); X2 = X; X = X * m_cos - m_sin * Y; Y = X2 * m_sin + Y * m_cos; } m_destPoly.push_back(IntPoint( Round(m_srcPoly[j].X + m_normals[j].X * m_delta), Round(m_srcPoly[j].Y + m_normals[j].Y * m_delta))); } // Miscellaneous public functions void Clipper::DoSimplePolygons() { PolyOutList::size_type i = 0; while (i < m_PolyOuts.size()) { OutRec* outrec = m_PolyOuts[i++]; OutPt* op = outrec->Pts; if (!op || outrec->IsOpen) continue; do //for each Pt in Polygon until duplicate found do ... { OutPt* op2 = op->Next; while (op2 != outrec->Pts) { if ((op->Pt == op2->Pt) && op2->Next != op && op2->Prev != op) { //split the polygon into two ... OutPt* op3 = op->Prev; OutPt* op4 = op2->Prev; op->Prev = op4; op4->Next = op; op2->Prev = op3; op3->Next = op2; outrec->Pts = op; OutRec* outrec2 = CreateOutRec(); outrec2->Pts = op2; UpdateOutPtIdxs(*outrec2); if (Poly2ContainsPoly1(outrec2->Pts, outrec->Pts)) { //OutRec2 is contained by OutRec1 ... outrec2->IsHole = !outrec->IsHole; outrec2->FirstLeft = outrec; if (m_UsingPolyTree) FixupFirstLefts2(outrec2, outrec); } else if (Poly2ContainsPoly1(outrec->Pts, outrec2->Pts)) { //OutRec1 is contained by OutRec2 ... outrec2->IsHole = outrec->IsHole; outrec->IsHole = !outrec2->IsHole; outrec2->FirstLeft = outrec->FirstLeft; outrec->FirstLeft = outrec2; if (m_UsingPolyTree) FixupFirstLefts2(outrec, outrec2); } else { //the 2 polygons are separate ... outrec2->IsHole = outrec->IsHole; outrec2->FirstLeft = outrec->FirstLeft; if (m_UsingPolyTree) FixupFirstLefts1(outrec, outrec2); } op2 = op; //ie get ready for the Next iteration } op2 = op2->Next; } op = op->Next; } while (op != outrec->Pts); } } void ReversePath(Path& p) { std::reverse(p.begin(), p.end()); } void ReversePaths(Paths& p) { for (Paths::size_type i = 0; i < p.size(); ++i) ReversePath(p[i]); } void SimplifyPolygon(const Path &in_poly, Paths &out_polys, PolyFillType fillType) { Clipper c; c.StrictlySimple(true); c.AddPath(in_poly, ptSubject, true); c.Execute(ctUnion, out_polys, fillType, fillType); } void SimplifyPolygons(const Paths &in_polys, Paths &out_polys, PolyFillType fillType) { Clipper c; c.StrictlySimple(true); c.AddPaths(in_polys, ptSubject, true); c.Execute(ctUnion, out_polys, fillType, fillType); } void SimplifyPolygons(Paths &polys, PolyFillType fillType) { SimplifyPolygons(polys, polys, fillType); } inline double DistanceSqrd(const IntPoint& pt1, const IntPoint& pt2) { double Dx = ((double)pt1.X - pt2.X); double dy = ((double)pt1.Y - pt2.Y); return (Dx*Dx + dy*dy); } double <API key>( const IntPoint& pt, const IntPoint& ln1, const IntPoint& ln2) { //The equation of a line in general form (Ax + By + C = 0) //given 2 points (x?y? & (x?y? is ... //(y?- y?x + (x?- x?y + (y?- y?x?- (x?- x?y?= 0 //A = (y?- y?; B = (x?- x?; C = (y?- y?x?- (x?- x?y? //perpendicular distance of point (x?y? = (Ax?+ By?+ C)/Sqrt(A?+ B? double A = double(ln1.Y - ln2.Y); double B = double(ln2.X - ln1.X); double C = A * ln1.X + B * ln1.Y; C = A * pt.X + B * pt.Y - C; return (C * C) / (A * A + B * B); } bool SlopesNearCollinear(const IntPoint& pt1, const IntPoint& pt2, const IntPoint& pt3, double distSqrd) { //this function is more accurate when the point that's geometrically //between the other 2 points is the one that's tested for distance. //ie makes it more likely to pick up 'spikes' ... if (Abs(pt1.X - pt2.X) > Abs(pt1.Y - pt2.Y)) { if ((pt1.X > pt2.X) == (pt1.X < pt3.X)) return <API key>(pt1, pt2, pt3) < distSqrd; else if ((pt2.X > pt1.X) == (pt2.X < pt3.X)) return <API key>(pt2, pt1, pt3) < distSqrd; else return <API key>(pt3, pt1, pt2) < distSqrd; } else { if ((pt1.Y > pt2.Y) == (pt1.Y < pt3.Y)) return <API key>(pt1, pt2, pt3) < distSqrd; else if ((pt2.Y > pt1.Y) == (pt2.Y < pt3.Y)) return <API key>(pt2, pt1, pt3) < distSqrd; else return <API key>(pt3, pt1, pt2) < distSqrd; } } bool PointsAreClose(IntPoint pt1, IntPoint pt2, double distSqrd) { double Dx = (double)pt1.X - pt2.X; double dy = (double)pt1.Y - pt2.Y; return ((Dx * Dx) + (dy * dy) <= distSqrd); } OutPt* ExcludeOp(OutPt* op) { OutPt* result = op->Prev; result->Next = op->Next; op->Next->Prev = result; result->Idx = 0; return result; } void CleanPolygon(const Path& in_poly, Path& out_poly, double distance) { //distance = proximity in units/pixels below which vertices //will be stripped. Default ~= sqrt(2). size_t size = in_poly.size(); if (size == 0) { out_poly.clear(); return; } OutPt* outPts = new OutPt[size]; for (size_t i = 0; i < size; ++i) { outPts[i].Pt = in_poly[i]; outPts[i].Next = &outPts[(i + 1) % size]; outPts[i].Next->Prev = &outPts[i]; outPts[i].Idx = 0; } double distSqrd = distance * distance; OutPt* op = &outPts[0]; while (op->Idx == 0 && op->Next != op->Prev) { if (PointsAreClose(op->Pt, op->Prev->Pt, distSqrd)) { op = ExcludeOp(op); size } else if (PointsAreClose(op->Prev->Pt, op->Next->Pt, distSqrd)) { ExcludeOp(op->Next); op = ExcludeOp(op); size -= 2; } else if (SlopesNearCollinear(op->Prev->Pt, op->Pt, op->Next->Pt, distSqrd)) { op = ExcludeOp(op); size } else { op->Idx = 1; op = op->Next; } } if (size < 3) size = 0; out_poly.resize(size); for (size_t i = 0; i < size; ++i) { out_poly[i] = op->Pt; op = op->Next; } delete [] outPts; } void CleanPolygon(Path& poly, double distance) { CleanPolygon(poly, poly, distance); } void CleanPolygons(const Paths& in_polys, Paths& out_polys, double distance) { out_polys.resize(in_polys.size()); for (Paths::size_type i = 0; i < in_polys.size(); ++i) CleanPolygon(in_polys[i], out_polys[i], distance); } void CleanPolygons(Paths& polys, double distance) { CleanPolygons(polys, polys, distance); } void Minkowski(const Path& poly, const Path& path, Paths& solution, bool isSum, bool isClosed) { int delta = (isClosed ? 1 : 0); size_t polyCnt = poly.size(); size_t pathCnt = path.size(); Paths pp; pp.reserve(pathCnt); if (isSum) for (size_t i = 0; i < pathCnt; ++i) { Path p; p.reserve(polyCnt); for (size_t j = 0; j < poly.size(); ++j) p.push_back(IntPoint(path[i].X + poly[j].X, path[i].Y + poly[j].Y)); pp.push_back(p); } else for (size_t i = 0; i < pathCnt; ++i) { Path p; p.reserve(polyCnt); for (size_t j = 0; j < poly.size(); ++j) p.push_back(IntPoint(path[i].X - poly[j].X, path[i].Y - poly[j].Y)); pp.push_back(p); } solution.clear(); solution.reserve((pathCnt + delta) * (polyCnt + 1)); for (size_t i = 0; i < pathCnt - 1 + delta; ++i) for (size_t j = 0; j < polyCnt; ++j) { Path quad; quad.reserve(4); quad.push_back(pp[i % pathCnt][j % polyCnt]); quad.push_back(pp[(i + 1) % pathCnt][j % polyCnt]); quad.push_back(pp[(i + 1) % pathCnt][(j + 1) % polyCnt]); quad.push_back(pp[i % pathCnt][(j + 1) % polyCnt]); if (!Orientation(quad)) ReversePath(quad); solution.push_back(quad); } } void MinkowskiSum(const Path& pattern, const Path& path, Paths& solution, bool pathIsClosed) { Minkowski(pattern, path, solution, true, pathIsClosed); Clipper c; c.AddPaths(solution, ptSubject, true); c.Execute(ctUnion, solution, pftNonZero, pftNonZero); } void TranslatePath(const Path& input, Path& output, const IntPoint delta) { //precondition: input != output output.resize(input.size()); for (size_t i = 0; i < input.size(); ++i) output[i] = IntPoint(input[i].X + delta.X, input[i].Y + delta.Y); } void MinkowskiSum(const Path& pattern, const Paths& paths, Paths& solution, bool pathIsClosed) { Clipper c; for (size_t i = 0; i < paths.size(); ++i) { Paths tmp; Minkowski(pattern, paths[i], tmp, true, pathIsClosed); c.AddPaths(tmp, ptSubject, true); if (pathIsClosed) { Path tmp2; TranslatePath(paths[i], tmp2, pattern[0]); c.AddPath(tmp2, ptClip, true); } } c.Execute(ctUnion, solution, pftNonZero, pftNonZero); } void MinkowskiDiff(const Path& poly1, const Path& poly2, Paths& solution) { Minkowski(poly1, poly2, solution, false, true); Clipper c; c.AddPaths(solution, ptSubject, true); c.Execute(ctUnion, solution, pftNonZero, pftNonZero); } enum NodeType {ntAny, ntOpen, ntClosed}; void AddPolyNodeToPaths(const PolyNode& polynode, NodeType nodetype, Paths& paths) { bool match = true; if (nodetype == ntClosed) match = !polynode.IsOpen(); else if (nodetype == ntOpen) return; if (!polynode.Contour.empty() && match) paths.push_back(polynode.Contour); for (int i = 0; i < polynode.ChildCount(); ++i) AddPolyNodeToPaths(*polynode.Childs[i], nodetype, paths); } void PolyTreeToPaths(const PolyTree& polytree, Paths& paths) { paths.resize(0); paths.reserve(polytree.Total()); AddPolyNodeToPaths(polytree, ntAny, paths); } void <API key>(const PolyTree& polytree, Paths& paths) { paths.resize(0); paths.reserve(polytree.Total()); AddPolyNodeToPaths(polytree, ntClosed, paths); } void <API key>(PolyTree& polytree, Paths& paths) { paths.resize(0); paths.reserve(polytree.Total()); //Open paths are top level only, so ... for (int i = 0; i < polytree.ChildCount(); ++i) if (polytree.Childs[i]->IsOpen()) paths.push_back(polytree.Childs[i]->Contour); } std::ostream& operator <<(std::ostream &s, const IntPoint &p) { s << "(" << p.X << "," << p.Y << ")"; return s; } std::ostream& operator <<(std::ostream &s, const Path &p) { if (p.empty()) return s; Path::size_type last = p.size() -1; for (Path::size_type i = 0; i < last; i++) s << "(" << p[i].X << "," << p[i].Y << "), "; s << "(" << p[last].X << "," << p[last].Y << ")\n"; return s; } std::ostream& operator <<(std::ostream &s, const Paths &p) { for (Paths::size_type i = 0; i < p.size(); i++) s << p[i]; s << "\n"; return s; } } //ClipperLib namespace
module AttrValidator # A typical module looks like this: # module M # def self.included(base) # base.extend ClassMethods # base.class_eval do # scope :disabled, -> { where(disabled: true) } # end # end # module ClassMethods # end # end # By using <tt>ActiveSupport::Concern</tt> the above module could instead be # written as: # require 'active_support/concern' # module M # extend ActiveSupport::Concern # included do # scope :disabled, -> { where(disabled: true) } # end # module ClassMethods # end # end # Moreover, it gracefully handles module dependencies. Given a +Foo+ module # and a +Bar+ module which depends on the former, we would typically write the # following: # module Foo # def self.included(base) # base.class_eval do # def self.<API key> # end # end # end # end # module Bar # def self.included(base) # base.<API key> # end # end # class Host # include Foo # We need to include this dependency for Bar # include Bar # Bar is the module that Host really needs # end # But why should +Host+ care about +Bar+'s dependencies, namely +Foo+? We # could try to hide these from +Host+ directly including +Foo+ in +Bar+: # module Bar # include Foo # def self.included(base) # base.<API key> # end # end # class Host # include Bar # end # Unfortunately this won't work, since when +Foo+ is included, its <tt>base</tt> # is the +Bar+ module, not the +Host+ class. With <tt>ActiveSupport::Concern</tt>, # module dependencies are properly resolved: # require 'active_support/concern' # module Foo # extend ActiveSupport::Concern # included do # def self.<API key> # end # end # end # module Bar # extend ActiveSupport::Concern # include Foo # included do # self.<API key> # end # end # class Host # include Bar # works, Bar takes care now of its dependencies # end module Concern class <API key> < StandardError #:nodoc: def initialize super "Cannot define multiple 'included' blocks for a Concern" end end def self.extended(base) #:nodoc: base.<API key>(:@_dependencies, []) end def append_features(base) if base.<API key>?(:@_dependencies) base.<API key>(:@_dependencies) << self return false else return false if base < self @_dependencies.each { |dep| base.send(:include, dep) } super base.extend const_get(:ClassMethods) if const_defined?(:ClassMethods) base.class_eval(&@_included_block) if <API key>?(:@_included_block) end end def included(base = nil, &block) if base.nil? raise <API key> if <API key>?(:@_included_block) @_included_block = block else super end end end end
package ca.codybanman.AstroidEscape; import org.robovm.apple.foundation.NSAutoreleasePool; import org.robovm.apple.uikit.UIApplication; import com.badlogic.gdx.backends.iosrobovm.IOSApplication; import com.badlogic.gdx.backends.iosrobovm.<API key>; import ca.codybanman.AstroidEscape.AEGame; public class IOSLauncher extends IOSApplication.Delegate { @Override protected IOSApplication createApplication() { <API key> config = new <API key>(); return new IOSApplication(new AEGame(), config); } public static void main(String[] argv) { NSAutoreleasePool pool = new NSAutoreleasePool(); UIApplication.main(argv, null, IOSLauncher.class); pool.close(); } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Xml; using System.Xml.Serialization; using System.IO; namespace TimeOut { public partial class partido : Form { Team local; // Equipo local Team visitor; // Equipo visitante List<Registro> minuteToMinute = new List<Registro>(); Counter count = new Counter(); // Constante que guarda la cantidad limite const int maxFaltas = 6; /* * Hay dos largos procesos en un partido, * suceden cuando hay Falta o cuando hay Balon Afuera. */ bool procesoFalta = false; bool procesoBalonAfuera = false; bool localTeamShoot = false; // Cantidad de tiros libres a tirar tras la falta int <API key> = 0; // This will be checked in the close event, // avoiding unnintentional actions and lose of data. bool closeWindow = false; // Clase para guardar el registro completo del partido Match partidoJugado; // Archivo para guardar el registro del partido string archivoPartidos = ""; public string ArchivoPartidos { get { return archivoPartidos; } set { archivoPartidos = value; } } <summary> El constructor de la clase. </summary> <param name="a">Equipo local</param> <param name="b">Equipo visitante</param> public partido(Team a, Team b) { InitializeComponent(); local = a; visitor = b; if (a != null && b != null) { actualizarListbox(); this.label_tituloLocal.Text = local.Name; this.<API key>.Text = visitor.Name; this.label_LTO_restante.Text = Team.TOmax.ToString(); this.label_VTO_restante.Text = Team.TOmax.ToString(); } } public void actualizarListbox() { cargarTitulares(); cargarVisitantes(); } void cargarTitulares() { listBox_LocalRoster.Items.Clear(); comboBox_LocalSubs.Items.Clear(); foreach (Player p in this.local.Players) { if (p.Starter) listBox_LocalRoster.Items.Add(p); else comboBox_LocalSubs.Items.Add(p); } listBox_LocalRoster.DisplayMember = "CompleteName"; comboBox_LocalSubs.DisplayMember = "CompleteName"; } void cargarVisitantes() { <API key>.Items.Clear(); <API key>.Items.Clear(); foreach (Player p in this.visitor.Players) { if (p.Starter) <API key>.Items.Add(p); else <API key>.Items.Add(p); } <API key>.DisplayMember = "CompleteName"; <API key>.DisplayMember = "CompleteName"; } <summary> Agrega un partido en una lista generica. </summary> <param name="equipo">Partido que sera agregado a la lista.</param> <param name="listaEquipos">Lista que tiene el resto de los partidos</param> <returns>La misma lista con el partido agregado</returns> List<Match> addMatchToList(Match partido, List<Match> listaPartidos) { if (listaPartidos == null) listaPartidos = new List<Match>(); listaPartidos.Add(partido); return listaPartidos; } <summary> Guarda el partido y su información en el archivo </summary> void <API key>() { // Load previous matchs from file List<Match> listaDePartidos = Main.CargarPartidos(); // Add the new match to the list listaDePartidos = addMatchToList(this.partidoJugado, listaDePartidos); // Store the updated list to the file StreamWriter flujo = new StreamWriter(this.archivoPartidos); XmlSerializer serial = new XmlSerializer(typeof(List<Match>)); serial.Serialize(flujo, listaDePartidos); flujo.Close(); } <summary> Guarda las estadísticas recogidas durante el partido. </summary> void guardarInformación() { // Crea la lista this.partidoJugado = new Match(); // Add match's metadata partidoJugado.Fecha = DateTime.Now; partidoJugado.EquipoLocal = local.Name; partidoJugado.EquipoVisitante = visitor.Name; // Agrega los nombres de TODOS los jugadores foreach(Player p in local.Players) { partidoJugado.JugadoresLocales.Add(p.CompleteName); partidoJugado.EstadisticasLocal.Asistencias += p.AsistenciasLogradas; partidoJugado.EstadisticasLocal.SimplesEncestados += p.TirosLibresAnotados; partidoJugado.EstadisticasLocal.SimplesFallidos += p.TirosLibresFallados; partidoJugado.EstadisticasLocal.DoblesEncestados += p.<API key>; partidoJugado.EstadisticasLocal.DoblesFallidos += p.<API key>; partidoJugado.EstadisticasLocal.TriplesEncestados += p.<API key>; partidoJugado.EstadisticasLocal.TriplesFallidos += p.<API key>; partidoJugado.EstadisticasLocal.RebotesDefensivos += p.RebotesDefensivos; partidoJugado.EstadisticasLocal.RebotesOfensivos += p.RebotesOfensivos; partidoJugado.EstadisticasLocal.Faltas += p.FaltasCometidas; } foreach(Player p in visitor.Players) { partidoJugado.JugadoresVisitantes.Add(p.CompleteName); partidoJugado.<API key>.Asistencias += p.AsistenciasLogradas; partidoJugado.<API key>.SimplesEncestados += p.TirosLibresAnotados; partidoJugado.<API key>.SimplesFallidos += p.TirosLibresFallados; partidoJugado.<API key>.DoblesEncestados += p.<API key>; partidoJugado.<API key>.DoblesFallidos += p.<API key>; partidoJugado.<API key>.TriplesEncestados += p.<API key>; partidoJugado.<API key>.TriplesFallidos += p.<API key>; partidoJugado.<API key>.RebotesDefensivos += p.RebotesDefensivos; partidoJugado.<API key>.RebotesOfensivos += p.RebotesOfensivos; partidoJugado.<API key>.Faltas += p.FaltasCometidas; } <API key>(); } <summary> Activa el botón de Comienzo del partido </summary> void activarContinuacion() { timer1.Stop(); button1.Text = "Comenzar"; button1.Enabled = true; this.button1.BackColor = Color.DeepSkyBlue; } <summary> Congela/detiene el reloj del partido y desactiva el botón de Comienzo </summary> void <API key>() { timer1.Stop(); button1.Text = "Parado"; button1.Enabled = false; this.button1.BackColor = Color.Red; } <summary> Pone el reloj a correr y desactiva el botón </summary> void correrContinuacion() { timer1.Enabled = true; button1.Text = "Pausar"; button1.Enabled = true; this.button1.BackColor = Color.Red; } <summary> Evento llamado cuando finaliza el encuentro. </summary> void finishMatch() { timer1.Stop(); button1.Text = "Finalizado"; button1.Enabled = false; button1.BackColor = Color.Black; guardarInformación(); // Display a minute-to-minute chart ShowEvents nuevo = new ShowEvents(this.minuteToMinute); nuevo.ShowDialog(); // Desactiva la pregunta al salir closeWindow = true; this.Close(); } <summary> Cambia el contexto de la ventana deacuerdo al momento correspondiente </summary> void finalizarCuarto() { count.resetCounter(); activarContinuacion(); // Restablece los tiempos muertos this.local.restartTO(); this.visitor.restartTO(); // Desactiva botones no disponibles desactivarCambio(); desactivarTO(); desactivarPuntos(); desactivarFalta(); desactivarPerdida(); desactivarRebotes(); if (this.lblCuarto.Text[0] == '1') this.lblCuarto.Text = "2do Cuarto"; else if (this.lblCuarto.Text[0] == '2') this.lblCuarto.Text = "3er Cuarto"; else if (this.lblCuarto.Text[0] == '3') this.lblCuarto.Text = "4to Cuarto"; else finishMatch(); } private void timer1_Tick(object sender, EventArgs e) { count.decCounter(); this.label_timer.Text = count.getCounter; if (count.getCounter == "00:00:00") finalizarCuarto(); } #region Activar y Desactivar botones y labels #region Desactivar y Activar puntos void <API key>() { <API key>.Enabled = false; btn_dobleErrado_L.Enabled = false; } void <API key>() { <API key>.Enabled = false; btn_dobleErrado_V.Enabled = false; } void <API key>() { <API key>.Enabled = false; btn_tripleErrado_L.Enabled = false; } void <API key>() { <API key>.Enabled = false; btn_tripleErrado_V.Enabled = false; } void desactivarPuntos() { <API key>(); <API key>(); <API key>(); <API key>(); } void activarDoblesLocal() { <API key>.Enabled = true; btn_dobleErrado_L.Enabled = true; } void <API key>() { <API key>.Enabled = true; btn_dobleErrado_V.Enabled = true; } void activarTriplesLocal() { <API key>.Enabled = true; btn_tripleErrado_L.Enabled = true; } void <API key>() { <API key>.Enabled = true; btn_tripleErrado_V.Enabled = true; } void activarPuntos() { activarDoblesLocal(); <API key>(); activarTriplesLocal(); <API key>(); } #endregion void activarFalta() { button_faltaL.Enabled = true; button_faltaV.Enabled = true; } void desactivarFalta() { button_faltaL.Enabled = false; button_faltaV.Enabled = false; } void activarPerdida() { //button_perdidaL.Enabled = true; //button_perdidaV.Enabled = true; } void desactivarPerdida() { //button_perdidaL.Enabled = false; //button_perdidaV.Enabled = false; } void activarCambio() { this.button_changeL.Visible = true; this.button_changeV.Visible = true; } void desactivarCambio() { this.button_changeL.Visible = false; this.button_changeV.Visible = false; } void activarTOLocal() { if (local.<API key> > 0) this.LocalTO.Enabled = true; } void activarTOVisitante() { if (visitor.<API key> > 0) this.VisitorTO.Enabled = true; } void activarTO() { activarTOLocal(); activarTOVisitante(); } void desactivarTOLocal() { this.LocalTO.Enabled = false; } void <API key>() { this.VisitorTO.Enabled = false; } void desactivarTO() { desactivarTOLocal(); <API key>(); } void activarLibreLocal() { <API key>.Enabled = true; btn_libreErrado_L.Enabled = true; } void <API key>() { <API key>.Enabled = false; btn_libreErrado_L.Enabled = false; } void <API key>() { <API key>.Enabled = true; btn_libreErrado_V.Enabled = true; } void <API key>() { <API key>.Enabled = false; btn_libreErrado_V.Enabled = false; } <summary> Activa el rebote defensivo del equipo defensor y el rebote ofensivo del equipo atacante </summary> <param name="defensivoLocal">Si es falso, el visitante esta defendiendo el rebote</param> void activarRebotes(bool defensivoLocal = true) { if (defensivoLocal) { this.<API key>.Visible = true; this.<API key>.Visible = true; } else { this.<API key>.Visible = true; this.<API key>.Visible = true; } } <summary> Desactiva TODOS los rebotes de TODOS los equipos </summary> void desactivarRebotes() { // Locales this.<API key>.Visible = false; this.<API key>.Visible = false; // y Visitantes this.<API key>.Visible = false; this.<API key>.Visible = false; } #endregion #region Registros void registrarSimple(string nombreJugador, bool encestado = true) { string cuarto = lblCuarto.Text[0].ToString(); string evento = (encestado) ? "Tiro Libre Anotado" : "Tiro Libre Fallado"; Registro r = new Registro(cuarto, this.label_timer.Text, evento, nombreJugador); minuteToMinute.Add(r); } void registrarDoble(string nombreJugador, bool encestado = true) { string cuarto = lblCuarto.Text[0].ToString(); string evento = (encestado) ? "Doble Anotado" : "Doble Fallado"; Registro r = new Registro(cuarto, this.label_timer.Text, evento, nombreJugador); minuteToMinute.Add(r); } void registrarTriple(string nombreJugador, bool encestado = true) { string cuarto = lblCuarto.Text[0].ToString(); string evento = (encestado) ? "Triple Anotado" : "Triple Fallado"; Registro r = new Registro(cuarto, this.label_timer.Text, evento, nombreJugador); minuteToMinute.Add(r); } void registrarRebote(string nombreJugador, bool ofensivo = false) { string cuarto = lblCuarto.Text[0].ToString(); string evento = (ofensivo) ? "Rebote Ofensivo" : "Rebote Defensivo"; Registro r = new Registro(cuarto, this.label_timer.Text, evento, nombreJugador); minuteToMinute.Add(r); } void registrarFalta(string nombreJugador) { string cuarto = lblCuarto.Text[0].ToString(); Registro r = new Registro(cuarto, this.label_timer.Text, "Falta", nombreJugador); minuteToMinute.Add(r); } <summary> Registra una canasta simple, doble o triple Encestada. Cambia el anotador del partido </summary> <param name="valor">Puede ser 1, 2 o 3</param> <param name="jugador">Jugador al que se le asignara el punto</param> <param name="local">Si es falso, corresponde al equipo visitante</param> void anotacion(int valor, Player jugador, bool local = true) { switch (valor) { case 1: jugador.TirosLibresAnotados++; registrarSimple(jugador.CompleteName); break; case 2: jugador.<API key>++; registrarDoble(jugador.CompleteName); break; case 3: jugador.<API key>++; registrarTriple(jugador.CompleteName); break; } Label score = null; if (local) score = this.label_ptsLocal; else score = this.label_ptsVsitor; int pts = Convert.ToInt32(score.Text) + valor; score.Text = pts.ToString(); } <summary> Registra una canasta simple, doble o triple Fallida. Of course it does not change the scorer </summary> <param name="valor">Puede ser 1, 2 o 3</param> <param name="jugador">Jugador al que se le asignara el fallo</param> void fallo(int valor, Player jugador) { switch (valor) { case 1: jugador.TirosLibresFallados++; registrarSimple(jugador.CompleteName, false); break; case 2: jugador.<API key>++; registrarDoble(jugador.CompleteName, false); break; case 3: jugador.<API key>++; registrarTriple(jugador.CompleteName, false); break; } } #endregion // * METODOS LLAMADOS * // // * POR EL USUARIO * // <summary> Sucede cuando el usuario presiona el boton de "Comienzo" del partido </summary> private void button1_Click(object sender, EventArgs e) { desactivarCambio(); desactivarRebotes(); desactivarPuntos(); desactivarPerdida(); desactivarFalta(); <API key>(); <API key>(); if (procesoFalta) { MessageBox.Show("Se continua con los tiros libres.."); <API key>(); activarCambio(); // Check which team received fault and enable its free shoots if (localTeamShoot) activarLibreLocal(); else <API key>(); localTeamShoot = false; } else { // Check if time is running... if (timer1.Enabled) { //... User want to stop timing desactivarPerdida(); desactivarPuntos(); desactivarFalta(); activarContinuacion(); activarCambio(); } else { //... User want to continue timing activarFalta(); activarPerdida(); activarTO(); activarPuntos(); correrContinuacion(); } } } <summary> Sucede cuando el usuario realiza un Tiempo Muerto para el LOCAL </summary> private void LocalTO_Click(object sender, EventArgs e) { // Cambia la interfaz del usuario activarContinuacion(); activarCambio(); // Desactiva los controles no disponibles desactivarTO(); desactivarPuntos(); desactivarFalta(); desactivarPerdida(); <API key>(); desactivarRebotes(); // Asigna los tiempos muertos local.<API key> this.label_LTO_restante.Text = local.<API key>.ToString(); if (local.<API key> == 0) this.LocalTO.Enabled = false; if (procesoFalta) { localTeamShoot = true; } } <summary> Sucede cuando el usuario realiza un Tiempo Muerto para el VISITANTE </summary> private void VisitorTO_Click(object sender, EventArgs e) { // Cambia la interfaz del usuario activarContinuacion(); activarCambio(); // Desactiva los controles no disponibles desactivarTO(); desactivarPuntos(); desactivarFalta(); desactivarPerdida(); <API key>(); desactivarRebotes(); // Asigna los tiempos muertos visitor.<API key> this.label_VTO_restante.Text = visitor.<API key>.ToString(); if (visitor.<API key> == 0) this.VisitorTO.Enabled = false; } <summary> Sucede cuando el usuario quiere realizar un cambio del LOCAL </summary> private void button2_Click(object sender, EventArgs e) { if (listBox_LocalRoster.SelectedItem != null && comboBox_LocalSubs.SelectedItem != null) { Player p = (Player)listBox_LocalRoster.SelectedItem; p.Starter = false; p = (Player)comboBox_LocalSubs.SelectedItem; p.Starter = true; // Actualizar cargarTitulares(); } } <summary> Sucede cuando el usuario quiere realizar un cambio del VISITANTE </summary> private void button3_Click(object sender, EventArgs e) { if (<API key>.SelectedItem != null && <API key>.SelectedItem != null) { Player p = (Player)<API key>.SelectedItem; p.Starter = false; p = (Player)<API key>.SelectedItem; p.Starter = true; // Actualizar cargarVisitantes(); } } <summary> Sucede cuando el equipo LOCAL comete una falta </summary> private void button_faltaL_Click(object sender, EventArgs e) { <API key>(); desactivarFalta(); desactivarPerdida(); desactivarTOLocal(); activarTOVisitante(); if (listBox_LocalRoster.SelectedItem != null) { // Agrega la Falta al Jugador y Registra el evento Player p = (Player)listBox_LocalRoster.SelectedItem; p.FaltasCometidas++; registrarFalta(p.CompleteName); // Fire player from game if reached limit of faults committed if (p.FaltasCometidas == maxFaltas) listBox_LocalRoster.Items.Remove(p); // Check if player was shooting while received the fault DialogResult userResponce = MessageBox.Show("El jugador estaba en posicion de Tiro?", "Posicion de tiro", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (userResponce == DialogResult.Yes) { //desactivarTO(); procesoFalta = true; // Activa el proceso falta <API key>(); <API key>(); } else // Saque desde el costado { desactivarPuntos(); desactivarRebotes(); // Activa el boton de Comienzo activarContinuacion(); procesoBalonAfuera = true; // Activa el proceso Balon Afuera } } else // No se conoce el jugador que realizo la falta { SelectPlayer nuevo = new SelectPlayer(local.Players); nuevo.ShowDialog(); this.listBox_LocalRoster.SelectedItem = nuevo.JugadorSeleccionado; button_faltaL_Click(sender, e); } } <summary> Sucede cuando el equipo VISITANTE comete una falta </summary> private void button_faltaV_Click(object sender, EventArgs e) { <API key>(); desactivarFalta(); desactivarPerdida(); <API key>(); activarTOLocal(); if (<API key>.SelectedItem != null) { // Agrega la Falta al Jugador y Registra el evento Player p = (Player)<API key>.SelectedItem; p.FaltasCometidas++; registrarFalta(p.CompleteName); // Fire player from game if reached limit of faults committed if (p.FaltasCometidas == maxFaltas) <API key>.Items.Remove(p); // Check if player was shooting while received the fault DialogResult userResponce = MessageBox.Show("El jugador estaba en posicion de Tiro?", "Posicion de tiro", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (userResponce == DialogResult.Yes) { //desactivarTO(); procesoFalta = true; // Activa el proceso falta <API key>(); <API key>(); } else // Saque desde el costado { desactivarPuntos(); desactivarRebotes(); // Activa el boton de Comienzo activarContinuacion(); procesoBalonAfuera = true; // Activa el proceso Balon Afuera } } else // No se conoce el jugador que realizo la falta { SelectPlayer nuevo = new SelectPlayer(visitor.Players); nuevo.ShowDialog(); this.<API key>.SelectedItem = nuevo.JugadorSeleccionado; button_faltaV_Click(sender, e); } } <summary> Sucede cuando el equipo LOCAL encesta un DOBLE </summary> private void <API key>(object sender, EventArgs e) { // Detiene el reloj timer1.Enabled = false; Player aux = (Player)listBox_LocalRoster.SelectedItem; if (aux != null) { anotacion(2, aux); desactivarPuntos(); desactivarRebotes(); desactivarFalta(); desactivarPerdida(); // Check if player has received a fault while shooting if (procesoFalta) { // Cambia la interfaz del usuario activarTOLocal(); activarLibreLocal(); desactivarPuntos(); // Tira 1 tiro libre al recibir falta en zona de 2 punto <API key> = 1; //TODO // Muestra el Estado //<API key>.Text = "" } else { desactivarTOLocal(); // Activa el boton de Comienzo activarContinuacion(); } } else { SelectPlayer nuevo = new SelectPlayer(local.Players); nuevo.ShowDialog(); this.listBox_LocalRoster.SelectedItem = nuevo.JugadorSeleccionado; <API key>(sender, e); } } <summary> Sucede cuando el equipo VISITANTE encesta un DOBLE </summary> private void <API key>(object sender, EventArgs e) { // Detiene el reloj timer1.Enabled = false; Player aux = (Player)<API key>.SelectedItem; if (aux != null) { anotacion(2, aux, false); desactivarPuntos(); desactivarRebotes(); desactivarFalta(); desactivarPerdida(); // Check if player has received a fault while shooting if (procesoFalta) { activarTOVisitante(); <API key>(); desactivarPuntos(); // Tira 1 tiro libre al recibir falta en zona de 2 punto // Tira 1 tiro libre <API key> = 1; } else { <API key>(); // Activa el boton de Comienzo activarContinuacion(); } } else { SelectPlayer nuevo = new SelectPlayer(visitor.Players); nuevo.ShowDialog(); this.<API key>.SelectedItem = nuevo.JugadorSeleccionado; <API key>(sender, e); } } <summary> Sucede cuando el equipo LOCAL encesta un TRIPLE </summary> private void <API key>(object sender, EventArgs e) { // Detiene el reloj timer1.Enabled = false; Player aux = (Player)listBox_LocalRoster.SelectedItem; if (aux != null) { anotacion(3, aux); desactivarPuntos(); desactivarRebotes(); desactivarFalta(); desactivarPerdida(); // Check if player has received a fault while shooting if (procesoFalta) { // Cambia la interfaz del usuario activarTOLocal(); activarLibreLocal(); desactivarPuntos(); // Jugada de 4 puntos!! oh yeah! <API key> = 1; // Tira 1 tiro libre } else { desactivarTOLocal(); // Activa el boton de Comienzo activarContinuacion(); } } else { SelectPlayer nuevo = new SelectPlayer(local.Players); nuevo.ShowDialog(); this.listBox_LocalRoster.SelectedItem = nuevo.JugadorSeleccionado; <API key>(sender, e); } } <summary> Sucede cuando el equipo VISITANTE encesta un TRIPLE </summary> private void <API key>(object sender, EventArgs e) { // Detiene el reloj timer1.Enabled = false; Player aux = (Player)<API key>.SelectedItem; if (aux != null) { anotacion(3, aux, false); desactivarPuntos(); desactivarRebotes(); desactivarFalta(); desactivarPerdida(); // Check if player has received a fault while shooting if (procesoFalta) { // Cambia la interfaz del usuario activarTOVisitante(); <API key>(); desactivarPuntos(); // Jugada de 4 puntos!! oh yeah! <API key> = 1; // Tira 1 tiro libre } else { <API key>(); // Activa el boton de Comienzo activarContinuacion(); } } else { SelectPlayer nuevo = new SelectPlayer(visitor.Players); nuevo.ShowDialog(); this.<API key>.SelectedItem = nuevo.JugadorSeleccionado; <API key>(sender, e); } } <summary> Sucede cuando el equipo LOCAL erra un DOBLE </summary> private void <API key>(object sender, EventArgs e) { desactivarPuntos(); if (procesoFalta) { // Cambia la interfaz del usuario activarTOLocal(); activarLibreLocal(); desactivarFalta(); desactivarPerdida(); // Tirara 2 tiros libres <API key> = 2; } else { Player aux = (Player)listBox_LocalRoster.SelectedItem; if (aux != null) { fallo(2, aux); // Change UI state activarRebotes(false); <API key>(); } else { SelectPlayer nuevo = new SelectPlayer(local.Players); nuevo.ShowDialog(); this.listBox_LocalRoster.SelectedItem = nuevo.JugadorSeleccionado; <API key>(sender, e); } } } <summary> Sucede cuando el equipo VISITANTE erra un DOBLE </summary> private void <API key>(object sender, EventArgs e) { desactivarPuntos(); if (procesoFalta) { // Cambia la interfaz del usuario activarTOVisitante(); <API key>(); desactivarFalta(); desactivarPerdida(); // Tirara 2 tiros libres <API key> = 2; } else { Player aux = (Player)<API key>.SelectedItem; if (aux != null) { fallo(2, aux); // Change UI state activarRebotes(); desactivarTOLocal(); } else { SelectPlayer nuevo = new SelectPlayer(visitor.Players); nuevo.ShowDialog(); this.<API key>.SelectedItem = nuevo.JugadorSeleccionado; <API key>(sender, e); } } } <summary> Sucede cuando el equipo LOCAL erra un TRIPLE </summary> private void <API key>(object sender, EventArgs e) { desactivarPuntos(); if (procesoFalta) { // Cambia la interfaz del usuario activarTOLocal(); activarLibreLocal(); desactivarFalta(); desactivarPerdida(); // Tirara 3 tiros libres <API key> = 3; } else { Player aux = (Player)listBox_LocalRoster.SelectedItem; if (aux != null) { fallo(3, aux); // Change UI state activarRebotes(false); <API key>(); } else { SelectPlayer nuevo = new SelectPlayer(local.Players); nuevo.ShowDialog(); this.listBox_LocalRoster.SelectedItem = nuevo.JugadorSeleccionado; <API key>(sender, e); } } } <summary> Sucede cuando el equipo VISITANTE erra un TRIPLE </summary> private void <API key>(object sender, EventArgs e) { desactivarPuntos(); if (procesoFalta) { // Cambia la interfaz del usuario activarTOVisitante(); <API key>(); desactivarFalta(); desactivarPerdida(); // Tirara 3 tiros libres <API key> = 3; } else { Player aux = (Player)<API key>.SelectedItem; if (aux != null) { fallo(3, aux); // Change UI state activarRebotes(); desactivarTOLocal(); } else { SelectPlayer nuevo = new SelectPlayer(visitor.Players); nuevo.ShowDialog(); this.<API key>.SelectedItem = nuevo.JugadorSeleccionado; <API key>(sender, e); } } } <summary> Sucede cuando el equipo LOCAL logra un rebote OFENSIVO </summary> private void btn_rebote_L_Click(object sender, EventArgs e) { Player aux = (Player)listBox_LocalRoster.SelectedItem; if(aux != null) { // Registra el rebote aux.RebotesOfensivos++; registrarRebote(aux.CompleteName, true); // Cambial el entorno desactivarRebotes(); activarFalta(); activarPerdida(); activarPuntos(); // Activa TODOS los tiempos muertos activarTO(); // Vuelve a correr el reloj! correrContinuacion(); } else { SelectPlayer nuevo = new SelectPlayer(local.Players); nuevo.ShowDialog(); this.listBox_LocalRoster.SelectedItem = nuevo.JugadorSeleccionado; btn_rebote_L_Click(sender, e); } } <summary> Sucede cuando el equipo VISITANTE logra un rebote OFENSIVO </summary> private void <API key>(object sender, EventArgs e) { Player aux = (Player)<API key>.SelectedItem; if (aux != null) { // Registra el rebote aux.RebotesOfensivos++; registrarRebote(aux.CompleteName, true); // Cambial el entorno desactivarRebotes(); activarFalta(); activarPerdida(); activarPuntos(); // Activa TODOS los tiempos muertos activarTO(); // Vuelve a correr el reloj! correrContinuacion(); } else { SelectPlayer nuevo = new SelectPlayer(visitor.Players); nuevo.ShowDialog(); this.<API key>.SelectedItem = nuevo.JugadorSeleccionado; <API key>(sender, e); } } <summary> Sucede cuando el equipo LOCAL logra un rebote DEFENSIVO </summary> private void <API key>(object sender, EventArgs e) { Player aux = (Player)listBox_LocalRoster.SelectedItem; if (aux != null) { // Registra el rebote aux.RebotesDefensivos++; registrarRebote(aux.CompleteName); // Cambial el entorno desactivarRebotes(); activarFalta(); activarPerdida(); activarPuntos(); // Activa TODOS los tiempos muertos activarTO(); // Vuelve a correr el reloj! correrContinuacion(); } else { SelectPlayer nuevo = new SelectPlayer(local.Players); nuevo.ShowDialog(); this.listBox_LocalRoster.SelectedItem = nuevo.JugadorSeleccionado; <API key>(sender, e); } } <summary> Sucede cuando el equipo VISITANTE logra un rebote DEFENSIVO </summary> private void <API key>(object sender, EventArgs e) { Player aux = (Player)<API key>.SelectedItem; if (aux != null) { // Registra el rebote aux.RebotesDefensivos++; registrarRebote(aux.CompleteName); // Cambial el entorno desactivarRebotes(); activarFalta(); activarPerdida(); activarPuntos(); // Activa TODOS los tiempos muertos activarTO(); // Vuelve a correr el reloj! correrContinuacion(); } else { SelectPlayer nuevo = new SelectPlayer(visitor.Players); nuevo.ShowDialog(); this.<API key>.SelectedItem = nuevo.JugadorSeleccionado; <API key>(sender, e); } } <summary> Sucede cuando el equipo LOCAL encesto un Tiro Libre </summary> private void <API key>(object sender, EventArgs e) { <API key> Player aux = (Player)listBox_LocalRoster.SelectedItem; if (aux != null) { anotacion(1, aux); if (<API key> == 0) { // Cambia el tiempo muerto de mando activarTO(); desactivarTOLocal(); // Desactiva los tiros libres <API key>(); activarContinuacion(); procesoFalta = false; } } else { // Selecciona el jugador LOCAL que ENCESTO el tiro SelectPlayer nuevo = new SelectPlayer(local.Players); nuevo.ShowDialog(); this.listBox_LocalRoster.SelectedItem = nuevo.JugadorSeleccionado; <API key>(sender, e); } } <summary> Sucede cuando el equipo VISITANTE encesto un Tiro Libre </summary> private void <API key>(object sender, EventArgs e) { <API key> Player aux = (Player)<API key>.SelectedItem; if (aux != null) { anotacion(1, aux, false); if (<API key> == 0) { // Cambia el tiempo muerto de mando activarTO(); <API key>(); <API key>(); activarContinuacion(); procesoFalta = false; } } else { // Selecciona el jugador VISITANTE que ENCESTO el tiro SelectPlayer nuevo = new SelectPlayer(visitor.Players); nuevo.ShowDialog(); this.<API key>.SelectedItem = nuevo.JugadorSeleccionado; <API key>(sender, e); } } <summary> Sucede cuando el equipo LOCAL erra un tiro libre </summary> private void <API key>(object sender, EventArgs e) { <API key> Player aux = (Player)listBox_LocalRoster.SelectedItem; if (aux != null) { fallo(1, aux); if (<API key> == 0) { <API key>(); correrContinuacion(); procesoFalta = false; // Se encienden los rebotes activarRebotes(false); } } else { // Selecciona el jugador LOCAL que FALLO el tiro SelectPlayer window = new SelectPlayer(local.Players); window.ShowDialog(); this.listBox_LocalRoster.SelectedItem = window.JugadorSeleccionado; <API key>(sender, e); } } <summary> Sucede cuando el equipo VISITANTE erra un tiro libre </summary> private void <API key>(object sender, EventArgs e) { <API key> Player aux = (Player)<API key>.SelectedItem; if (aux != null) { fallo(1, aux); if (<API key> == 0) { <API key>(); correrContinuacion(); procesoFalta = false; // Se encienden los rebotes activarRebotes(false); } } else { // Selecciona el jugador LOCAL que FALLO el tiro SelectPlayer nuevo = new SelectPlayer(visitor.Players); nuevo.ShowDialog(); this.<API key>.SelectedItem = nuevo.JugadorSeleccionado; <API key>(sender, e); } } <summary> Abre un dialogo pidiendo confirmación al usuario para salir del programa </summary> private void partido_FormClosing(object sender, <API key> e) { if (!closeWindow) { DialogResult userResponce = MessageBox.Show("Esta seguro que desea cerrar la ventana?\n"+ "Los datos no seran guardados.", "Cerrar ventana", MessageBoxButtons.YesNo, MessageBoxIcon.Question, <API key>.Button2); if (userResponce == System.Windows.Forms.DialogResult.No) e.Cancel = true; } } private void <API key>(object sender, EventArgs e) { desactivarPuntos(); desactivarRebotes(); desactivarFalta(); desactivarPerdida(); // Activa el boton de Comienzo activarContinuacion(); procesoBalonAfuera = true; // Activa el proceso Balon Afuera } private void <API key>(object sender, EventArgs e) { desactivarPuntos(); desactivarRebotes(); desactivarFalta(); desactivarPerdida(); // Activa el boton de Comienzo activarContinuacion(); procesoBalonAfuera = true; // Activa el proceso Balon Afuera } } }
#include "V3DResourceMemory.h" #include "V3DDevice.h" #include "V3DBuffer.h" #include "V3DImage.h" #include "V3DAdapter.h" /* public - V3DResourceMemory */ V3DResourceMemory* V3DResourceMemory::Create() { return V3D_NEW_T(V3DResourceMemory); } V3D_RESULT V3DResourceMemory::Initialize(IV3DDevice* pDevice, V3DFlags propertyFlags, uint64_t size, const wchar_t* pDebugName) { V3D_ASSERT(pDevice != nullptr); V3D_ASSERT(propertyFlags != 0); V3D_ASSERT(size != 0); m_pDevice = V3D_TO_ADD_REF(static_cast<V3DDevice*>(pDevice)); <API key>(this, <API key>, V3D_SAFE_NAME(this, pDebugName)); m_Source.memoryPropertyFlags = <API key>(propertyFlags); <API key> allocInfo{}; allocInfo.sType = <API key>; allocInfo.pNext = nullptr; allocInfo.allocationSize = size; allocInfo.memoryTypeIndex = m_pDevice-><API key>()-><API key>(m_Source.memoryPropertyFlags); VkResult vkResult = vkAllocateMemory(m_pDevice->GetSource().device, &allocInfo, nullptr, &m_Source.deviceMemory); if (vkResult != VK_SUCCESS) { return ToV3DResult(vkResult); } m_Source.memoryMappedRange.memory = m_Source.deviceMemory; <API key>(m_pDevice-><API key>(), m_Source.deviceMemory, V3D_SAFE_NAME(this, pDebugName)); m_Desc.propertyFlags = propertyFlags; m_Desc.size = size; return V3D_OK; } V3D_RESULT V3DResourceMemory::Initialize(IV3DDevice* pDevice, V3DFlags propertyFlags, uint32_t resourceCount, IV3DResource** ppResources, const wchar_t* pDebugName) { V3D_ASSERT(pDevice != nullptr); V3D_ASSERT(propertyFlags != 0); V3D_ASSERT(resourceCount != 0); V3D_ASSERT(ppResources != nullptr); m_pDevice = V3D_TO_ADD_REF(static_cast<V3DDevice*>(pDevice)); <API key>(this, <API key>, V3D_SAFE_NAME(this, pDebugName)); STLVector<IV3DResource*> resources; resources.reserve(resourceCount); for (uint32_t i = 0; i < resourceCount; i++) { #ifdef V3D_DEBUG switch (ppResources[i]->GetResourceDesc().type) { case <API key>: if (static_cast<V3DBuffer*>(ppResources[i])->CheckBindMemory() == true) { V3D_LOG_PRINT_ERROR(<API key>, V3D_SAFE_NAME(this, pDebugName), V3D_LOG_TYPE(ppResources), i, static_cast<V3DBuffer*>(ppResources[i])->GetDebugName()); return V3D_ERROR_FAIL; } break; case <API key>: if (static_cast<IV3DImageBase*>(ppResources[i])->CheckBindMemory() == true) { V3D_LOG_PRINT_ERROR(<API key>, V3D_SAFE_NAME(this, pDebugName), V3D_LOG_TYPE(ppResources), i, static_cast<IV3DImageBase*>(ppResources[i])->GetDebugName()); return V3D_ERROR_FAIL; } break; } #endif //V3D_DEBUG resources.push_back(ppResources[i]); } std::sort(resources.begin(), resources.end(), [](const IV3DResource* lh, const IV3DResource* rh) { return lh->GetResourceDesc().memoryAlignment > rh->GetResourceDesc().memoryAlignment; }); uint64_t vkMinAlignment = m_pDevice->GetSource().deviceProps.limits.<API key>; VkDeviceSize vkAllocSize = 0; STLVector<VkDeviceSize> vkOffsets; vkOffsets.resize(resourceCount); for (uint32_t i = 0; i < resourceCount; i++) { const V3DResourceDesc& resourceDesc = ppResources[i]->GetResourceDesc(); VkDeviceSize vkAlignment = V3D_MAX(vkMinAlignment, resourceDesc.memoryAlignment); if (vkAllocSize % vkAlignment) { vkAllocSize = (vkAllocSize / vkAlignment) * vkAlignment + vkAlignment; } vkOffsets[i] = vkAllocSize; vkAllocSize += resourceDesc.memorySize; } m_Source.memoryPropertyFlags = <API key>(propertyFlags); <API key> allocInfo{}; allocInfo.sType = <API key>; allocInfo.pNext = nullptr; allocInfo.allocationSize = vkAllocSize; allocInfo.memoryTypeIndex = m_pDevice-><API key>()-><API key>(m_Source.memoryPropertyFlags); VkResult vkResult = vkAllocateMemory(m_pDevice->GetSource().device, &allocInfo, nullptr, &m_Source.deviceMemory); if (vkResult != VK_SUCCESS) { return ToV3DResult(vkResult); } m_Source.memoryMappedRange.memory = m_Source.deviceMemory; <API key>(m_pDevice-><API key>(), m_Source.deviceMemory, V3D_SAFE_NAME(this, pDebugName)); m_Desc.propertyFlags = propertyFlags; m_Desc.size = vkAllocSize; V3D_RESULT result = V3D_ERROR_FAIL; for (uint32_t i = 0; i < resourceCount; i++) { IV3DResource* pResource = ppResources[i]; switch (pResource->GetResourceDesc().type) { case <API key>: result = static_cast<V3DBuffer*>(pResource)->BindMemory(this, vkOffsets[i]); if (result != V3D_OK) { return result; } break; case <API key>: result = static_cast<V3DImage*>(pResource)->BindMemory(this, vkOffsets[i]); if (result != V3D_OK) { return result; } break; } } return V3D_OK; } const V3DResourceMemory::Source& V3DResourceMemory::GetSource() const { return m_Source; } V3D_RESULT V3DResourceMemory::Map(uint64_t offset, uint64_t size, void** ppMemory) { if (m_Desc.size < (offset + size)) { return V3D_ERROR_FAIL; } if (m_pMemory != nullptr) { *ppMemory = m_pMemory + offset; return V3D_OK; } if (m_Source.memoryMappedRange.size != 0) { return V3D_ERROR_FAIL; } VkResult vkResult = vkMapMemory(m_pDevice->GetSource().device, m_Source.deviceMemory, offset, size, 0, ppMemory); if (vkResult != VK_SUCCESS) { return ToV3DResult(vkResult); } m_Source.memoryMappedRange.offset = offset; m_Source.memoryMappedRange.size = size; if ((m_Source.memoryPropertyFlags & <API key>) == 0) { vkResult = <API key>(m_pDevice->GetSource().device, 1, &m_Source.memoryMappedRange); if (vkResult != VK_SUCCESS) { return ToV3DResult(vkResult); } } return V3D_OK; } V3D_RESULT V3DResourceMemory::Unmap() { if (m_pMemory != nullptr) { return V3D_OK; } if (m_Source.memoryMappedRange.size == 0) { return V3D_ERROR_FAIL; } V3D_RESULT result = V3D_OK; if ((m_Source.memoryPropertyFlags & <API key>) == 0) { VkResult vkResult = <API key>(m_pDevice->GetSource().device, 1, &m_Source.memoryMappedRange); if (vkResult != VK_SUCCESS) { result = ToV3DResult(vkResult); } } m_Source.memoryMappedRange.offset = 0; m_Source.memoryMappedRange.size = 0; vkUnmapMemory(m_pDevice->GetSource().device, m_Source.deviceMemory); return result; } #ifdef V3D_DEBUG bool V3DResourceMemory::Debug_CheckMemory(uint64_t offset, uint64_t size) { return (m_Desc.size >= (offset + size)); } #endif //V3D_DEBUG /* public override - IV3DResourceMemory */ const <API key>& V3DResourceMemory::GetDesc() const { return m_Desc; } V3D_RESULT V3DResourceMemory::BeginMap() { if (m_Source.memoryMappedRange.size != 0) { return V3D_ERROR_FAIL; } VkResult vkResult = vkMapMemory(m_pDevice->GetSource().device, m_Source.deviceMemory, 0, m_Desc.size, 0, reinterpret_cast<void**>(&m_pMemory)); if (vkResult != VK_SUCCESS) { return ToV3DResult(vkResult); } m_Source.memoryMappedRange.offset = 0; m_Source.memoryMappedRange.size = m_Desc.size; if ((m_Source.memoryPropertyFlags & <API key>) == 0) { vkResult = <API key>(m_pDevice->GetSource().device, 1, &m_Source.memoryMappedRange); if (vkResult != VK_SUCCESS) { return ToV3DResult(vkResult); } } return V3D_OK; } V3D_RESULT V3DResourceMemory::EndMap() { if (m_Source.memoryMappedRange.size == 0) { return V3D_ERROR_FAIL; } V3D_RESULT result = V3D_OK; if ((m_Source.memoryPropertyFlags & <API key>) == 0) { VkResult vkResult = <API key>(m_pDevice->GetSource().device, 1, &m_Source.memoryMappedRange); if (vkResult != VK_SUCCESS) { result = ToV3DResult(vkResult); } } m_Source.memoryMappedRange.offset = 0; m_Source.memoryMappedRange.size = 0; vkUnmapMemory(m_pDevice->GetSource().device, m_Source.deviceMemory); m_pMemory = nullptr; return result; } /* public override - IV3DDeviceChild */ void V3DResourceMemory::GetDevice(IV3DDevice** ppDevice) { (*ppDevice) = V3D_TO_ADD_REF(m_pDevice); } /* public override - IV3DObject */ int64_t V3DResourceMemory::GetRefCount() const { return m_RefCounter; } void V3DResourceMemory::AddRef() { V3D_REF_INC(m_RefCounter); } void V3DResourceMemory::Release() { if (V3D_REF_DEC(m_RefCounter)) { V3D_REF_FENCE(); V3D_DELETE_THIS_T(this, V3DResourceMemory); } } /* private - V3DResourceMemory */ V3DResourceMemory::V3DResourceMemory() : m_RefCounter(1), m_pDevice(nullptr), m_Desc({}), m_Source({}), m_pMemory(nullptr) { m_Source.deviceMemory = VK_NULL_HANDLE; m_Source.memoryMappedRange.sType = <API key>; m_Source.memoryMappedRange.pNext = nullptr; } V3DResourceMemory::~V3DResourceMemory() { if (m_pDevice != nullptr) { m_pDevice-><API key>(); } if (m_Source.deviceMemory != VK_NULL_HANDLE) { vkFreeMemory(m_pDevice->GetSource().device, m_Source.deviceMemory, nullptr); <API key>(m_pDevice-><API key>(), m_Source.deviceMemory); } <API key>(this); V3D_RELEASE(m_pDevice); }
<?php namespace Peridot\Leo\Interfaces; use Peridot\Leo\Assertion; use Peridot\Leo\Interfaces\Assert\<API key>; use Peridot\Leo\Interfaces\Assert\ObjectAssertTrait; use Peridot\Leo\Interfaces\Assert\TypeAssertTrait; use Peridot\Leo\Leo; /** * Assert is a non-chainable, object oriented interface * on top of a Leo Assertion. * * @method instanceOf() instanceOf(object $actual, string $expected, string $message = "") Perform an instanceof assertion. * @method include() include(array $haystack, string $expected, string $message = "") Perform an inclusion assertion. * * @package Peridot\Leo\Interfaces */ class Assert { use TypeAssertTrait; use ObjectAssertTrait; use <API key>; /** * An array of operators mapping to assertions. * * @var array */ public static $operators = [ '==' => 'loosely->equal', '===' => 'equal', '>' => 'above', '>=' => 'least', '<' => 'below', '<=' => 'most', '!=' => 'not->loosely->equal', '!==' => 'not->equal', ]; /** * @var Assertion */ protected $assertion; /** * @param Assertion $assertion */ public function __construct(Assertion $assertion = null) { if ($assertion === null) { $assertion = Leo::assertion(); } $this->assertion = $assertion; } /** * Perform an a loose equality assertion. * * @param mixed $actual * @param mixed $expected * @param string $message */ public function equal($actual, $expected, $message = '') { $this->assertion->setActual($actual); return $this->assertion->to->loosely->equal($expected, $message); } /** * Perform a negated loose equality assertion. * * @param mixed $actual * @param mixed $expected * @param string $message */ public function notEqual($actual, $expected, $message = '') { $this->assertion->setActual($actual); return $this->assertion->to->not->equal($expected, $message); } /** * Performs a throw assertion. * * @param callable $fn * @param $exceptionType * @param string $exceptionMessage * @param string $message */ public function throws(callable $fn, $exceptionType, $exceptionMessage = '', $message = '') { $this->assertion->setActual($fn); return $this->assertion->to->throw($exceptionType, $exceptionMessage, $message); } /** * Performs a negated throw assertion. * * @param callable $fn * @param $exceptionType * @param string $exceptionMessage * @param string $message */ public function doesNotThrow(callable $fn, $exceptionType, $exceptionMessage = '', $message = '') { $this->assertion->setActual($fn); return $this->assertion->not->to->throw($exceptionType, $exceptionMessage, $message); } /** * Perform an ok assertion. * * @param mixed $object * @param string $message */ public function ok($object, $message = '') { $this->assertion->setActual($object); return $this->assertion->to->be->ok($message); } /** * Perform a negated assertion. * * @param mixed $object * @param string $message */ public function notOk($object, $message = '') { $this->assertion->setActual($object); return $this->assertion->to->not->be->ok($message); } /** * Perform a strict equality assertion. * * @param mixed $actual * @param mixed $expected * @param string $message */ public function strictEqual($actual, $expected, $message = '') { $this->assertion->setActual($actual); return $this->assertion->to->equal($expected, $message); } /** * Perform a negated strict equality assertion. * * @param mixed $actual * @param mixed $expected * @param string $message */ public function notStrictEqual($actual, $expected, $message = '') { $this->assertion->setActual($actual); return $this->assertion->to->not->equal($expected, $message); } /** * Perform a pattern assertion. * * @param string $value * @param string $pattern * @param string $message */ public function match($value, $pattern, $message = '') { $this->assertion->setActual($value); return $this->assertion->to->match($pattern, $message); } /** * Perform a negated pattern assertion. * * @param string $value * @param string $pattern * @param string $message */ public function notMatch($value, $pattern, $message = '') { $this->assertion->setActual($value); return $this->assertion->to->not->match($pattern, $message); } /** * Compare two values using the given operator. * * @param mixed $left * @param string $operator * @param mixed $right * @param string $message */ public function operator($left, $operator, $right, $message = '') { if (!isset(static::$operators[$operator])) { throw new \<API key>("Invalid operator $operator"); } $this->assertion->setActual($left); return $this->assertion->{static::$operators[$operator]}($right, $message); } /** * Defined to allow use of reserved words for methods. * * @param $method * @param $args */ public function __call($method, $args) { switch ($method) { case 'instanceOf': return <API key>([$this, 'isInstanceOf'], $args); case 'include': return <API key>([$this, 'isIncluded'], $args); default: throw new \<API key>("Call to undefined method $method"); } } }
<?php declare(strict_types=1); namespace Gitilicious\GitClient\Test\Unit\Cli\Output; use Gitilicious\GitClient\Cli\Output\Output; class OutputTest extends \<API key> { public function <API key>() { $output = new Output('foo' . PHP_EOL . 'bar'); $this->assertSame(2, $output->getNumberOfLines()); } public function <API key>() { $output = new Output('foo' . PHP_EOL . 'bar'); $this->assertSame('foo', $output->getLine(1)); $this->assertSame('bar', $output->getLine(2)); } public function <API key>() { $output = new Output('foo' . PHP_EOL . 'bar'); $this->assertSame('', $output->getLine(3)); } }
black = '#202427'; red = '#EB6A58'; // red green = '#49A61D'; // green yellow = '#959721'; // yellow blue = '#798FB7'; // blue magenta = '#CD7B7E'; // pink cyan = '#4FA090'; // cyan white = '#909294'; // light gray lightBlack = '#292B35'; // medium gray lightRed = '#DB7824'; // red lightGreen = '#09A854'; // green lightYellow = '#AD8E4B'; // yellow lightBlue = '#309DC1'; // blue lightMagenta= '#C874C2'; // pink lightCyan = '#1BA2A0'; // cyan lightWhite = '#8DA3B8'; // white t.prefs_.set('<API key>', [ black , red , green , yellow, blue , magenta , cyan , white, lightBlack , lightRed , lightGreen , lightYellow, lightBlue , lightMagenta , lightCyan , lightWhite ]); t.prefs_.set('cursor-color', lightWhite); t.prefs_.set('foreground-color', lightWhite); t.prefs_.set('background-color', black);
import cuid from "cuid"; import Result, { isError } from "../../common/Result"; import assert from "assert"; import { di, singleton, diKey } from "../../common/di"; import { ILocalFiles, ILocalFilesKey } from "../../common/LocalFiles"; import { IStoreDB, IStoreDBKey, MergeEntity } from "../../common/db/StoreDB"; import { ApplicationDto, applicationKey, CanvasDto, DiagramDto, DiagramInfoDto, DiagramInfoDtos, FileDto, } from "./StoreDtos"; import { LocalEntity } from "../../common/db/LocalDB"; import { RemoteEntity } from "../../common/db/RemoteDB"; export interface Configuration { onRemoteChanged: (keys: string[]) => void; onSyncChanged: (isOK: boolean, error?: Error) => void; isSyncEnabled: boolean; } export const IStoreKey = diKey<IStore>(); export interface IStore { configure(config: Partial<Configuration>): void; triggerSync(): Promise<Result<void>>; openNewDiagram(): DiagramDto; <API key>(): Promise<Result<DiagramDto>>; tryOpenDiagram(diagramId: string): Promise<Result<DiagramDto>>; setDiagramName(name: string): void; exportDiagram(): DiagramDto; // Used for print or export getRootCanvas(): CanvasDto; getCanvas(canvasId: string): CanvasDto; writeCanvas(canvas: CanvasDto): void; <API key>(): Result<string>; getRecentDiagrams(): DiagramInfoDto[]; deleteDiagram(diagramId: string): void; saveDiagramToFile(): void; loadDiagramFromFile(): Promise<Result<string>>; <API key>(): Promise<void>; } const rootCanvasId = "root"; const <API key>: ApplicationDto = { diagramInfos: {} }; const defaultDiagramDto: DiagramDto = { id: "", name: "", canvases: {} }; @singleton(IStoreKey) export class Store implements IStore { private currentDiagramId: string = ""; private config: Configuration = { onRemoteChanged: () => {}, onSyncChanged: () => {}, isSyncEnabled: false, }; constructor( // private localData: ILocalData = di(ILocalDataKey), private localFiles: ILocalFiles = di(ILocalFilesKey), private db: IStoreDB = di(IStoreDBKey) ) {} public configure(config: Partial<Configuration>): void { this.config = { ...this.config, ...config }; this.db.configure({ onConflict: (local: LocalEntity, remote: RemoteEntity) => this.onEntityConflict(local, remote), config, onRemoteChanged: (keys: string[]) => this.onRemoteChange(keys), }); } public triggerSync(): Promise<Result<void>> { return this.db.triggerSync(); } public openNewDiagram(): DiagramDto { const now = Date.now(); const id = cuid(); const name = this.getUniqueName(); console.log("new diagram", id, name); const diagramDto: DiagramDto = { id: id, name: name, canvases: {}, }; const applicationDto = this.getApplicationDto(); applicationDto.diagramInfos[id] = { id: id, name: name, accessed: now, }; this.db.<API key>([id, applicationKey]); this.db.writeBatch([ { key: applicationKey, value: applicationDto }, { key: id, value: diagramDto }, ]); this.currentDiagramId = id; return diagramDto; } public async <API key>(): Promise<Result<DiagramDto>> { const id = this.<API key>(); if (isError(id)) { return id as Error; } const diagramDto = await this.db.<API key><DiagramDto>(id); if (isError(diagramDto)) { return diagramDto; } this.db.<API key>([id, applicationKey]); this.currentDiagramId = id; return diagramDto; } public async tryOpenDiagram(id: string): Promise<Result<DiagramDto>> { const diagramDto = await this.db.<API key><DiagramDto>(id); if (isError(diagramDto)) { return diagramDto; } this.db.<API key>([id, applicationKey]); this.currentDiagramId = id; // Too support most recently used diagram feature, we update accessed time const applicationDto = this.getApplicationDto(); const diagramInfo = applicationDto.diagramInfos[id]; applicationDto.diagramInfos[id] = { ...diagramInfo, accessed: Date.now() }; this.db.writeBatch([{ key: applicationKey, value: applicationDto }]); return diagramDto; } public getRootCanvas(): CanvasDto { return this.getCanvas(rootCanvasId); } public getCanvas(canvasId: string): CanvasDto { const diagramDto = this.getDiagramDto(); const canvasDto = diagramDto.canvases[canvasId]; assert(canvasDto); return canvasDto; } public writeCanvas(canvasDto: CanvasDto): void { const diagramDto = this.getDiagramDto(); const id = diagramDto.id; diagramDto.canvases[canvasDto.id] = canvasDto; this.db.writeBatch([{ key: id, value: diagramDto }]); } public getRecentDiagrams(): DiagramInfoDto[] { return Object.values(this.getApplicationDto().diagramInfos).sort((i1, i2) => i1.accessed < i2.accessed ? 1 : i1.accessed > i2.accessed ? -1 : 0 ); } // For printing/export public exportDiagram(): DiagramDto { return this.getDiagramDto(); } public deleteDiagram(id: string): void { console.log("Delete diagram", id); const applicationDto = this.getApplicationDto(); delete applicationDto.diagramInfos[id]; this.db.writeBatch([{ key: applicationKey, value: applicationDto }]); this.db.removeBatch([id]); } public setDiagramName(name: string): void { const diagramDto = this.getDiagramDto(); const id = diagramDto.id; diagramDto.name = name; const applicationDto = this.getApplicationDto(); applicationDto.diagramInfos[id] = { applicationDto.diagramInfos[id], name: name, accessed: Date.now(), }; this.db.writeBatch([ { key: applicationKey, value: applicationDto }, { key: id, value: diagramDto }, ]); } public async loadDiagramFromFile(): Promise<Result<string>> { const fileText = await this.localFiles.loadFile(); const fileDto: FileDto = JSON.parse(fileText); // if (!(await this.sync.uploadDiagrams(fileDto.diagrams))) { // // save locally // fileDto.diagrams.forEach((d: DiagramDto) => this.local.writeDiagram(d)); //fileDto.diagrams.forEach((d: DiagramDto) => this.local.writeDiagram(d)); const firstDiagramId = fileDto.diagrams[0]?.id; if (!firstDiagramId) { return new Error("No valid diagram in file"); } return firstDiagramId; } public saveDiagramToFile(): void { const diagramDto = this.getDiagramDto(); const fileDto: FileDto = { diagrams: [diagramDto] }; const fileText = JSON.stringify(fileDto, null, 2); this.localFiles.saveFile(`${diagramDto.name}.json`, fileText); } public async <API key>(): Promise<void> { // let diagrams = await this.sync.downloadAllDiagrams(); // if (!diagrams) { // // Read from local // diagrams = this.local.readAllDiagrams(); // let diagrams = this.local.readAllDiagrams(); // const fileDto = { diagrams: diagrams }; // const fileText = JSON.stringify(fileDto, null, 2); // this.localFiles.saveFile(`diagrams.json`, fileText); } public <API key>(): Result<string> { const resentDiagrams = this.getRecentDiagrams(); if (resentDiagrams.length === 0) { return new RangeError("not found"); } return resentDiagrams[0].id; } public getApplicationDto(): ApplicationDto { return this.db.readLocal<ApplicationDto>( applicationKey, <API key> ); } private onRemoteChange(keys: string[]) { this.config.onRemoteChanged(keys); } private onEntityConflict( local: LocalEntity, remote: RemoteEntity ): MergeEntity { if ("diagramInfos" in local.value) { return this.<API key>(local, remote); } return this.onDiagramConflict(local, remote); } private <API key>( local: LocalEntity, remote: RemoteEntity ): MergeEntity { console.warn("Application conflict", local, remote); const mergeDiagramInfos = ( newerDiagrams: DiagramInfoDtos, olderDiagrams: DiagramInfoDtos ): DiagramInfoDtos => { let mergedDiagrams = { ...olderDiagrams, ...newerDiagrams }; Object.keys(newerDiagrams).forEach((key) => { if (!(key in newerDiagrams)) { delete mergedDiagrams[key]; } }); return mergedDiagrams; }; if (local.version >= remote.version) { // Local entity has more edits, merge diagram infos, but priorities remote const applicationDto: ApplicationDto = { diagramInfos: mergeDiagramInfos( local.value.diagramInfos, remote.value.diagramInfos ), }; return { key: local.key, value: applicationDto, version: local.version, }; } // Remote entity since that has more edits, merge diagram infos, but priorities local const applicationDto: ApplicationDto = { diagramInfos: mergeDiagramInfos( remote.value.diagramInfos, local.value.diagramInfos ), }; return { key: remote.key, value: applicationDto, version: remote.version, }; } private onDiagramConflict( local: LocalEntity, remote: RemoteEntity ): MergeEntity { console.warn("Diagram conflict", local, remote); if (local.version >= remote.version) { // use local since it has more edits return { key: local.key, value: local.value, version: local.version, }; } // Use remote entity since that has more edits return { key: remote.key, value: remote.value, version: remote.version, }; } private getDiagramDto(): DiagramDto { return this.db.readLocal<DiagramDto>( this.currentDiagramId, defaultDiagramDto ); } private getUniqueName(): string { const diagrams = Object.values(this.getApplicationDto().diagramInfos); for (let i = 0; i < 99; i++) { const name = "Name" + (i > 0 ? ` (${i})` : ""); if (!diagrams.find((d) => d.name === name)) { return name; } } return "Name"; } }
<html> <head> <title>Julian Fellows's panel show appearances</title> <script type="text/javascript" src="../common.js"></script> <link rel="stylesheet" media="all" href="../style.css" type="text/css"/> <script type="text/javascript" src="../people.js"></script> <!--#include virtual="head.txt" --> </head> <body> <!--#include virtual="nav.txt" --> <div class="page"> <h1>Julian Fellows's panel show appearances</h1> <p>Julian Fellows has appeared in <span class="total">1</span> episodes between 2003-2003. Note that these appearances may be for more than one person if multiple people have the same name.</p> <div class="performerholder"> <table class="performer"> <tr style="vertical-align:bottom;"> <td><div style="height:100px;" class="performances male" title="1"></div><span class="year">2003</span></td> </tr> </table> </div> <ol class="episodes"> <li><strong>2003-05-22</strong> / <a href="../shows/call-my-bluff.html">Call My Bluff</a></li> </ol> </div> </body> </html>
var createSubmit = function(name, primus, keyDict) { return function(event) { var message = $('#message').val(); if (message.length === 0) { event.preventDefault(); return; } $('#message').val(''); $('#message').focus(); var BigInteger = forge.jsbn.BigInteger; var data = JSON.parse(sessionStorage[name]); var pem = data.pem; var privateKey = forge.pki.privateKeyFromPem(pem); var ownPublicKey = forge.pki.setRsaPublicKey(new BigInteger(data.n), new BigInteger(data.e)); var keys = []; var iv = forge.random.getBytesSync(16); var key = forge.random.getBytesSync(16); var cipher = forge.cipher.createCipher('AES-CBC', key); cipher.start({iv: iv}); cipher.update(forge.util.createBuffer(message, 'utf8')); cipher.finish(); var encryptedMessage = cipher.output.getBytes(); var encryptedKey = ownPublicKey.encrypt(key, 'RSA-OAEP'); keys.push({ 'name': name, 'key': encryptedKey }); var md = forge.md.sha1.create(); md.update(message, 'utf8'); var signature = privateKey.sign(md); var recipients = $.map($("#recipients").tokenfield("getTokens"), function(o) {return o.value;}); var deferredRequests = []; for (var i = 0; i < recipients.length; i++) { (function (index) { var retrieveKey = function(pk) { if (pk === false) { return; } if (keyDict[recipients[i]] === undefined) { keyDict[recipients[i]] = pk; } var publicKey = forge.pki.setRsaPublicKey(new BigInteger(pk.n), new BigInteger(pk.e)); var encryptedKey = publicKey.encrypt(key, 'RSA-OAEP'); keys.push({ 'name': recipients[index], 'key': encryptedKey }); } if (keyDict[recipients[i]] === undefined) { deferredRequests.push($.post('/user/getpublickey', {'name' : recipients[i]}, retrieveKey)); } else { retrieveKey(keyDict[recipients[i]]); } })(i); } $.when.apply(null, deferredRequests).done(function() { primus.substream('messageStream').write({'message': encryptedMessage, 'keys': keys, 'iv': iv, 'signature': signature, 'recipients': recipients}); }); event.preventDefault(); }; };
<?php namespace action\sub; use net\shawn_huang\pretty\Action; class Index extends Action { protected function run() { $this->put([ 'holy' => 'shit' ]); } }
<?php namespace keeko\account\action; use keeko\framework\foundation\AbstractAction; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use keeko\framework\domain\payload\Success; /** * User Widget * * This code is automatically created. Modifications will probably be overwritten. * * @author gossi */ class AccountWidgetAction extends AbstractAction { /** * Automatically generated run method * * @param Request $request * @return Response */ public function run(Request $request) { $prefs = $this->getServiceContainer()->getPreferenceLoader()-><API key>(); $translator = $this->getServiceContainer()->getTranslator(); return $this->responder->run($request, new Success([ 'account_url' => $prefs->getAccountUrl(), 'destination' => $prefs->getAccountUrl() . '/' . $translator->trans('slug.login'), 'redirect' => $request->getUri(), 'login_label' => $prefs->getUserLogin() ])); } }
#include <zmq/zmqabstractnotifier.h> #include <util.h> <API key>::~<API key>() { assert(!psocket); } bool <API key>::NotifyBlock(const CBlockIndex * /*CBlockIndex*/) { return true; } bool <API key>::NotifyTransaction(const CTransaction &/*transaction*/) { return true; } bool <API key>::<API key>(const CTransactionRef &/*transaction*/) { return true; }