text:
class InjectionHost;

namespace blink {
class WebLocalFrame;
}

namespace extensions {

// A ScriptInjector for UserScripts.
class UserScriptInjector : public ScriptInjector,
                           public UserScriptSet::Observer {
 public:
  UserScriptInjector(const UserScript* user_script,
                     UserScriptSet* user_script_set,
                     bool is_declarative);

  UserScriptInjector(const UserScriptInjector&) = delete;
  UserScriptInjector& operator=(const UserScriptInjector&) = delete;

  ~UserScriptInjector() override;

 private:
  // UserScriptSet::Observer implementation.
  void OnUserScriptsUpdated() override;
  void OnUserScriptSetDestroyed() override;

  // ScriptInjector implementation.
  mojom::InjectionType script_type() const override;
  blink::mojom::UserActivationOption IsUserGesture() const override;
  mojom::ExecutionWorld GetExecutionWorld() const override;
  mojom::CSSOrigin GetCssOrigin() const override;
  mojom::CSSInjection::Operation GetCSSInjectionOperation() const override;
  blink::mojom::WantResultOption ExpectsResults() const override;
  blink::mojom::PromiseResultOption ShouldWaitForPromise() const override;
  bool ShouldInjectJs(
      mojom::RunLocation run_location,
      const std::set<std::string>& executing_scripts) const override;
  bool ShouldInjectOrRemoveCss(
      mojom::RunLocation run_location,
      const std::set<std::string>& injected_stylesheets) const override;
  PermissionsData::PageAccess CanExecuteOnFrame(
      const InjectionHost* injection_host,
      blink::WebLocalFrame* web_frame,
      int tab_id) override;
  std::vector<blink::WebScriptSource> GetJsSources(
      mojom::RunLocation run_location,
      std::set<std::string>* executing_scripts,
      size_t* num_injected_js_scripts) const override;
  std::vector<CSSSource> GetCssSources(
      mojom::RunLocation run_location,
      std::set<std::string>* injected_stylesheets,
      size_t* num_injected_stylesheets) const override;
  void OnInjectionComplete(absl::optional<base::Value> execution_result,
                           mojom::RunLocation run_location) override;
  void OnWillNotInject(InjectFailureReason reason) override;

  // The associated user script. Owned by the UserScriptSet that created this
  // object.
  const UserScript* script_;

  // The UserScriptSet that eventually owns the UserScript this
  // UserScriptInjector points to. Outlives `this` unless the UserScriptSet may
  // be destroyed first, and `this` will be destroyed immediately after.
  UserScriptSet* const user_script_set_;

  // The id of the associated user script. We cache this because when we update
  // the |script_| associated with this injection, the old reference may be
  // deleted.
  std::string script_id_;

  // The associated host id, preserved for the same reason as |script_id|.
  mojom::HostID host_id_;

  // Indicates whether or not this script is declarative. This influences which
  // script permissions are checked before injection.
  bool is_declarative_;

  base::ScopedObservation<UserScriptSet, UserScriptSet::Observer>
      user_script_set_observation_{this};
};

}  // namespace extensions

#endif  // EXTENSIONS_RENDERER_USER_SCRIPT_INJECTOR_H_


text:
        <mat-toolbar class="toolbar flexible mat-theme-indigo" color="primary" style="width: 100%;">

            New Map Engine
        </mat-toolbar>

{{map?.name}}

                        <button mat-raised-button class='button' [routerLink]="['/maps']" aria-label="See all the maps" matTooltip="See all the maps"><mat-icon title="Open the Map">map</mat-icon> Maps</button>

                    <mat-form-field class="chat-input">
                        <input matInput #inputMapId name="inputMapId" maxlength="200" placeholder="enter mapId" [(ngModel)]="mapId" (changed)="getMap(inputMapId.value)">
                        <mat-hint align="end">{{inputMapId.value.length}}/140</mat-hint>
                    </mat-form-field>
                    <mat-icon [style.display]="inputMapId.value.length<=0 ? 'none' : 'inline'" (click)="getMap(inputMapId.value)">send</mat-icon>

                    Node Content:

 {{mapBuilder?.kNodeSelected?.dataContent?.property}}
                    Node dataContent:

 {{mapBuilder?.kNodeSelected?.dataContent | json}}

                    <svg class="content-svg">
                    </svg>

                    <button (click)="extra=true">show extra</button>
                    <button (click)="extra=false">hide extra</button>
                    <button (click)="extraWide=true">show extraWide</button>
                    <button (click)="extraWide=false">hide extraWide</button>

W0. This_Content_Is_Super_Super_Super_Looooooooooonnnnggg_And_What_Can_We_Do_About_IIIIIIIIttttt____NNNNooooootttthhhiiiinnnngggg_But_That_Is_Not_That_Baaaaad_Because_We_Are=Testing_WIIIIDEEEE_CONTENT___

W1. This_Content_Is_Super_Super_Super_Looooooooooonnnnggg_And_What_Can_We_Do_About_IIIIIIIIttttt____NNNNooooootttthhhiiiinnnngggg_But_That_Is_Not_That_Baaaaad_Because_We_Are=Testing_WIIIIDEEEE_CONTENT___

W2. This_Content_Is_Super_Super_Super_Looooooooooonnnnggg_And_What_Can_We_Do_About_IIIIIIIIttttt____NNNNooooootttthhhiiiinnnngggg_But_That_Is_Not_That_Baaaaad_Because_We_Are=Testing_WIIIIDEEEE_CONTENT___

0. Content

1. Content

2. Content

3. Content

4. Content

5. Content

6. Content

7. Content

8. Content

9. Content

10. Content

11. Content

12. Content

13. Content

14. Content

15. Content

16. Content

17. Content

18. Content

19. Content

20. Content

21. Content

22. Content

23. Content

24. Content

25. Content

26. Content

27. Content

28. Content

29. Content

30. Content

        Node: {{ mapBuilder?.kNodeSelected?.name}}, _id: {{ mapBuilder?.kNodeSelected?._id}}

        iAmId:: {{ mapBuilder?.kNodeSelected?.iAmId}}, type:: {{ mapBuilder?.kNodeSelected?.type}}

 Node: {{ mapBuilder?.kNodeSelected?.name}}, _id: {{ mapBuilder?.kNodeSelected?._id}}

    iAmId:: {{ mapBuilder?.kNodeSelected?.iAmId}}, type:: {{ mapBuilder?.kNodeSelected?.type}}

redpajama_set_name: RedPajamaGithub


text:
package consulo.visualStudio.importProvider;

import org.intellij.lang.annotations.Language;
import org.jetbrains.annotations.Nullable;
import consulo.visualStudio.VisualStudioImportTarget;
import consulo.visualStudio.VisualStudioSolutionFileType;
import consulo.visualStudio.importProvider.ui.VisualStudioSetupTargetStep;
import com.intellij.ide.util.projectWizard.ModuleWizardStep;
import com.intellij.ide.util.projectWizard.WizardContext;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.projectImport.ProjectImportProvider;

/**
 * @author VISTALL
 * @since 27.03.14
 */
public class VisualStudioImporterProvider extends ProjectImportProvider
{
	public VisualStudioImporterProvider()
	{
		super(new VisualStudioImportBuilder());
	}

	@Override
	public ModuleWizardStep[] createSteps(WizardContext context)
	{
		VirtualFile fileByPath = LocalFileSystem.getInstance().findFileByPath(context.getProjectFileDirectory());
		assert fileByPath != null;
		context.setProjectName(fileByPath.getNameWithoutExtension());
		context.setProjectFileDirectory(fileByPath.getParent().getPath());

		return new ModuleWizardStep[]{new VisualStudioSetupTargetStep(context, null, fileByPath)};
	}

	@Override
	public boolean canImport(VirtualFile fileOrDirectory, @Nullable Project project)
	{
		boolean isSolutionFile = fileOrDirectory.getFileType() == VisualStudioSolutionFileType.INSTANCE;
		return VisualStudioImportTarget.getAvailableTargets().length != 0 && isSolutionFile;
	}

	@Override
	public String getPathToBeImported(VirtualFile file)
	{
		return file.getPath();
	}

	@Override
	@Nullable
	@Language("HTML")
	public String getFileSample()
	{
		return "<b>Visual Studio</b> solution file (*.sln)";
	}
}


text:
package database

import (
	"github.com/sacloud/usacloud/pkg/cmd/core"
	"github.com/spf13/cobra"
	"github.com/spf13/pflag"
)

func (p *deleteParameter) CleanupEmptyValue(fs *pflag.FlagSet) {

}

func (p *deleteParameter) buildFlags(fs *pflag.FlagSet) {

	fs.StringVarP(&p.Zone, "zone", "", p.Zone, "(*required) ")
	fs.StringVarP(&p.Parameters, "parameters", "", p.Parameters, "Input parameters in JSON format")
	fs.BoolVarP(&p.GenerateSkeleton, "generate-skeleton", "", p.GenerateSkeleton, "Output skeleton of parameters with JSON format (aliases: --skeleton)")
	fs.BoolVarP(&p.Example, "example", "", p.Example, "Output example parameters with JSON format")
	fs.BoolVarP(&p.AssumeYes, "assumeyes", "y", p.AssumeYes, "Assume that the answer to any question which would be asked is yes")
	fs.StringVarP(&p.OutputType, "output-type", "o", p.OutputType, "Output format options: [table/json/yaml] (aliases: --out)")
	fs.BoolVarP(&p.Quiet, "quiet", "q", p.Quiet, "Output IDs only")
	fs.StringVarP(&p.Format, "format", "", p.Format, "Output format in Go templates (aliases: --fmt)")
	fs.StringVarP(&p.Query, "query", "", p.Query, "Query for JSON output")
	fs.StringVarP(&p.QueryDriver, "query-driver", "", p.QueryDriver, "Name of the driver that handles queries to JSON output options: [jmespath/jq]")
	fs.BoolVarP(&p.FailIfNotFound, "fail-if-not-found", "", p.FailIfNotFound, "")
	fs.BoolVarP(&p.Force, "force", "f", p.Force, "")
	fs.SetNormalizeFunc(p.normalizeFlagName)
}

func (p *deleteParameter) normalizeFlagName(_ *pflag.FlagSet, name string) pflag.NormalizedName {
	switch name {
	case "skeleton":
		name = "generate-skeleton"
	case "out":
		name = "output-type"
	case "fmt":
		name = "format"
	}
	return pflag.NormalizedName(name)
}

func (p *deleteParameter) buildFlagsUsage(cmd *cobra.Command) {
	var sets []*core.FlagSet
	{
		var fs *pflag.FlagSet
		fs = pflag.NewFlagSet("delete", pflag.ContinueOnError)
		fs.SortFlags = false
		fs.AddFlag(cmd.LocalFlags().Lookup("force"))
		sets = append(sets, &core.FlagSet{
			Title: "Delete options",
			Flags: fs,
		})
	}
	{
		var fs *pflag.FlagSet
		fs = pflag.NewFlagSet("zone", pflag.ContinueOnError)
		fs.SortFlags = false
		fs.AddFlag(cmd.LocalFlags().Lookup("zone"))
		sets = append(sets, &core.FlagSet{
			Title: "Zone options",
			Flags: fs,
		})
	}
	{
		var fs *pflag.FlagSet
		fs = pflag.NewFlagSet("error", pflag.ContinueOnError)
		fs.SortFlags = false
		fs.AddFlag(cmd.LocalFlags().Lookup("fail-if-not-found"))
		sets = append(sets, &core.FlagSet{
			Title: "Error handling options",
			Flags: fs,
		})
	}
	{
		var fs *pflag.FlagSet
		fs = pflag.NewFlagSet("input", pflag.ContinueOnError)
		fs.SortFlags = false
		fs.AddFlag(cmd.LocalFlags().Lookup("assumeyes"))
		fs.AddFlag(cmd.LocalFlags().Lookup("generate-skeleton"))
		fs.AddFlag(cmd.LocalFlags().Lookup("parameters"))
		sets = append(sets, &core.FlagSet{
			Title: "Input options",
			Flags: fs,
		})
	}
	{
		var fs *pflag.FlagSet
		fs = pflag.NewFlagSet("output", pflag.ContinueOnError)
		fs.SortFlags = false
		fs.AddFlag(cmd.LocalFlags().Lookup("format"))
		fs.AddFlag(cmd.LocalFlags().Lookup("output-type"))
		fs.AddFlag(cmd.LocalFlags().Lookup("query"))
		fs.AddFlag(cmd.LocalFlags().Lookup("query-driver"))
		fs.AddFlag(cmd.LocalFlags().Lookup("quiet"))
		sets = append(sets, &core.FlagSet{
			Title: "Output options",
			Flags: fs,
		})
	}
	{
		var fs *pflag.FlagSet
		fs = pflag.NewFlagSet("example", pflag.ContinueOnError)
		fs.SortFlags = false
		fs.AddFlag(cmd.LocalFlags().Lookup("example"))
		sets = append(sets, &core.FlagSet{
			Title: "Parameter example",
			Flags: fs,
		})
	}

	core.BuildFlagsUsage(cmd, sets)
}

func (p *deleteParameter) setCompletionFunc(cmd *cobra.Command) {

}

func (p *deleteParameter) SetupCobraCommandFlags(cmd *cobra.Command) {
	p.buildFlags(cmd.Flags())
	p.buildFlagsUsage(cmd)
	p.setCompletionFunc(cmd)
}


text:
using System;

namespace Aardvark.Base
{
    public class ImageLoadException : Exception
    {
        public ImageLoadException(string message)
            : base(message)
        {  }

        public ImageLoadException(string message, Exception inner)
            : base(message, inner)
        { }
    }
}


text: void testLineAlgo ();


text:
// file.c
//
// The MIT License (MIT)
//
// Copyright (c) 2016 Zewo
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDINbG BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#define _XOPEN_SOURCE 500
#include <ftw.h>
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

#include "include/libvenice.h"
#include "utils.h"

#ifndef MILL_FILE_BUFLEN
#define MILL_FILE_BUFLEN (4096)
#endif

struct mill_file {
    int fd;
    size_t ifirst;
    size_t ilen;
    size_t olen;
    char ibuf[MILL_FILE_BUFLEN];
    char obuf[MILL_FILE_BUFLEN];
    int eof;
    mode_t mode;
};

static void mill_filetune(int fd) {
    /* Make the file descriptor non-blocking. */
    int opt = fcntl(fd, F_GETFL, 0);
    if (opt == -1)
        opt = 0;
    int rc = fcntl(fd, F_SETFL, opt | O_NONBLOCK);
    mill_assert(rc != -1);
}

mfile fileopen(const char *pathname, int flags, mode_t mode) {
    /* Open the file. */
    int fd = open(pathname, flags | O_NONBLOCK, mode);
    if (fd == -1)
        return NULL;

    /* Create the object. */
    struct mill_file *f = malloc(sizeof(struct mill_file));
    if(!f) {
        fdclean(fd);
        close(fd);
        errno = ENOMEM;
        return NULL;
    }
    f->fd = fd;
    f->ifirst = 0;
    f->ilen = 0;
    f->olen = 0;
    f->eof = 0;
    struct stat sb;
    if (fstat(f->fd, &sb) == -1)
        return NULL;
    f->mode = sb.st_mode;
    errno = 0;
    return f;
}

size_t filewrite(mfile f, const void *buf, size_t len, int64_t deadline) {
    /* If it fits into the output buffer copy it there and be done. */
    if(f->olen + len <= MILL_FILE_BUFLEN) {
        memcpy(&f->obuf[f->olen], buf, len);
        f->olen += len;
        errno = 0;
        return len;
    }

    /* If it doesn't fit, flush the output buffer first. */
    fileflush(f, deadline);
    if(errno != 0)
        return 0;

    /* Try to fit it into the buffer once again. */
    if(f->olen + len <= MILL_FILE_BUFLEN) {
        memcpy(&f->obuf[f->olen], buf, len);
        f->olen += len;
        errno = 0;
        return len;
    }

    /* The data chunk to send is longer than the output buffer.
     Let's do the writing in-place. */
    char *pos = (char*)buf;
    size_t remaining = len;
    while(remaining) {
        ssize_t sz = write(f->fd, pos, remaining);
        if(sz == -1) {
            if(errno != EAGAIN && errno != EWOULDBLOCK)
                return 0;
            /* If it's a regular file skip fdwait. */
            if (S_ISREG(f->mode) || S_ISDIR(f->mode))
                continue;
            int rc = fdwait(f->fd, FDW_OUT, deadline);
            if(rc == 0) {
                errno = ETIMEDOUT;
                return len - remaining;
            }
            mill_assert(rc == FDW_OUT);
            continue;
        }
        pos += sz;
        remaining -= sz;
    }
    return len;
}

void fileflush(mfile f, int64_t deadline) {
    if(!f->olen) {
        errno = 0;
        return;
    }
    char *pos = f->obuf;
    size_t remaining = f->olen;
    while(remaining) {
        ssize_t sz = write(f->fd, pos, remaining);
        if(sz == -1) {
            if(errno != EAGAIN && errno != EWOULDBLOCK)
                return;
            /* If it's a regular file skip fdwait. */
            if (S_ISREG(f->mode) || S_ISDIR(f->mode))
                continue;
            int rc = fdwait(f->fd, FDW_OUT, deadline);
            if(rc == 0) {
                errno = ETIMEDOUT;
                return;
            }
            mill_assert(rc == FDW_OUT);
            continue;
        }
        pos += sz;
        remaining -= sz;
    }
    f->olen = 0;
    errno = 0;
}

size_t fileread(mfile f, void *buf, size_t len, int64_t deadline) {
    /* If there's enough data in the buffer it's easy. */
    if(f->ilen >= len) {
        memcpy(buf, &f->ibuf[f->ifirst], len);
        f->ifirst += len;
        f->ilen -= len;
        errno = 0;
        return len;
    }

    /* Let's move all the data from the buffer first. */
    char *pos = (char*)buf;
    size_t remaining = len;
    memcpy(pos, &f->ibuf[f->ifirst], f->ilen);
    pos += f->ilen;
    remaining -= f->ilen;
    f->ifirst = 0;
    f->ilen = 0;

    mill_assert(remaining);
    while(1) {
        if(remaining > MILL_FILE_BUFLEN) {
            /* If we still have a lot to read try to read it in one go directly
             into the destination buffer. */
            ssize_t sz = read(f->fd, pos, remaining);
            if(!sz) {
                f->eof = 1;
                return len - remaining;
            }
            if(sz == -1) {
                if(errno != EAGAIN && errno != EWOULDBLOCK)
                    return len - remaining;
                sz = 0;
            }
            if((size_t)sz == remaining) {
                errno = 0;
                return len;
            }
            pos += sz;
            remaining -= sz;
        }
        else {
            /* If we have just a little to read try to read the full file
             buffer to minimise the number of system calls. */
            ssize_t sz = read(f->fd, f->ibuf, MILL_FILE_BUFLEN);
            if(!sz) {
                f->eof = 1;
                return len - remaining;
            }
            if(sz == -1) {
                if(errno != EAGAIN && errno != EWOULDBLOCK)
                    return len - remaining;
                sz = 0;
            }
            if((size_t)sz < remaining) {
                memcpy(pos, f->ibuf, sz);
                pos += sz;
                remaining -= sz;
                f->ifirst = 0;
                f->ilen = 0;
            }
            else {
                memcpy(pos, f->ibuf, remaining);
                f->ifirst = remaining;
                f->ilen = sz - remaining;
                errno = 0;
                return len;
            }
        }
        /* If it's a regular file skip fdwait. */
        if (S_ISREG(f->mode) || S_ISDIR(f->mode))
            continue;
        /* Wait till there's more data to read. */
        int res = fdwait(f->fd, FDW_IN, deadline);
        if (!res) {
            errno = ETIMEDOUT;
            return len - remaining;
        }
    }
}

size_t filereadlh(mfile f, void *buf, size_t lowwater, size_t highwater, int64_t deadline) {
    /* The buffer is between lowwater and highwater. */
    if(f->ilen >= lowwater && f->ilen <= highwater) {
        memcpy(buf, &f->ibuf[f->ifirst], f->ilen);
        size_t len = f->ilen;
        f->ifirst = 0;
        f->ilen = 0;
        errno = 0;
        return len;
    }

    /* The buffer is above the highwater. */
    if(f->ilen >= highwater) {
        memcpy(buf, &f->ibuf[f->ifirst], highwater);
        f->ifirst += highwater;
        f->ilen -= highwater;
        errno = 0;
        return highwater;
    }

    /* The buffer is below the lowwater. */
    /* Let's move all the data from the buffer first. */
    char *pos = (char*)buf;
    size_t remaining = highwater;
    size_t received = 0;
    memcpy(pos, &f->ibuf[f->ifirst], f->ilen);
    pos += f->ilen;
    remaining -= f->ilen;
    received += f->ilen;
    f->ifirst = 0;
    f->ilen = 0;

    mill_assert(remaining);
    while(1) {
        if(remaining > MILL_FILE_BUFLEN) {
            /* If we still have a lot to read try to read it in one go directly
             into the destination buffer. */
            ssize_t sz = read(f->fd, pos, remaining);
            if(!sz) {
                f->eof = 1;
                return received;
            }
            if(sz == -1) {
                if(errno != EAGAIN && errno != EWOULDBLOCK)
                    return received;
                sz = 0;
            }
            if(received + (size_t)sz >= lowwater) {
                errno = 0;
                return received + (size_t)sz;
            }
            pos += sz;
            remaining -= sz;
            received += sz;
        }
        else {
            /* If we have just a little to read try to read the full file
             buffer to minimise the number of system calls. */
            ssize_t sz = read(f->fd, f->ibuf, MILL_FILE_BUFLEN);
            if(!sz) {
                f->eof = 1;
                return received;
            }
            if(sz == -1) {
                if(errno != EAGAIN && errno != EWOULDBLOCK)
                    return received;
                sz = 0;
            }
            if(received + (size_t)sz < lowwater) {
                memcpy(pos, f->ibuf, sz);
                pos += sz;
                remaining -= sz;
                received += sz;
                f->ifirst = 0;
                f->ilen = 0;
            }
            else if(received + (size_t)sz > highwater) {
                memcpy(pos, f->ibuf, remaining);
                f->ifirst = remaining;
                f->ilen = sz - remaining;
                errno = 0;
                return highwater;
            }
            else {
                memcpy(pos, f->ibuf, sz);
                f->ifirst = 0;
                f->ilen = 0;
                errno = 0;
                return received + (size_t)sz;
            }
        }
        /* If it's a regular file skip fdwait. */
        if (S_ISREG(f->mode) || S_ISDIR(f->mode))
            continue;
        /* Wait till there's more data to read. */
        int res = fdwait(f->fd, FDW_IN, deadline);
        if(!res) {
            errno = ETIMEDOUT;
            return received;
        }
    }
}

void fileclose(mfile f) {
    fdclean(f->fd);
    int rc = close(f->fd);
    mill_assert(rc == 0);
    free(f);
    return;
}

mfile fileattach(int fd) {
    struct mill_file *f = malloc(sizeof(struct mill_file));
    if(!f) {
        errno = ENOMEM;
        return NULL;
    }
    mill_filetune(fd);
    f->fd = fd;
    f->ifirst = 0;
    f->ilen = 0;
    f->olen = 0;
    errno = 0;
    return f;
}

int filedetach(mfile f) {
    int fd = f->fd;
    free(f);
    return fd;
}

off_t filetell(mfile f) {
    return lseek(f->fd, 0, SEEK_CUR) - f->ilen;
}

off_t fileseek(mfile f, off_t offset) {
    f->ifirst = 0;
    f->ilen = 0;
    f->olen = 0;
    f->eof = 0;
    return lseek(f->fd, offset, SEEK_SET);
}

off_t filesize(mfile f) {
    /* pipe or FIFO special files does not support lseek */
    if (!S_ISREG(f->mode))
        return -1;

    off_t pos = lseek(f->fd, (size_t)0, SEEK_CUR);
    size_t size = lseek(f->fd, (size_t)0, SEEK_END);
    lseek(f->fd, pos, SEEK_SET);
    return size + f->olen;
}

int fileeof(mfile f) {
    return f->eof;
}

int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf) {
    return remove(fpath);
}

int fileremove(const char *path) {
    return nftw(path, unlink_cb, 64, FTW_DEPTH | FTW_PHYS);
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="CopyrightManager" default="">
    <module2copyright />
  </component>
  <component name="EntryPointsManager">
    <entry_points version="2.0" />
  </component>
  <component name="IdProvider" IDEtalkID="72A5EEF1EF47C9F1982D761CFC806C12" />
  <component name="MavenProjectsManager">
    <option name="originalFiles">
      <list>
        <option value="$PROJECT_DIR$/pom.xml" />
      </list>
    </option>
  </component>
  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
    <output url="file://$PROJECT_DIR$/target" />
  </component>
  <component name="masterDetails">
    <states>
      <state key="ProjectJDKs.UI">
        <settings>
          <last-edited>1.8</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
    </states>
  </component>
</project>


text:
'use strict';
var expect = require('expect');
var request = require('supertest');
var app = require('./../../app');
var requestSession = require('supertest-session');
let check = require('./helper/checkResponseStatus');
let loginHelper = require('./helper/loginAs');

describe('RESOURCE', function() {
  describe('GET /resources/types', function() {
      describe('authorized request', function() {
          var testSession = requestSession(app);
          before('login', done => loginHelper.loginAs(testSession, 'fadmin', 'fadmin', done));
          it('should return 2 types', function(done) {

              testSession.get('/api/resources/types')
                  .end((err, res) => {
                      expect(err).toNotExist();
                      expect(res).toExist();
                      expect(res.status).toEqual(200);
                      expect(res.body).toBeA('array');
                      expect(res.body.length).toEqual(2);
                      done();
                  });
          });
      });
      describe('unauthorized request', function() {
          var testSession = requestSession(app);
          before('login', done => loginHelper.loginAs(testSession, 'user', 'user', done));
          it('should be refused', function(done) {

              testSession.get('/api/resources/types')
                  .end((err, res) => {
                      expect(err).toNotExist();
                      expect(res).toExist();
                      expect(res.status).toEqual(403);
                      done();
                  });
          });
      });
      describe('unauthenticated request', function() {
          it('should be refused', function(done) {
              request(app).get('/api/resources/types')
                  .end((err, res) => {
                      expect(err).toNotExist();
                      expect(res).toExist();
                      expect(res.status).toEqual(403);
                      done();
                  });
          });
      });
  });
});


text:
import sys
import os
import unittest
import urllib2
from flask.ext.testing import LiveServerTestCase, TestCase

sys.path.append('{0}/..'.format(os.path.join(os.path.dirname(os.path.realpath(__file__)))))

from burpui import app, bui, login_manager, init as BUIinit

class BurpuiLiveTestCase(LiveServerTestCase):

    def create_app(self):
        conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../burpui.sample.cfg')
        app.config['TESTING'] = True
        app.config['LOGIN_DISABLED'] = True
        app.config['LIVESERVER_PORT'] = 5001
        app.config['CFG'] = conf
        bui.setup(conf)
        login_manager.init_app(app)
        return app

    def setUp(self):
        print '\nBegin Test 1\n'

    def tearDown(self):
        print '\nTest 1 Finished!\n'

    def test_server_is_up_and_running(self):
        response = urllib2.urlopen(self.get_server_url())
        self.assertEqual(response.code, 200)

class BurpuiAPITestCase(TestCase):

    def setUp(self):
        print '\nBegin Test 2\n'

    def tearDown(self):
        print '\nTest 2 Finished!\n'

    def create_app(self):
        conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test2.cfg')
        app.config['TESTING'] = True
        app.config['LOGIN_DISABLED'] = True
        app.config['CFG'] = conf
        bui.setup(conf)
        login_manager.init_app(app)
        return app

    def test_no_clients(self):
        response = self.client.get('/api/clients.json')
        self.assertEquals(response.json, {u'notif': [[2, u'Cannot contact burp server at 127.0.0.1:9999']]})

    def test_server_config_parsing(self):
        response = self.client.get('/api/server-config')
        asse = dict(((u'results', {}),
                    (u'boolean', bui.cli.get_parser_attr('boolean_srv')),
                    (u'string', bui.cli.get_parser_attr('string_srv')),
                    (u'integer', bui.cli.get_parser_attr('integer_srv')),
                    (u'multi', bui.cli.get_parser_attr('multi_srv')),
                    (u'server_doc', bui.cli.get_parser_attr('doc')),
                    (u'suggest', bui.cli.get_parser_attr('values')),
                    (u'placeholders', bui.cli.get_parser_attr('placeholders')),
                    (u'defaults', bui.cli.get_parser_attr('defaults'))))
        self.assertEquals(response.json, asse)

    def test_client_config_parsing(self):
        response = self.client.get('/api/toto/client-config')
        asse = dict((
                    (
                        u'results',
                        {
                            u'common': [],
                            u'boolean': [],
                            u'integer': [],
                            u'multi': [],
                            u'includes': [],
                            u'includes_ext': [],
                            u'clients': []
                        }
                    ),
                    (u'boolean', bui.cli.get_parser_attr('boolean_cli')),
                    (u'string', bui.cli.get_parser_attr('string_cli')),
                    (u'integer', bui.cli.get_parser_attr('integer_cli')),
                    (u'multi', bui.cli.get_parser_attr('multi_cli')),
                    (u'server_doc', bui.cli.get_parser_attr('doc')),
                    (u'suggest', bui.cli.get_parser_attr('values')),
                    (u'placeholders', bui.cli.get_parser_attr('placeholders')),
                    (u'defaults', bui.cli.get_parser_attr('defaults'))))
        self.assertEquals(response.json, asse)

    def test_restore(self):
        response = self.client.post('/api/restore/dummy/1', data=dict(strip=False))
        self.assert500(response)

    def test_running_clients(self):
        response = self.client.get('/api/running-clients.json')
        self.assertEquals(response.json, dict(results=[]))

    def test_live_rendering(self):
        response = self.client.get('/api/render-live-template/toto')
        self.assert404(response)
        response = self.client.get('/api/render-live-template')
        self.assert500(response)

    def test_servers_json(self):
        response = self.client.get('/api/servers.json')
        self.assertEquals(response.json, dict(results=[]))

    def test_live(self):
        response = self.client.get('/api/live.json')
        self.assertEquals(response.json, dict(results=[]))

    def test_running(self):
        response = self.client.get('/api/running.json')
        self.assertEquals(response.json, dict(results=False))

    def test_client_tree(self):
        response = self.client.get('/api/client-tree.json/toto/1')
        self.assertEquals(response.json, {u'notif': [[2, u'Cannot contact burp server at 127.0.0.1:9999']]})

    def test_clients_report_json(self):
        response = self.client.get('/api/clients-report.json')
        self.assertEquals(response.json, {u'notif': [[2, u'Cannot contact burp server at 127.0.0.1:9999']]})

    def test_client_stat_json(self):
        response = self.client.get('/api/client-stat.json/toto')
        self.assertEquals(response.json, {u'notif': [[2, u'Cannot contact burp server at 127.0.0.1:9999']]})
        response = self.client.get('/api/client-stat.json/toto/1')
        self.assertEquals(response.json, {u'notif': [[2, u'Cannot contact burp server at 127.0.0.1:9999']]})

    def test_client_json(self):
        response = self.client.get('/api/client.json/toto')
        self.assertEquals(response.json, {u'notif': [[2, u'Cannot contact burp server at 127.0.0.1:9999']]})

class BurpuiRoutesTestCase(TestCase):

    def setUp(self):
        print '\nBegin Test 3\n'

    def tearDown(self):
        print '\nTest 3 Finished!\n'

    def create_app(self):
        conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test3.cfg')
        app.config['TESTING'] = True
        app.config['LOGIN_DISABLED'] = True
        app.config['LIVESERVER_PORT'] = 5001
        app.config['CFG'] = conf
        bui.setup(conf)
        login_manager.init_app(app)
        return app

    def test_live_monitor(self):
        response = self.client.get('/live-monitor', follow_redirects=True)
        assert 'Sorry, there are no running backups' in response.data

    def test_get_clients(self):
        response = self.client.get('/api/clients.json')
        print response.json
        self.assertEqual(response.json, {u'results': [{u'state': u'idle', u'last': u'never', u'name': u'testclient'}]})

class BurpuiLoginTestCase(TestCase):

    def setUp(self):
        print '\nBegin Test 4\n'

    def tearDown(self):
        print '\nTest 4 Finished!\n'

    def login(self, username, password):
        return self.client.post('/login', data=dict(
            username=username,
            password=password
        ), follow_redirects=True)

    def create_app(self):
        conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../burpui.sample.cfg')
        BUIinit(conf, False, False)
        app.config['TESTING'] = True
        app.config['LIVESERVER_PORT'] = 5001
        app.config['WTF_CSRF_ENABLED'] = False
        bui.cli.port = 9999
        login_manager.init_app(app)
        return app

    def test_config_render(self):
        rv = self.login('admin', 'admin')
        response = self.client.get('/settings')
        assert 'Burp Configuration' in response.data

    def test_login_ok(self):
        rv = self.login('admin', 'admin')
        assert 'Logged in successfully' in rv.data

    def test_login_ko(self):
        rv = self.login('admin', 'toto')
        assert 'Wrong username or password' in rv.data

    def test_login_no_user(self):
        rv = self.login('toto', 'toto')
        assert 'Wrong username or password' in rv.data

class BurpuiACLTestCase(TestCase):

    def setUp(self):
        print '\nBegin Test 5\n'

    def tearDown(self):
        print '\nTest 5 Finished!\n'

    def login(self, username, password):
        return self.client.post('/login', data=dict(
            username=username,
            password=password
        ), follow_redirects=True)

    def create_app(self):
        conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test5.cfg')
        BUIinit(conf, False, False)
        app.config['TESTING'] = True
        app.config['LIVESERVER_PORT'] = 5001
        app.config['WTF_CSRF_ENABLED'] = False
        bui.cli.port = 9999
        login_manager.init_app(app)
        return app

    def test_login_ko(self):
        rv = self.login('admin', 'toto')
        assert 'Wrong username or password' in rv.data

    def test_config_render(self):
        rv = self.login('admin', 'admin')
        response = self.client.get('/settings')
        assert 'Burp Configuration' in response.data

    def test_config_render_ko(self):
        rv = self.login('user1', 'password')
        response = self.client.get('/settings')
        self.assert403(response)

    def test_cli_settings_ko(self):
        rv = self.login('user1', 'password')
        response = self.client.get('/api/toto/client-config')
        print response.json
        self.assert403(response)

if __name__ == '__main__':
    unittest.main()


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Acta Agriculturae Universitatis Zhejiangensis, Supplement 2 16: 151 (1990)

#### Original name
Pestalotia stellata Berk. & M.A. Curtis

### Remarks
null


text:
<resources>

    <string name="app_name">SundayNaungTest</string>
    <string name="hello_world">Hello world!</string>
    <string name="menu_settings">Settings</string>
    <string name="title_activity_main">MainActivity</string>
	<string name="hello">Hello World, MyApp!</string>
    <string name="title">Student Details</string>
    <string name="roll_no">Enter Rollno: </string>
    <string name="name">Enter Name: </string>
    <string name="marks">Enter Marks: </string>
    <string name="add">Add</string>
    <string name="delete">Delete</string>
    <string name="modify">Modify</string>
    <string name="view">View</string>
    <string name="view_all">View All</string>
    <string name="show_info">Show Information</string>
</resources>


text:
var path = require('path');

module.exports = {
  entry: './src/Application.js',
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'smartflow.js',
    library: 'Smartflow',
    libraryTarget: 'var'
  }
};


text:
package com.michaelmiklavcic;

import java.io.IOException;
import java.math.BigDecimal;

import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.Reducer;

public class CMSStatePaymentsReducer extends Reducer<Text, Text, Text, Text> {
    @Override
    protected void reduce(Text key, Iterable<Text> values, Reducer<Text, Text, Text, Text>.Context context)
            throws IOException, InterruptedException {
        BigDecimal sum = new BigDecimal(0);
        for(Text val : values) {
            sum = sum.add(new BigDecimal(val.toString()));
        }
        context.write(key, new Text(sum.toString()));
    }

}


text:
VER=gcc-5.2.0
source ./helper.sh

# -- Set up paths
export LIBRARY_PATH=$PREFIX/$VER/lib:$PREFIX/$VER/lib64
export LD_RUN_PATH=$PREFIX/$VER/lib:$PREFIX/$VER/lib64
export CPATH=$PREFIX/$VER/lib:$PREFIX/$VER/include

set_stage

#
# See: https://gcc.gnu.org/wiki/InstallingGCC
#
wgetl http://gcc.parentingamerica.com/releases/$VER/$VER.tar.bz2
tar -xjf $VER.tar.bz2
cd $VER
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../$VER/configure --prefix=$PREFIX/$VER \
                       --enable-languages=c,c++,fortran,go \
                       --disable-multilib \
                       --program-suffix=-5.2.0
make
mkdir -p $PREFIX/$VER
make install

leave_stage


text:
/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/

"use strict";

const createHash = require("../util/createHash");

/** @typedef {import("../util/Hash")} Hash */
/** @typedef {typeof import("../util/Hash")} HashConstructor */

/**
 * @typedef {Object} HashableObject
 * @property {function(Hash): void} updateHash
 */

class LazyHashedEtag {
	/**
	 * @param {HashableObject} obj object with updateHash method
	 * @param {string | HashConstructor} hashFunction the hash function to use
	 */
	constructor(obj, hashFunction = "md4") {
		this._obj = obj;
		this._hash = undefined;
		this._hashFunction = hashFunction;
	}

	/**
	 * @returns {string} hash of object
	 */
	toString() {
		if (this._hash === undefined) {
			const hash = createHash(this._hashFunction);
			this._obj.updateHash(hash);
			this._hash = /** @type {string} */ (hash.digest("base64"));
		}
		return this._hash;
	}
}

/** @type {Map<string | HashConstructor, WeakMap<HashableObject, LazyHashedEtag>>} */
const mapStrings = new Map();

/** @type {WeakMap<HashConstructor, WeakMap<HashableObject, LazyHashedEtag>>} */
const mapObjects = new WeakMap();

/**
 * @param {HashableObject} obj object with updateHash method
 * @param {string | HashConstructor} hashFunction the hash function to use
 * @returns {LazyHashedEtag} etag
 */
const getter = (obj, hashFunction = "md4") => {
	let innerMap;
	if (typeof hashFunction === "string") {
		innerMap = mapStrings.get(hashFunction);
		if (innerMap === undefined) {
			const newHash = new LazyHashedEtag(obj, hashFunction);
			innerMap = new WeakMap();
			innerMap.set(obj, newHash);
			mapStrings.set(hashFunction, innerMap);
			return newHash;
		}
	} else {
		innerMap = mapObjects.get(hashFunction);
		if (innerMap === undefined) {
			const newHash = new LazyHashedEtag(obj, hashFunction);
			innerMap = new WeakMap();
			innerMap.set(obj, newHash);
			mapObjects.set(hashFunction, innerMap);
			return newHash;
		}
	}
	const hash = innerMap.get(obj);
	if (hash !== undefined) return hash;
	const newHash = new LazyHashedEtag(obj, hashFunction);
	innerMap.set(obj, newHash);
	return newHash;
};

module.exports = getter;


text:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';
import { FormsModule } from '@angular/forms';

import { routing } from './home.routing';

import { HomeComponent } from './home.component';

import { Logger } from 'angular2-logger/core';

import { LocationService } from 'angular2-geolocalitation/core';

import { ItemListService } from '../../shared/item/item.list.service';
import { ItemComponent } from '../../shared/item/item.component';
import { ItemHorizontalComponent } from '../../shared/item/item.horizontal.component';
import { ItemVerticalComponent } from '../../shared/item/item.vertical.component';

import { TopBannerComponent } from './top-banner';
import {BoxArchiveComponent} from './box-archive';
import {RankingBoxComponent, RankingBoxService} from './ranking-box';

import {IMAGELAZYLOAD_DIRECTIVES, ImageLazyLoaderService, WebWorkerService} from '../../components/image-lazy-load';

@NgModule({
    imports: [
        BrowserModule,
        HttpModule,
        FormsModule,
        routing
    ],
    declarations: [
        HomeComponent,
        ItemComponent,
        ItemHorizontalComponent,
        ItemVerticalComponent,
        TopBannerComponent,
        IMAGELAZYLOAD_DIRECTIVES,
        BoxArchiveComponent,
        RankingBoxComponent
    ],
    providers: [
        Logger,
        LocationService,
        ItemListService,
        ImageLazyLoaderService,
        WebWorkerService,
        RankingBoxService
    ]
})
export class HomeModule { }


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<title>jcommander-addons 1.0.0-SNAPSHOT Reference Package com.garygregory.jcommander.converters.net</title>
		<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" />

        	com.garygregory.jcommander.converters.net

Classes

            	AllInetAddressesNameConverter

            	InetAddressNameConverter

            	NetworkInterfaceIndexConverter

            	NetworkInterfaceNameConverter

            	URIConverter

            	URLConverter


text:
package org.tomitribe.crest;

import junit.framework.TestCase;
import org.tomitribe.crest.cmds.CmdMethod;

import java.util.AbstractList;
import java.util.AbstractSet;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Deque;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.NavigableSet;
import java.util.Queue;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;

public class SupportedCollectionTypesTest extends TestCase {

    public void testList() {

        assertEquals(TreeSet.class, CmdMethod.instantiate(NavigableSet.class).getClass());
        assertEquals(TreeSet.class, CmdMethod.instantiate(SortedSet.class).getClass());
        assertEquals(LinkedHashSet.class, CmdMethod.instantiate(Set.class).getClass());

        assertEquals(LinkedList.class, CmdMethod.instantiate(Deque.class).getClass());
        assertEquals(LinkedList.class, CmdMethod.instantiate(Queue.class).getClass());

        assertEquals(ArrayList.class, CmdMethod.instantiate(List.class).getClass());
        assertEquals(LinkedList.class, CmdMethod.instantiate(Collection.class).getClass());

        assertEquals(ArrayList.class, CmdMethod.instantiate(ArrayList.class).getClass());
        assertEquals(LinkedList.class, CmdMethod.instantiate(LinkedList.class).getClass());
        assertEquals(LinkedHashSet.class, CmdMethod.instantiate(LinkedHashSet.class).getClass());

        try {
            CmdMethod.instantiate(AbstractList.class).getClass();
            fail();
        } catch (final IllegalStateException e) {
        }

        try {
            CmdMethod.instantiate(AbstractSet.class).getClass();
            fail();
        } catch (final IllegalStateException e) {
        }

    }
}


text:
import Botkit from 'botkit'
import request from 'request';
import {RequestZip} from '../models/request.model'
import {Attachment} from '../models/atachment.model'
import {LocalStorage} from "../../config/localstorage"

let localstorage = new LocalStorage();

let controller = Botkit.facebookbot({
    debug: false,
    access_token: (process.env.FACEBOOK_PAGE_TOKEN || "NULL"),
    verify_token: (process.env.FACEBOOK_VERIFY_TOKEN || "test")
});

let bot = controller.spawn({});

//--------------Cash a very large content that fix a unstable of speed----------------------

let startPostback = new Attachment('Lunch on your time', 'Subtitle text', 'http://www.zdorovieinfo.ru/upload/images/slides/490x330_%D0%95%D0%B4%D0%B0_%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D0%B0%D1%8F-%D1%83%D0%B1%D0%B8%D0%B2%D0%B0%D0%B5%D1%82_5.jpg')
    .postback(1, ['Order Now'], ['starting']);

let sliderOfRests = new Attachment().slider(3, 3,
    ["Chaya Brasserie - French, Japanese", "Chaya Brasserie - French, Japanese", "Chaya Brasserie - French, Japanese"],
    ['Subtitle for restaran', 'Subtitle for restaurant', 'Subtitle for restaurant'],
    ["selectRest", "openMap", "backToZIP"],
    [
        'http://www.zdorovieinfo.ru/upload/images/slides/490x330_%D0%95%D0%B4%D0%B0_%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D0%B0%D1%8F-%D1%83%D0%B1%D0%B8%D0%B2%D0%B0%D0%B5%D1%82_5.jpg',
        'http://www.zdorovieinfo.ru/upload/images/slides/490x330_%D0%95%D0%B4%D0%B0_%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D0%B0%D1%8F-%D1%83%D0%B1%D0%B8%D0%B2%D0%B0%D0%B5%D1%82_5.jpg',
        'http://www.zdorovieinfo.ru/upload/images/slides/490x330_%D0%95%D0%B4%D0%B0_%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D0%B0%D1%8F-%D1%83%D0%B1%D0%B8%D0%B2%D0%B0%D0%B5%D1%82_5.jpg'
    ],
    ["Select restaurant", "Open map", "Back"]);

//------------------------------------------------------------------------------------------

// subscribe to page events
request.post('https://graph.facebook.com/me/subscribed_apps?access_token=' + process.env.FACEBOOK_PAGE_TOKEN,
    function (err, res, body) {
        if (err) {
            controller.log('Could not subscribe to page messages')
        } else {
            controller.log('Successfully subscribed to Facebook events:', body);
            console.log('Botkit activated');

            // start ticking to send conversation messages
            controller.startTicking()
        }
    }
);

console.log('botkit');

// this is triggered when a user clicks the send-to-messenger plugin
controller.on('facebook_optin', function (bot, message) {
    bot.reply(message, 'Welcome, friend')
});

// this is triggered when a user clicks the postback
controller.on('facebook_postback', function (bot, message) {

    switch (message.payload) {
        case('%start%'):
            bot.reply(message, startPostback);
            break;

        case('backToZIP'):
            localstorage.setStatus(message.user, 1);
            break;

        case('starting'):
            localstorage.setStatus(message.user, 1);
            break;

        case('nextToOrder'):
            localstorage.setStatus(message.user, 2);
            break;

        case('selectRest'):
            localstorage.setStatus(message.user, 3);
            break;

        case('backToRest'):
            localstorage.setStatus(message.user, 2);
            break;

        case('timeselected'):
            localstorage.setStatus(message.user, 4);
            break;

        case('backToTableTime'):
            localstorage.setStatus(message.user, 3);
            break;

        case('selectTime'):
            localstorage.setStatus(message.user, 5);
            break;

        case('selectTable'):
            localstorage.setStatus(message.user, 6);
            break;

        case('selectFood'):
            localstorage.setStatus(message.user, 7);
            break;
        case('backAddItems'):
            localstorage.setStatus(message.user, 6);
            break;

        case('nextPayOrder'):
            localstorage.setStatus(message.user, 8);
            break;

        case('skipComment'):
            localstorage.setStatus(message.user, 9);
            break;

        case('ToPay'):
            localstorage.setStatus(message.user, 10);
            break;
    }

});

// user says anything else
controller.hears('(.*)', 'message_received', (bot, message) => {

    localstorage.get(message.user, (res) => {

        switch (res.status) {
            //Start status
            case(0):
                bot.reply(message, startPostback);
                break;

            case(1):
                if (!message.text.match(/^\d+$/)) {
                    bot.reply(message, "Let's find a perfect lunch spot near you. Simply enter a ZIP code or street address.");
                } else {
                    //Location query. Example 94105 or 1243 or 4444
                    let zipLocation = new RequestZip(message.text);
                    zipLocation.getLocation((send, err) => {
                        if (!err) {
                            bot.reply(message, send);
                        } else {
                            bot.reply(message, "Sorry, we don't find this ZIP");
                        }
                    });
                }
                break;

            case(2):

                new Promise((res, rej) => {
                    res(bot.reply(message, "Where would you like to lunch ?"));
                }).then(() => {
                    console.log("Confirmation detected");
                    bot.reply(message, sliderOfRests)
                });
                break;

            case(3):
                let planeTime = new Attachment('When would like to come?').postback(3, ["Today", "Tomorrow", "Back to restaurants"], ["timeselected", "timeselected", "backToRest"]);
                bot.reply(message, planeTime);
                break;

            case(4):
                new Promise((res, rej) => {
                    res(bot.reply(message, "Launch is available from 11:30 AM to 02:30 PM. Please select table time"));
                }).then(() => {
                    console.log("Confirmation table time detected");
                    let planeTime = new Attachment('When would like to come?').slider(2, 2,
                        ["11:30 AM", "02:30 PM"],
                        [' ', ' '],
                        ["selectTime", "backToTableTime"],
                        ['', ''],
                        ["Select time", "Back"]);

                    bot.reply(message, planeTime)
                });
                break;

            case(5):
                new Promise((res, rej) => {
                    res(bot.reply(message, "Please select a table size..."));
                }).then(() => {
                    console.log("Confirmation table time detected");
                    let tableChoose = new Attachment('When would like to come?').slider(4, 2,
                        ["Table for 1 person", "Table for 2 persons", "Table for 3 persons", "Table for 4 persons"],
                        [' ', ' ', ' ', ' '],
                        ["selectTable", "backToTableTime"],
                        ['', ''],
                        ["Select", "Back"]);

                    bot.reply(message, tableChoose)
                });
                break;
            case(6):
                new Promise((res, rej) => {
                    res(bot.reply(message, "Got it. What ypu will having"));
                }).then(() => {
                    console.log("Confirmation table detected");
                    let dishes = new Attachment('What food do you prefer?').slider(4, 2,
                        ["Food 1", "Food 2", "Food 3", "Food 4"],
                        ['Subtitle for food 1', 'Subtitle for food 2', 'Subtitle for food 3', 'Subtitle for food 4'],
                        ["selectFood", "backToTableTime"],
                        [
                            'http://www.zdorovieinfo.ru/upload/images/slides/490x330_%D0%95%D0%B4%D0%B0_%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D0%B0%D1%8F-%D1%83%D0%B1%D0%B8%D0%B2%D0%B0%D0%B5%D1%82_5.jpg',
                            'http://www.zdorovieinfo.ru/upload/images/slides/490x330_%D0%95%D0%B4%D0%B0_%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D0%B0%D1%8F-%D1%83%D0%B1%D0%B8%D0%B2%D0%B0%D0%B5%D1%82_5.jpg',
                            'http://www.zdorovieinfo.ru/upload/images/slides/490x330_%D0%95%D0%B4%D0%B0_%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D0%B0%D1%8F-%D1%83%D0%B1%D0%B8%D0%B2%D0%B0%D0%B5%D1%82_5.jpg',
                            'http://www.zdorovieinfo.ru/upload/images/slides/490x330_%D0%95%D0%B4%D0%B0_%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D0%B0%D1%8F-%D1%83%D0%B1%D0%B8%D0%B2%D0%B0%D0%B5%D1%82_5.jpg'
                        ],
                        ["Select", "Back"]);
                    bot.reply(message, dishes)
                });
                break;
            case(7):
                new Promise((res, rej) => {
                    res(bot.reply(message, ":) Great choice! Your order total is $16.46 (Tax $3.12)..."));
                }).then(() => {
                    console.log("Confirmation table detected");
                    let price = new Attachment('Your order total is $16.46', 'Today at 12:30 pm').postback(2, ["Send order", "Add more items"], ["nextPayOrder", "backAddItems"]);
                    bot.reply(message, price);
                });
                break;

            case(8):
                new Promise((res, rej) => {
                    res(bot.reply(message, "Type a comment or special instruction for the restaurant."));
                }).then(() => {
                    console.log("Confirmation table detected");
                    let comments = new Attachment('Skip the step?').postback(2, ["Skip", "Back"], ["skipComment", "backAddItems"]);
                    bot.reply(message, comments);
                });
                break;

            case(9):
                new Promise((res, rej) => {
                    res(bot.reply(message, "Awesome, thanks! How would you like to pay?"));
                }).then(() => {
                    let paymentVar = new Attachment('Visa  3176 (default)').postback(2, ["Select", "Back"], ["ToPay", "backAddItems"]);
                    console.log("Confirmation pay detected");
                    bot.reply(message, paymentVar);
                });
                break;

            case(10):
                bot.reply(message, "Thank's for ordering with TestBot. Your order has been sent to RestaurantName, you get a text message notification closer to the time they open.");
                localstorage.setStatus(message.user, 1);
                break;

            default:
                bot.reply(message, startPostback);
                break;
        }
    });
});

// this function processes the POST request to the webhook
export function handler(obj) {
    controller.debug('GOT A MESSAGE HOOK');
    let message;
    if (obj.entry) {
        for (let e = 0; e < obj.entry.length; e++) {
            for (let m = 0; m < obj.entry[e].messaging.length; m++) {
                var facebook_message = obj.entry[e].messaging[m];

                console.log(facebook_message);

                // normal message
                if (facebook_message.message) {
                    message = {
                        text: facebook_message.message.text,
                        user: facebook_message.sender.id,
                        channel: facebook_message.sender.id,
                        timestamp: facebook_message.timestamp,
                        seq: facebook_message.message.seq,
                        mid: facebook_message.message.mid,
                        attachments: facebook_message.message.attachments
                    };

                    // save if user comes from m.me adress or Facebook search
                    create_user_if_new(facebook_message.sender.id, facebook_message.timestamp);

                    controller.receiveMessage(bot, message)
                }
                // clicks on a postback action in an attachment
                else if (facebook_message.postback) {
                    // trigger BOTH a facebook_postback event
                    // and a normal message received event.
                    // this allows developers to receive postbacks as part of a conversation.
                    message = {
                        payload: facebook_message.postback.payload,
                        user: facebook_message.sender.id,
                        channel: facebook_message.sender.id,
                        timestamp: facebook_message.timestamp
                    };

                    controller.trigger('facebook_postback', [bot, message]);

                    message = {
                        text: facebook_message.postback.payload,
                        user: facebook_message.sender.id,
                        channel: facebook_message.sender.id,
                        timestamp: facebook_message.timestamp
                    };

                    controller.receiveMessage(bot, message)
                }
                // When a user clicks on "Send to Messenger"
                else if (facebook_message.optin) {
                    message = {
                        optin: facebook_message.optin,
                        user: facebook_message.sender.id,
                        channel: facebook_message.sender.id,
                        timestamp: facebook_message.timestamp
                    };

                    // save if user comes from "Send to Messenger"
                    create_user_if_new(facebook_message.sender.id, facebook_message.timestamp);

                    controller.trigger('facebook_optin', [bot, message])
                }
                // message delivered callback
                else if (facebook_message.delivery) {
                    message = {
                        optin: facebook_message.delivery,
                        user: facebook_message.sender.id,
                        channel: facebook_message.sender.id,
                        timestamp: facebook_message.timestamp
                    };

                    controller.trigger('message_delivered', [bot, message])
                }
                else {
                    controller.log('Got an unexpected message from Facebook: ', facebook_message)
                }
            }
        }
    }
}

let create_user_if_new = (id, ts) => {

    localstorage.get(id, (result) => {
        if(result == false) {
            localstorage.save(id, ts, 0);

        } else {
            controller.log("User has been found")
        }
    });
};


text:
- 💻 [Polypane](https://polypane.app) - Develop responsive websites and apps twice as fast on multiple screens at once
- 🖌 [Superposition](https://superposition.design) - Kickstart your design system by extracting design tokens from your website
- 🗒 [FromScratch](https://fromscratch.rocks) - A smart but simple autosaving scratchpad

---

# Trimage image compressor

A cross-platform tool for optimizing PNG and JPG files.

Trimage is a cross-platform GUI and command-line interface to optimize image files via [advpng](http://advancemame.sourceforge.net/comp-readme.html), [jpegoptim](http://www.kokkonen.net/tjko/projects.html), [optipng](http://optipng.sourceforge.net) and [pngcrush](https://pmt.sourceforge.io/pngcrush) depending on the
filetype (currently, PNG and JPG files are supported).
It was inspired by
[imageoptim](http://imageoptim.pornel.net).

All image files are losslessly
compressed on the highest available compression levels. Trimage gives you
various input functions to fit your own workflow: a regular file dialog,
dragging and dropping and various command line options.

## Installation instructions

Visit [Trimage.org](http://trimage.org) to install Trimage as a package.

## Building instructions

### Prerequisites

- PyQt5
- advpng
- jpegoptim
- optipng
- pngcrush

### Build from source

Build and install by running:

    python setup.py build
    sudo python setup.py install


text:
/*
 * Huffman Static Coding
 */


text:
/**
 * @constructor
 */
WebInspector.AllocationProfile = function(profile)
{
    this._strings = profile.strings;

    this._nextNodeId = 1;
    this._idToFunctionInfo = {};
    this._idToNode = {};
    this._collapsedTopNodeIdToFunctionInfo = {};

    this._traceTops = null;

    this._buildAllocationFunctionInfos(profile);
    this._traceTree = this._buildInvertedAllocationTree(profile);
}

WebInspector.AllocationProfile.prototype = {
    _buildAllocationFunctionInfos: function(profile)
    {
        var strings = this._strings;

        var functionInfoFields = profile.snapshot.meta.trace_function_info_fields;
        var functionIdOffset = functionInfoFields.indexOf("function_id");
        var functionNameOffset = functionInfoFields.indexOf("name");
        var scriptNameOffset = functionInfoFields.indexOf("script_name");
        var scriptIdOffset = functionInfoFields.indexOf("script_id");
        var lineOffset = functionInfoFields.indexOf("line");
        var columnOffset = functionInfoFields.indexOf("column");
        var functionInfoFieldCount = functionInfoFields.length;

        var map = this._idToFunctionInfo;

        // Special case for the root node.
        map[0] = new WebInspector.FunctionAllocationInfo("(root)", "<unknown>", 0, -1, -1);

        var rawInfos = profile.trace_function_infos;
        var infoLength = rawInfos.length;
        for (var i = 0; i < infoLength; i += functionInfoFieldCount) {
            map[rawInfos[i + functionIdOffset]] = new WebInspector.FunctionAllocationInfo(
                strings[rawInfos[i + functionNameOffset]],
                strings[rawInfos[i + scriptNameOffset]],
                rawInfos[i + scriptIdOffset],
                rawInfos[i + lineOffset],
                rawInfos[i + columnOffset]);
        }
    },

    _buildInvertedAllocationTree: function(profile)
    {
        var traceTreeRaw = profile.trace_tree;
        var idToFunctionInfo = this._idToFunctionInfo;

        var traceNodeFields = profile.snapshot.meta.trace_node_fields;
        var nodeIdOffset = traceNodeFields.indexOf("id");
        var functionIdOffset = traceNodeFields.indexOf("function_id");
        var allocationCountOffset = traceNodeFields.indexOf("count");
        var allocationSizeOffset = traceNodeFields.indexOf("size");
        var childrenOffset = traceNodeFields.indexOf("children");
        var nodeFieldCount = traceNodeFields.length;

        function traverseNode(rawNodeArray, nodeOffset, parent)
        {
            var functionInfo = idToFunctionInfo[rawNodeArray[nodeOffset + functionIdOffset]];
            var result = new WebInspector.AllocationTraceNode(
                rawNodeArray[nodeOffset + nodeIdOffset],
                functionInfo,
                rawNodeArray[nodeOffset + allocationCountOffset],
                rawNodeArray[nodeOffset + allocationSizeOffset],
                parent);
            functionInfo.addTraceTopNode(result);

            var rawChildren = rawNodeArray[nodeOffset + childrenOffset];
            for (var i = 0; i < rawChildren.length; i += nodeFieldCount) {
                result.children.push(traverseNode(rawChildren, i, result));
            }
            return result;
        }

        return traverseNode(traceTreeRaw, 0, null);
    },

    serializeTraceTops: function()
    {
        if (this._traceTops)
            return this._traceTops;
        var result = this._traceTops = [];
        var idToFunctionInfo = this._idToFunctionInfo;
        for (var id in idToFunctionInfo) {
            var info = idToFunctionInfo[id];
            if (info.totalCount === 0)
                continue;
            var nodeId = this._nextNodeId++;
            result.push(this._serializeNode(
                nodeId,
                info,
                info.totalCount,
                info.totalSize,
                true));
            this._collapsedTopNodeIdToFunctionInfo[nodeId] = info;
        }
        result.sort(function(a, b) {
            return b.size - a.size;
        });
        return result;
    },

    serializeCallers: function(nodeId)
    {
        var node = this._idToNode[nodeId];
        if (!node) {
            var functionInfo = this._collapsedTopNodeIdToFunctionInfo[nodeId];
            node = functionInfo.tracesWithThisTop();
            delete this._collapsedTopNodeIdToFunctionInfo[nodeId];
            this._idToNode[nodeId] = node;
        }

        var nodesWithSingleCaller = [];
        while (node.callers().length === 1) {
            node = node.callers()[0];
            nodesWithSingleCaller.push(this._serializeCaller(node));
        }

        var branchingCallers = [];
        var callers = node.callers();
        for (var i = 0; i < callers.length; i++) {
            branchingCallers.push(this._serializeCaller(callers[i]));
        }
        return {
            nodesWithSingleCaller: nodesWithSingleCaller,
            branchingCallers: branchingCallers
        };
    },

    _serializeCaller: function(node)
    {
        var callerId = this._nextNodeId++;
        this._idToNode[callerId] = node;
        return this._serializeNode(
            callerId,
            node.functionInfo,
            node.allocationCount,
            node.allocationSize,
            node.hasCallers());
    },

    _serializeNode: function(nodeId, functionInfo, count, size, hasChildren)
    {
        return {
            id: nodeId,
            name: functionInfo.functionName,
            scriptName: functionInfo.scriptName,
            line: functionInfo.line,
            column: functionInfo.column,
            count: count,
            size: size,
            hasChildren: hasChildren
        };
    }
}

/**
 * @constructor
 */
WebInspector.AllocationTraceNode = function(id, functionInfo, count, size, parent)
{
    this.id = id;
    this.functionInfo = functionInfo;
    this.allocationCount = count;
    this.allocationSize = size;
    this.parent = parent;
    this.children = [];
}

/**
 * @constructor
 * @param {!WebInspector.FunctionAllocationInfo} functionInfo
 */
WebInspector.AllocationBackTraceNode = function(functionInfo)
{
    this.functionInfo = functionInfo;
    this.allocationCount = 0;
    this.allocationSize = 0;
    this._callers = [];
}

WebInspector.AllocationBackTraceNode.prototype = {
    /**
     * @param {!WebInspector.AllocationTraceNode} traceNode
     * @return {!WebInspector.AllocationTraceNode}
     */
    addCaller: function(traceNode)
    {
        var functionInfo = traceNode.functionInfo;
        var result;
        for (var i = 0; i < this._callers.length; i++) {
            var caller = this._callers[i];
            if (caller.functionInfo === functionInfo) {
                result = caller;
                break;
            }
        }
        if (!result) {
            result = new WebInspector.AllocationBackTraceNode(functionInfo);
            this._callers.push(result);
        }
        return result;
    },

    callers: function()
    {
        return this._callers;
    },

    hasCallers: function()
    {
        return this._callers.length > 0;
    }
}

/**
 * @constructor
 */
WebInspector.FunctionAllocationInfo = function(functionName, scriptName, scriptId, line, column)
{
    this.functionName = functionName;
    this.scriptName = scriptName;
    this.scriptId = scriptId;
    this.line = line;
    this.column = column;
    this.totalCount = 0;
    this.totalSize = 0;
    this._traceTops = [];
}

WebInspector.FunctionAllocationInfo.prototype = {
    addTraceTopNode: function(node)
    {
        if (node.allocationCount === 0)
            return;
        this._traceTops.push(node);
        this.totalCount += node.allocationCount;
        this.totalSize += node.allocationSize;
    },

    tracesWithThisTop: function()
    {
        if (!this._traceTops.length)
            return null;
        if (!this._backTraceTree)
            this._buildAllocationTraceTree();
        return this._backTraceTree;
    },

    _buildAllocationTraceTree: function()
    {
        this._backTraceTree = new WebInspector.AllocationBackTraceNode(this._traceTops[0].functionInfo);

        for (var i = 0; i < this._traceTops.length; i++) {
            var node = this._traceTops[i];
            var backTraceNode = this._backTraceTree;
            var count = node.allocationCount;
            var size = node.allocationSize;
            while (true) {
                backTraceNode.allocationCount += count;
                backTraceNode.allocationSize += size;
                node = node.parent;
                if (node === null) {
                    break;
                }
                backTraceNode = backTraceNode.addCaller(node);
            }
        }
    }
}


text:
package org.springside.modules.nosql.redis.pool;

import redis.clients.jedis.Protocol;

/**
 * All information for redis connection.
 */
public class ConnectionInfo {

	public static final String DEFAULT_PASSWORD = null;

	private int database = Protocol.DEFAULT_DATABASE;
	private String password = DEFAULT_PASSWORD;
	private int timeout = Protocol.DEFAULT_TIMEOUT;

	public ConnectionInfo() {
	}

	public ConnectionInfo(int database, String password, int timeout) {
		this.timeout = timeout;
		this.password = password;
		this.database = database;
	}

	public int getDatabase() {
		return database;
	}

	public void setDatabase(int database) {
		this.database = database;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public int getTimeout() {
		return timeout;
	}

	public void setTimeout(int timeout) {
		this.timeout = timeout;
	}

	@Override
	public String toString() {
		return "ConnectionInfo [database=" + database + ", password=" + password + ", timeout=" + timeout + "]";
	}
}


text:
<?php

namespace Grupo51\ProyectoBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Pais
 *
 * @ORM\Table(name="pais")
 * @ORM\Entity
 */
class Pais
{
    /**
     * @var string
     *
     * @ORM\Column(name="nombre", type="string", length=52, nullable=false)
     */
    private $nombre;

    /**
     * @var string
     *
     * @ORM\Column(name="continente", type="string", nullable=false)
     */
    private $continente;

    /**
     * @var string
     *
     * @ORM\Column(name="region", type="string", length=26, nullable=false)
     */
    private $region;

    /**
     * @var float
     *
     * @ORM\Column(name="superficie", type="float", precision=10, scale=2, nullable=false)
     */
    private $superficie;

    /**
     * @var integer
     *
     * @ORM\Column(name="independecia_anio", type="smallint", nullable=true)
     */
    private $independeciaAnio;

    /**
     * @var integer
     *
     * @ORM\Column(name="poblacion", type="integer", nullable=false)
     */
    private $poblacion;

    /**
     * @var float
     *
     * @ORM\Column(name="esperanza_de_vida", type="float", precision=3, scale=1, nullable=true)
     */
    private $esperanzaDeVida;

    /**
     * @var float
     *
     * @ORM\Column(name="producto_nal_bruto", type="float", precision=10, scale=2, nullable=true)
     */
    private $productoNalBruto;

    /**
     * @var float
     *
     * @ORM\Column(name="producto_nal_brutoOld", type="float", precision=10, scale=2, nullable=true)
     */
    private $productoNalBrutoold;

    /**
     * @var string
     *
     * @ORM\Column(name="nombre_local", type="string", length=45, nullable=false)
     */
    private $nombreLocal;

    /**
     * @var string
     *
     * @ORM\Column(name="forma_de_gobierno", type="string", length=45, nullable=false)
     */
    private $formaDeGobierno;

    /**
     * @var string
     *
     * @ORM\Column(name="jefe_de_estado", type="string", length=60, nullable=true)
     */
    private $jefeDeEstado;

    /**
     * @var integer
     *
     * @ORM\Column(name="capital", type="integer", nullable=true)
     */
    private $capital;

    /**
     * @var string
     *
     * @ORM\Column(name="codigo2", type="string", length=2, nullable=false)
     */
    private $codigo2;

    /**
     * @var string
     *
     * @ORM\Column(name="codigo", type="string", length=3)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $codigo;

    /**
     * Set nombre
     *
     * @param string $nombre
     * @return Pais
     */
    public function setNombre($nombre)
    {
        $this->nombre = $nombre;

        return $this;
    }

    /**
     * Get nombre
     *
     * @return string
     */
    public function getNombre()
    {
        return $this->nombre;
    }

    /**
     * Set continente
     *
     * @param string $continente
     * @return Pais
     */
    public function setContinente($continente)
    {
        $this->continente = $continente;

        return $this;
    }

    /**
     * Get continente
     *
     * @return string
     */
    public function getContinente()
    {
        return $this->continente;
    }

    /**
     * Set region
     *
     * @param string $region
     * @return Pais
     */
    public function setRegion($region)
    {
        $this->region = $region;

        return $this;
    }

    /**
     * Get region
     *
     * @return string
     */
    public function getRegion()
    {
        return $this->region;
    }

    /**
     * Set superficie
     *
     * @param float $superficie
     * @return Pais
     */
    public function setSuperficie($superficie)
    {
        $this->superficie = $superficie;

        return $this;
    }

    /**
     * Get superficie
     *
     * @return float
     */
    public function getSuperficie()
    {
        return $this->superficie;
    }

    /**
     * Set independeciaAnio
     *
     * @param integer $independeciaAnio
     * @return Pais
     */
    public function setIndependeciaAnio($independeciaAnio)
    {
        $this->independeciaAnio = $independeciaAnio;

        return $this;
    }

    /**
     * Get independeciaAnio
     *
     * @return integer
     */
    public function getIndependeciaAnio()
    {
        return $this->independeciaAnio;
    }

    /**
     * Set poblacion
     *
     * @param integer $poblacion
     * @return Pais
     */
    public function setPoblacion($poblacion)
    {
        $this->poblacion = $poblacion;

        return $this;
    }

    /**
     * Get poblacion
     *
     * @return integer
     */
    public function getPoblacion()
    {
        return $this->poblacion;
    }

    /**
     * Set esperanzaDeVida
     *
     * @param float $esperanzaDeVida
     * @return Pais
     */
    public function setEsperanzaDeVida($esperanzaDeVida)
    {
        $this->esperanzaDeVida = $esperanzaDeVida;

        return $this;
    }

    /**
     * Get esperanzaDeVida
     *
     * @return float
     */
    public function getEsperanzaDeVida()
    {
        return $this->esperanzaDeVida;
    }

    /**
     * Set productoNalBruto
     *
     * @param float $productoNalBruto
     * @return Pais
     */
    public function setProductoNalBruto($productoNalBruto)
    {
        $this->productoNalBruto = $productoNalBruto;

        return $this;
    }

    /**
     * Get productoNalBruto
     *
     * @return float
     */
    public function getProductoNalBruto()
    {
        return $this->productoNalBruto;
    }

    /**
     * Set productoNalBrutoold
     *
     * @param float $productoNalBrutoold
     * @return Pais
     */
    public function setProductoNalBrutoold($productoNalBrutoold)
    {
        $this->productoNalBrutoold = $productoNalBrutoold;

        return $this;
    }

    /**
     * Get productoNalBrutoold
     *
     * @return float
     */
    public function getProductoNalBrutoold()
    {
        return $this->productoNalBrutoold;
    }

    /**
     * Set nombreLocal
     *
     * @param string $nombreLocal
     * @return Pais
     */
    public function setNombreLocal($nombreLocal)
    {
        $this->nombreLocal = $nombreLocal;

        return $this;
    }

    /**
     * Get nombreLocal
     *
     * @return string
     */
    public function getNombreLocal()
    {
        return $this->nombreLocal;
    }

    /**
     * Set formaDeGobierno
     *
     * @param string $formaDeGobierno
     * @return Pais
     */
    public function setFormaDeGobierno($formaDeGobierno)
    {
        $this->formaDeGobierno = $formaDeGobierno;

        return $this;
    }

    /**
     * Get formaDeGobierno
     *
     * @return string
     */
    public function getFormaDeGobierno()
    {
        return $this->formaDeGobierno;
    }

    /**
     * Set jefeDeEstado
     *
     * @param string $jefeDeEstado
     * @return Pais
     */
    public function setJefeDeEstado($jefeDeEstado)
    {
        $this->jefeDeEstado = $jefeDeEstado;

        return $this;
    }

    /**
     * Get jefeDeEstado
     *
     * @return string
     */
    public function getJefeDeEstado()
    {
        return $this->jefeDeEstado;
    }

    /**
     * Set capital
     *
     * @param integer $capital
     * @return Pais
     */
    public function setCapital($capital)
    {
        $this->capital = $capital;

        return $this;
    }

    /**
     * Get capital
     *
     * @return integer
     */
    public function getCapital()
    {
        return $this->capital;
    }

    /**
     * Set codigo2
     *
     * @param string $codigo2
     * @return Pais
     */
    public function setCodigo2($codigo2)
    {
        $this->codigo2 = $codigo2;

        return $this;
    }

    /**
     * Get codigo2
     *
     * @return string
     */
    public function getCodigo2()
    {
        return $this->codigo2;
    }

    /**
     * Get codigo
     *
     * @return string
     */
    public function getCodigo()
    {
        return $this->codigo;
    }
}


text:
package chip.devicecontroller;

import javax.annotation.Nullable;

/** JNI wrapper callback class for {@link ReportCallback}. */
public class ReportCallbackJni {
  @Nullable private SubscriptionEstablishedCallback wrappedSubscriptionEstablishedCallback;
  @Nullable private ResubscriptionAttemptCallback wrappedResubscriptionAttemptCallback;
  private ReportCallback wrappedReportCallback;
  private long callbackHandle;

  public ReportCallbackJni(
      @Nullable SubscriptionEstablishedCallback subscriptionEstablishedCallback,
      ReportCallback reportCallback,
      ResubscriptionAttemptCallback resubscriptionAttemptCallback) {
    this.wrappedSubscriptionEstablishedCallback = subscriptionEstablishedCallback;
    this.wrappedReportCallback = reportCallback;
    this.wrappedResubscriptionAttemptCallback = resubscriptionAttemptCallback;
    this.callbackHandle =
        newCallback(subscriptionEstablishedCallback, reportCallback, resubscriptionAttemptCallback);
  }

  long getCallbackHandle() {
    return callbackHandle;
  }

  private native long newCallback(
      @Nullable SubscriptionEstablishedCallback subscriptionEstablishedCallback,
      ReportCallback wrappedCallback,
      @Nullable ResubscriptionAttemptCallback resubscriptionAttemptCallback);

  private native void deleteCallback(long callbackHandle);

  // TODO(#8578): Replace finalizer with PhantomReference.
  @SuppressWarnings("deprecation")
  protected void finalize() throws Throwable {
    super.finalize();

    if (callbackHandle != 0) {
      deleteCallback(callbackHandle);
      callbackHandle = 0;
    }
  }
}


text:
/**
 * Created by chagen on 4/3/16.
 */
(function () {
    'use strict';
    function movieCardController($location, TheMovieDBService) {
        var vm = this;
         TheMovieDBService.getImageBaseUrl().then(function (data) {
             vm.url = data;
         });
        vm.go = function (path) {
            $location.path(path);
        };
    }

    angular.module('movieApp.movieList')
        .component('movieCard', {
            templateUrl: 'app/components/list/card/movie-card.html',
            controller: movieCardController,
            controllerAs: 'card',
            bindings: {
                movie: '='
            }
        });
})();


text:
package org.apache.cloudstack.storage.datastore.provider;

import com.cloud.agent.AgentManager;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.ModifyStoragePoolAnswer;
import com.cloud.agent.api.ModifyStoragePoolCommand;
import com.cloud.alert.AlertManager;
import com.cloud.dc.ClusterDetailsDao;
import com.cloud.dc.dao.ClusterDao;
import com.cloud.host.HostVO;
import com.cloud.host.dao.HostDao;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.DataStoreRole;
import com.cloud.storage.StoragePool;
import com.cloud.storage.StoragePoolHostVO;
import com.cloud.storage.dao.StoragePoolHostDao;
import com.cloud.utils.exception.CloudRuntimeException;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
import org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener;
import org.apache.cloudstack.storage.datastore.db.StoragePoolDetailsDao;
import org.apache.log4j.Logger;

import javax.inject.Inject;

public class DateraHostListener implements HypervisorHostListener {
    private static final Logger s_logger = Logger.getLogger(DateraHostListener.class);

    @Inject
    private AgentManager _agentMgr;
    @Inject
    private AlertManager _alertMgr;
    @Inject
    private DataStoreManager _dataStoreMgr;
    @Inject
    private HostDao _hostDao;
    @Inject
    private StoragePoolHostDao storagePoolHostDao;
    @Inject
    private StoragePoolDetailsDao _storagePoolDetailsDao;
    @Inject
    private ClusterDao _clusterDao;
    @Inject
    private ClusterDetailsDao _clusterDetailsDao;

    @Override
    public boolean hostConnect(long hostId, long storagePoolId) {
        HostVO host = _hostDao.findById(hostId);

        StoragePoolHostVO storagePoolHost = storagePoolHostDao.findByPoolHost(storagePoolId, hostId);

        if (storagePoolHost == null) {
            storagePoolHost = new StoragePoolHostVO(storagePoolId, hostId, "");

            storagePoolHostDao.persist(storagePoolHost);
        }

        // just want to send the ModifyStoragePoolCommand for KVM
        if (host.getHypervisorType() != HypervisorType.KVM) {
            return true;
        }

        StoragePool storagePool = (StoragePool)_dataStoreMgr.getDataStore(storagePoolId, DataStoreRole.Primary);
        ModifyStoragePoolCommand cmd = new ModifyStoragePoolCommand(true, storagePool);

        Answer answer = _agentMgr.easySend(hostId, cmd);

        if (answer == null) {
            throw new CloudRuntimeException("Unable to get an answer to the modify storage pool command (" + storagePool.getId() + ")");
        }

        if (!answer.getResult()) {
            String msg = "Unable to attach storage pool " + storagePoolId + " to host " + hostId;

            //_alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST, storagePool.getDataCenterId(), storagePool.getPodId(), msg, msg);

            throw new CloudRuntimeException("Unable to establish a connection from agent to storage pool " + storagePool.getId() + " due to " + answer.getDetails() +
                " (" + storagePool.getId() + ")");
        }

        assert (answer instanceof ModifyStoragePoolAnswer) : "ModifyStoragePoolAnswer expected ; Pool = " + storagePool.getId() + " Host = " + hostId;

        s_logger.info("Connection established between storage pool " + storagePool + " and host + " + hostId);

        return true;
    }

    @Override
    public boolean hostDisconnected(long hostId, long storagePoolId) {
        StoragePoolHostVO storagePoolHost = storagePoolHostDao.findByPoolHost(storagePoolId, hostId);

        if (storagePoolHost != null) {
            storagePoolHostDao.deleteStoragePoolHostDetails(hostId, storagePoolId);
        }

        return true;
    }
}


text:
<?php

namespace lithium\tests\mocks\console;

/**
 * This is the Mock Command
 *
 */
class MockCommand extends \lithium\console\Command {

	public $case = null;

	public $face = true;

	/**
	 * Mace.
	 *
	 * @var string Describe value of mace.
	 */
	public $mace = 'test';

	public $race;

	/**
	 * Lace.
	 *
	 * @var boolean Describe value of lace.
	 */
	public $lace = true;

	protected $_dontShow = null;

	protected $_classes = [
		'response' => 'lithium\tests\mocks\console\MockResponse'
	];

	public function testRun() {
		$this->response->testAction = __FUNCTION__;
	}

	public function clear() {}

	public function testReturnNull() {
		return null;
	}

	public function testReturnTrue() {
		return true;
	}

	public function testReturnFalse() {
		return false;
	}

	public function testReturnNegative1() {
		return -1;
	}

	public function testReturn1() {
		return 1;
	}

	public function testReturn3() {
		return 3;
	}

	public function testReturnString() {
		return 'this is a string';
	}

	public function testReturnEmptyArray() {
		return [];
	}

	public function testReturnArray() {
		return ['a' => 'b'];
	}
}

?>


text:
package com.nulldreams.base.content;

import android.app.Activity;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.content.ServiceConnection;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Parcelable;
import android.os.UserHandle;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.support.v4.app.Fragment;

import java.io.Serializable;
import java.util.ArrayList;

/**
 * Created by gaoyunfei on 2017/2/8.
 */

public class It extends Intent {

    public static It newInstance () {
        return new It();
    }

    @Override
    public It setAction(String action) {
        super.setAction(action);
        return this;
    }

    @Override
    public It setData(Uri data) {
        super.setData(data);
        return this;
    }

    @Override
    public It setDataAndNormalize(Uri data) {
        super.setDataAndNormalize(data);
        return this;
    }

    @Override
    public It setType(String type) {
        super.setType(type);
        return this;
    }

    @Override
    public It setTypeAndNormalize(String type) {
        super.setTypeAndNormalize(type);
        return this;
    }

    @Override
    public It setDataAndType(Uri data, String type) {
        super.setDataAndType(data, type);
        return this;
    }

    @Override
    public It setDataAndTypeAndNormalize(Uri data, String type) {
        super.setDataAndTypeAndNormalize(data, type);
        return this;
    }

    @Override
    public It addCategory(String category) {
        super.addCategory(category);
        return this;
    }

    @Override
    public It putExtra(String name, boolean value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, byte value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, char value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, short value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, int value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, long value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, float value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, double value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, String value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, CharSequence value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, Parcelable value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, Parcelable[] value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putParcelableArrayListExtra(String name, ArrayList<? extends Parcelable> value) {
        super.putParcelableArrayListExtra(name, value);
        return this;
    }

    @Override
    public It putIntegerArrayListExtra(String name, ArrayList<Integer> value) {
        super.putIntegerArrayListExtra(name, value);
        return this;
    }

    @Override
    public It putStringArrayListExtra(String name, ArrayList<String> value) {
        super.putStringArrayListExtra(name, value);
        return this;
    }

    @Override
    public It putCharSequenceArrayListExtra(String name, ArrayList<CharSequence> value) {
        super.putCharSequenceArrayListExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, Serializable value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, boolean[] value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, byte[] value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, short[] value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, char[] value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, int[] value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, long[] value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, float[] value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, double[] value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, String[] value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, CharSequence[] value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtra(String name, Bundle value) {
        super.putExtra(name, value);
        return this;
    }

    @Override
    public It putExtras(Intent src) {
        super.putExtras(src);
        return this;
    }

    @Override
    public It putExtras(Bundle extras) {
        super.putExtras(extras);
        return this;
    }

    @Override
    public It replaceExtras(Intent src) {
        super.replaceExtras(src);
        return this;
    }

    @Override
    public It replaceExtras(Bundle extras) {
        super.replaceExtras(extras);
        return this;
    }

    @Override
    public It setFlags(int flags) {
        super.setFlags(flags);
        return this;
    }

    @Override
    public It addFlags(int flags) {
        super.addFlags(flags);
        return this;
    }

    @Override
    public It setPackage(String packageName) {
        super.setPackage(packageName);
        return this;
    }

    @Override
    public It setComponent(ComponentName component) {
        super.setComponent(component);
        return this;
    }

    @Override
    public It setClassName(Context packageContext, String className) {
        super.setClassName(packageContext, className);
        return this;
    }

    @Override
    public It setClassName(String packageName, String className) {
        super.setClassName(packageName, className);
        return this;
    }

    @Override
    public It setClass(Context packageContext, Class<?> cls) {
        super.setClass(packageContext, cls);
        return this;
    }

    public void startActivity (Context context) {
        context.startActivity(this);
    }

    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
    public void startActivity (Context context, Bundle options) {
        context.startActivity(this, options);
    }

    public void startActivity (Context context, Class<? extends Activity> activityClass) {
        setClass(context, activityClass);
        context.startActivity(this);
    }

    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
    public void startActivity (Context context, Class<? extends Activity> activityClass, Bundle options) {
        setClass(context, activityClass);
        context.startActivity(this, options);
    }

    public void startActivityForResult (Activity activity, int requestCode) {
        activity.startActivityForResult(this, requestCode);
    }

    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
    public void startActivityForResult (Activity activity, int requestCode, Bundle options) {
        activity.startActivityForResult(this, requestCode, options);
    }

    /*public void startActivityFromFragment(Activity activity, Fragment fragment, Intent intent, int requestCode) {
        activity.startActivityFromFragment(fragment, intent, requestCode);
    }

    public void startActivityFromFragment(Activity activity, Fragment fragment, int requestCode, @Nullable Bundle options) {
        activity.startActivityFromFragment(fragment, this, requestCode, options);
    }*/

    public boolean startActivityIfNeeded(Activity activity, int requestCode) {
        return activity.startActivityIfNeeded(this, requestCode);
    }

    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
    public boolean startActivityIfNeeded(Activity activity, int requestCode, Bundle options) {
        return activity.startActivityIfNeeded(this, requestCode, options);
    }

    public boolean startNextMatchingActivity(Activity activity) {
        return activity.startNextMatchingActivity(this);
    }

    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
    public boolean startNextMatchingActivity(Activity activity, Bundle options) {
        return activity.startNextMatchingActivity(this, options);
    }

    public void startActivityFromChild(Activity activity, Activity child, int requestCode) {
        activity.startActivityFromChild(child, this, requestCode);
    }

    /*public void startActivityFromChild(Activity activity, Activity child, int requestCode, Bundle options) {
        activity.startActivityFromChild(child, requestCode, options);
    }

    public void startIntentSenderFromChild(Activity activity, Activity child, IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags) throws IntentSender.SendIntentException {
        activity.startIntentSenderFromChild(child, intent, requestCode, fillInIntent, flagsMask, flagsValues, extraFlags);
    }

    public void startIntentSenderFromChild(Activity activity, Activity child, IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options) throws IntentSender.SendIntentException {
        activity.startIntentSenderFromChild(child, intent, requestCode, fillInIntent, flagsMask, flagsValues, extraFlags, options);
    }*/

    public void startService (Context context, Class<? extends Service> serviceClass) {
        this.setClass(context, serviceClass);
        context.startService(this);
    }

    public void bindService (Context context, Class<? extends Service> serviceClass, ServiceConnection connection, int flags) {
        this.setClass(context, serviceClass);
        context.bindService(this, connection, flags);
    }

    public void sendBroadcast (Context context) {
        context.sendBroadcast(this);
    }

    public void sendBroadcast (Context context, String receiverPermission) {
        context.sendBroadcast(this, receiverPermission);
    }

    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
    public void sendBroadcastAsUser (Context context, UserHandle userHandle) {
        context.sendBroadcastAsUser(this, userHandle);
    }

    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
    public void sendBroadcastAsUser (Context context, UserHandle userHandle, String receiverPermission) {
        context.sendBroadcastAsUser(this, userHandle, receiverPermission);
    }

    public void sendOrderedBroadcast (Context context, String receiverPermission) {
        context.sendOrderedBroadcast(this, receiverPermission);
    }

    public void sendOrderedBroadcast (Context context, @Nullable String receiverPermission, BroadcastReceiver resultReceiver,
                                      @Nullable Handler scheduler, int initialCode, @Nullable String initialData,
                                      @Nullable  Bundle initialExtras) {
        context.sendOrderedBroadcast(this, receiverPermission, resultReceiver, scheduler, initialCode, initialData, initialExtras);
    }

    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
    public void sendOrderedBroadcastAsUser (Context context, UserHandle user, @Nullable String receiverPermission, BroadcastReceiver resultReceiver,
                      @Nullable Handler scheduler, int initialCode, @Nullable String initialData,
                      @Nullable  Bundle initialExtras) {
        context.sendOrderedBroadcastAsUser(this, user, receiverPermission, resultReceiver, scheduler, initialCode, initialData, initialExtras);
    }

    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
    public void sendStickyOrderedBroadcastAsUser(Context context, UserHandle user, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
        context.sendStickyOrderedBroadcastAsUser(this, user, resultReceiver, scheduler, initialCode, initialData, initialExtras);
    }

    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
    public void sendStickyBroadcastAsUser(Context context, UserHandle user) {
        context.sendStickyBroadcastAsUser(this, user);
    }

    public void sendStickyOrderedBroadcast(Context context, BroadcastReceiver resultReceiver, Handler scheduler, int initialCode, String initialData, Bundle initialExtras) {
        context.sendStickyOrderedBroadcast(this, resultReceiver, scheduler, initialCode, initialData, initialExtras);
    }

    public void sendStickyBroadcast(Context context) {
        context.sendStickyBroadcast(this);
    }
}