text:
package hiveql

import org.apache.spark.sql.hive.HiveContext
import org.apache.spark.{SparkConf, SparkContext}

// The simple form of user-defined function base class provided in Hive
class DiscountSalesUDF extends org.apache.hadoop.hive.ql.exec.UDF {
  def evaluate (sales: Double, discount: Double) : Double = {
    sales - discount
  }
}

//
// Demonstrate a Hive user-defined function of the simple variety.
//

object SimpleUDF {

  def main (args: Array[String]) {
    val conf = new SparkConf().setAppName("HiveQL").setMaster("local[4]")
    val sc = new SparkContext(conf)
    val hiveContext = new HiveContext(sc)

    import hiveContext.implicits._

    // create an RDD of tuples with some data
    val custs = Seq(
      (1, "Widget Co", 120000.00, 0.00, "AZ"),
      (2, "Acme Widgets", 410500.00, 500.00, "CA"),
      (3, "Widgetry", 410500.00, 200.00, "CA"),
      (4, "Widgets R Us", 410500.00, 0.0, "CA"),
      (5, "Ye Olde Widgete", 500.00, 0.0, "MA")
    )
    val customerRows = sc.parallelize(custs, 4)
    val customerDF = customerRows.toDF("id", "name", "sales", "discount", "state")

    // register as a temporary table
    customerDF.printSchema()
    customerDF.registerTempTable("customers")

    // register the UDF with the HiveContext, by referring to the class we defined above --
    // skip the 'TEMPORARY' if you want it to be persisted in the Hive metastore
    hiveContext.sql("CREATE TEMPORARY FUNCTION discounted_sales AS 'hiveql.DiscountSalesUDF'")

    // now use it in a query
    val data1 = hiveContext.sql("SELECT id, discounted_sales(sales, discount) AS sales FROM customers")
    data1.printSchema()
    data1.foreach(println)

  }
}


text:
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>FreeSprite</title>

FreeSprite()

语法

FreeSprite(#Sprite)

概要

Removes the specified sprite from memory. It's not possible to the sprite anymore after calling this function.

参数

#Sprite

The sprite to free. If #PB_All is specified, all the remaining sprites are freed.

返回值

无.

备注

All remaining sprites are automatically freed when the program ends.

已支持操作系统
所有

<- DisplayTransparentSprite() - Sprite Index - GrabSprite() ->

redpajama_set_name: RedPajamaGithub


text:
package org.compass.needle.gigaspaces.store;

import java.io.IOException;

import com.j_spaces.core.IJSpace;
import com.j_spaces.core.client.SpaceFinder;
import org.apache.lucene.store.Directory;
import org.compass.core.CompassException;
import org.compass.core.config.CompassConfigurable;
import org.compass.core.config.CompassEnvironment;
import org.compass.core.config.CompassSettings;
import org.compass.core.config.ConfigurationException;
import org.compass.core.engine.SearchEngineException;
import org.compass.core.lucene.LuceneEnvironment;
import org.compass.core.lucene.engine.store.AbstractDirectoryStore;
import org.compass.core.lucene.engine.store.CopyFromHolder;
import org.openspaces.core.GigaSpace;

/**
 * A plugin lucene store for Compass. Uses {@link GigaSpaceDirectory}
 * as Lucene directory implementation.
 *
 * @author kimchy
 */
public class GigaSpaceDirectoryStore extends AbstractDirectoryStore implements CompassConfigurable {

    public static final String PROTOCOL = "space://";

    public static final String BUCKET_SIZE_PROP = "compass.engine.store.space.bucketSize";

    public static final String FLUSH_RATE_PROP = "compass.engine.store.space.flushRate";

    private String indexName;

    private IJSpace space;

    private int bucketSize;

    private int flushRate;

    public void configure(CompassSettings settings) throws CompassException {
        String connection = settings.getSetting(CompassEnvironment.CONNECTION).substring(PROTOCOL.length());
        int index = connection.indexOf(':');
        if (index == -1) {
            throw new ConfigurationException("Must provide index name and space url in the format indexName:spaceUrl");
        }
        this.indexName = connection.substring(0, index);

        String spaceUrl = connection.substring(index + 1);

        Object spaceInstance = settings.getSettingAsObject(spaceUrl);
        if (spaceInstance instanceof IJSpace) {
            space = (IJSpace) spaceInstance;
        } else if (spaceInstance instanceof GigaSpace) {
            space = ((GigaSpace) spaceInstance).getSpace();
        } else {
            try {
                space = (IJSpace) SpaceFinder.find(spaceUrl, settings.getProperties());
            } catch (Exception e) {
                throw new ConfigurationException("Failed to find Space [" + spaceUrl + "]", e);
            }
        }

        bucketSize = (int) settings.getSettingAsBytes(BUCKET_SIZE_PROP, GigaSpaceDirectory.DEFAULT_BUCKET_SIZE);
        flushRate = settings.getSettingAsInt(FLUSH_RATE_PROP, GigaSpaceDirectory.DEFAULT_FLUSH_RATE);
    }

    public Directory open(String subContext, String subIndex) throws SearchEngineException {
        return new GigaSpaceDirectory(space, buildFullIndexName(subContext, subIndex), bucketSize, flushRate);
    }

    @Override
    public void deleteIndex(Directory dir, String subContext, String subIndex) throws SearchEngineException {
        cleanIndex(dir, subContext, subIndex);
    }

    @Override
    public void cleanIndex(Directory dir, String subContext, String subIndex) throws SearchEngineException {
        try {
            ((GigaSpaceDirectory) dir).deleteContent();
        } catch (IOException e) {
            throw new SearchEngineException("Failed to delete index for sub context [" + subContext + "] and sub index [" + subIndex + "]", e);
        }
    }

    @Override
    public CopyFromHolder beforeCopyFrom(String subContext, String subIndex, Directory dir) throws SearchEngineException {
        try {
            ((GigaSpaceDirectory) dir).deleteContent();
        } catch (IOException e) {
            throw new SearchEngineException("Failed to delete context before copy from", e);
        }
        return new CopyFromHolder();
    }

    private String buildFullIndexName(String subContext, String subIndex) {
        return indexName + "/" + subContext + "/" + subIndex;
    }

    @Override
    public String suggestedIndexDeletionPolicy() {
        return LuceneEnvironment.IndexDeletionPolicy.ExpirationTime.NAME;
    }
}


text:
layout: post
title: Config NAT Traversal on Rasoberry-pi
category: rpi
keywords: rpi, NAT Traversal
---

**English isn't my native language, please excuse the typing error.**

### Install Ubuntu Mate @ 16.04

Download the [ubunutu mate image torrent](https://ubuntu-mate.org/raspberry-pi/ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img.xz.torrent) for arm platform.

Download [SD card Formtter](https://www.sdcard.org/downloads/formatter_4/eula_mac/InstallSD_CardFormatter0500.mpkg),unzip it, format the SD card.

Write the OS image to empty SD card via these command (more info can click [here](https://blog.csdn.net/qq_34594236/article/details/77815027)):

```bash
# unmount the disk
diskutil unmount /dev/disk2s1

# write img (must be carefully)
sudo dd bs=4m if=/path_to/ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img of=/dev/disk2
```

Insert the SD card in raspberry-pi, power ups. Then insert the keyword, mouse and screen. or search on google try to login wia ssh connection. it's very easy. (Notice: if you want to install ubuntu-meta, a screen is prerequisite. You should try to use the rpi official OS: raspbian, which is very like Debian)

Use `sudo apt update && sudo apt upgrade` to update the lib.

### SSH Startup Item

[More info can click here](http://shumeipai.nxez.com/2016/11/29/install-nas-on-ubuntu-mate.html)

```bash
sudo apt-get install openssh-server
sudo raspi-config
```

Select item `3`, and enable the SSH (only for rpi)

this operation should add the `sshd` service into the startup items. if you don't like use `raspi-config`, this command may also work (without test):

```bash
sudo systemctl enable sshd
sudo systemctl restart sshd
```

then, you can use `sudo systemctl status {service name}` to check the state of your service. `raspi-config` just some quickly settings, Linux OS is univers

### NET Travarsal

#### SSH

Seems the rpi don't have a public Internet Address, and I have a Virtual Private Srver on tencent cloud. So [NAT traversal](https://en.wikipedia.org/wiki/NAT_traversal) is a good solution:

There are some production about NAT traversal, like `ngrok`、`natapp` and etc. but the spped and delay are very bad. So I decide to use a open source solution: [`frp`](https://github.com/fatedier/frp)

Just use the simplest config is enough to run it. run `frps` (server side) on virtal private server, and the `frpc` (client side) on rpi.

On Server Side, just use `nohup` to wrapper the command, ensure the process will continue run after operator exit the ssh session.

On Client Side, We ensure the `frpc` will start Automaticly. After some experiment, I decide to use `systemcli` to acheve it.

Then use this command bellow to connect the rpi:

```bash
ssh -oPort=6000 rpi@x.x.x.x
```

haha, it's connected!

#### Http

you should have a domain for this part:

1. set your subdomain name resolution to your VPS, to redirect requests  to your `frps` service.
3. set the `sundomain` value in `frpc` configration file
4. set `local_port` value in `frpc` configration file, in order to visit `http://127.0.0.1:[local_port]`
5. config the http server on your VPS, in order to redirect requests to your `frps` service which visit the subdomain above.
6. visit the `http://subdomain.youdomain.com:[vhost_http_port]` to visit the `http://127.0.0.1:[local_port]` on your respberry.

### Frp:

#### Frpc (Client Side):

```bash
# download the frp release pkg
wget https://github.com/fatedier/frp/releases/download/v0.21.0/frp_0.21.0_linux_arm.tar.gz
tar xzf frp_0.21.0_linux_arm.tar.gz
cd frp_0.21.0_linux_arm

# move the binary and configuration file to current place
sudo mkdir -p /etc/frpc
sudo cp frpc /usr/local/sbin
sudo cp frpc.ini /etc/frpc

# create system service
sudo vim /etc/systemd/system/frpc.service
sudo systemctl start frpc

# register it to system startup item
sudo systemctl enable frpc
```

```ini
# /etc/systemd/system/frpc.service

Description=frpc daemon
After=network.target syslog.target
Wants=network.target

[Service]
Type=simple
ExecStart=/usr/local/sbin/frpc -c /etc/frpc/frpc.ini

[Install]
WantedBy=multi-user.target

```

server_addr should be your VPS public IP address

```ini
[common]
user = "your_name"
server_addr = x.x.x.x
server_port = 7000
log_file = /var/log/frp/frpc.log
log_level = info
log_max_days = 7
privilege_token = [token]
login_fail_exit = false

admin_addr = 0.0.0.0
admin_port = 7400
admin_user = admin
admin_pwd = admin

[web]
privilege_mode = true
type = http
local_port = 80
subdomain = frpc
pool_count = 10

[ssh]
privilege_mode = true
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = [port]
use_gzip = true
use_encryption = true
pool_count = 2

[range:VNC]
privilege_mode = true
type = tcp
local_ip = 127.0.0.1
local_port=5901-5903
remote_port= 55901-55903
```

also can view the full configuration file and the docs of frp repo.

```
# view the frpc service state
sudo systemctl status frpc
```

#### Frps (Server Side):

```bash
nohup frps -c ~/.frps.ini &
```

```bash
Veiw logs
tail -f nohup.out
```

frps configuration:

```
[common]
bind_port = 7000
vhost_http_port = [vhost_port]
subdomain_host = [domain]
dashboard_port = 7500
dashboard_user = [username]
dashboard_pwd = [password]
log_file = ./frps.log
log_level = info
log_max_days = 3
privilege_mode = true
privilege_token = [token]
max_pool_count = 50

```
Beacuse the request for `http://frpc.youdomain.com` will arrive your VPS's `80` port by default, If you run a `nginx` server or `apache` and etc. you should redirct these requests to `frps` serive. for example, `nginx` configuration file should like this:

```nginx
server {
  listen 80;
  server_name frpc.youdomain.com;
  location / {
    proxy_pass http://0.0.0.0:7000/;
  }

}
```
then reload the nginx config by these command:

```bash
sudo nginx -t
sudo nginx -s reload
```

Thanks for your reading.


text:
"""
Basic tests for pynts

@author: Gilberto Pastorello
@contact: gzpastorello@lbl.gov
@date: 2017-07-17
"""
import unittest

import pynts

class BasicTest(unittest.TestCase):

    def test_version(self):
        """Test pynts module has '__version__' attribute"""
        self.assertTrue(hasattr(pynts, '__version__'))

if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()


text:
NS_ASSUME_NONNULL_BEGIN

@protocol UIDocumentInteractionControllerDelegate;

@class UIImage, UIView, UIPopoverController;

NS_CLASS_AVAILABLE_IOS(3_2) __TVOS_PROHIBITED @interface UIDocumentInteractionController : NSObject <UIActionSheetDelegate>

+ (UIDocumentInteractionController *)interactionControllerWithURL:(NSURL *)url; // use file to determine UTI. assumes file is complete

@property(nullable, nonatomic, weak) id<UIDocumentInteractionControllerDelegate> delegate; // default is nil

@property(nullable, strong)   NSURL    *URL;             // default is nil. if set, updates UTI, icon and name
@property(nullable, nonatomic, copy)     NSString *UTI;             // determined from name if set, URL otherwise, override if the name or URL uses a custom scheme and the UTI can't be determined automatically
@property(nullable, copy)               NSString *name;            // determined from URL, override if the URL uses a custom scheme and the name can't be determined automatically
@property(nonatomic, readonly) NSArray<UIImage *>  *icons;           // determined from name if set, URL otherwise. will return a generic document icon if an icon cannot be determined. returns an array of icons sorted from smallest to largest.
@property(nullable, nonatomic, strong)   id        annotation;      // additional plist information for application to pass to receiver (must be a plist object). default is nil.

// This is the default method you should call to give your users the option to quick look, open, or copy the document.
// Presents a menu allowing the user to Quick Look, open, or copy the item specified by URL.
// This automatically determines the correct application or applications that can open the item at URL.
// Returns NO if the options menu contained no options and was not opened.
// Note that you must implement the delegate method documentInteractionControllerViewControllerForPreview: to get the Quick Look menu item.
- (BOOL)presentOptionsMenuFromRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated;
- (BOOL)presentOptionsMenuFromBarButtonItem:(UIBarButtonItem *)item animated:(BOOL)animated;

// Bypasses the menu and opens the full screen preview window for the item at URL.  Returns NO if the item could not be previewed.
// Note that you must implement the delegate method documentInteractionControllerViewControllerForPreview: to preview the document.
- (BOOL)presentPreviewAnimated:(BOOL)animated;

// Presents a menu allowing the user to open the document in another application.  The menu
// will contain all applications that can open the item at URL.
// Returns NO if there are no applications that can open the item at URL.
- (BOOL)presentOpenInMenuFromRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated;
- (BOOL)presentOpenInMenuFromBarButtonItem:(UIBarButtonItem *)item animated:(BOOL)animated;

// Dismiss the full screen quick look window if it is visible.
- (void)dismissPreviewAnimated:(BOOL)animated;

// Dismiss any visible menus.
- (void)dismissMenuAnimated:(BOOL)animated;

// Returns an array of gesture recognizers preconfigured to manage the quick look and options menu.
// These gesture recognizers should only be installed on your view when the file has been copied locally and is present at URL.
@property(nonatomic, readonly) NSArray<__kindof UIGestureRecognizer *> *gestureRecognizers;

@end

__TVOS_PROHIBITED @protocol UIDocumentInteractionControllerDelegate <NSObject>

@optional

// If preview is supported, this provides the view controller on which the preview will be presented.
// This method is required if preview is supported.
// If presenting atop a navigation stack, provide the navigation controller in order to animate in a manner consistent with the rest of the platform.
- (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller;

// If preview is supported, these provide the view and rect that will be used as the starting point for the animation to the full screen preview.
// The actual animation that is performed depends upon the platform and other factors.
// If documentInteractionControllerRectForPreview is not implemented, the specified view's bounds will be used.
// If documentInteractionControllerViewForPreview is not implemented, the preview controller will simply fade in instead of scaling up.
- (CGRect)documentInteractionControllerRectForPreview:(UIDocumentInteractionController *)controller;
- (nullable UIView *)documentInteractionControllerViewForPreview:(UIDocumentInteractionController *)controller;

// Preview presented/dismissed on document.  Use to set up any HI underneath.
- (void)documentInteractionControllerWillBeginPreview:(UIDocumentInteractionController *)controller;
- (void)documentInteractionControllerDidEndPreview:(UIDocumentInteractionController *)controller;

// Options menu presented/dismissed on document.  Use to set up any HI underneath.
- (void)documentInteractionControllerWillPresentOptionsMenu:(UIDocumentInteractionController *)controller;
- (void)documentInteractionControllerDidDismissOptionsMenu:(UIDocumentInteractionController *)controller;

// Open in menu presented/dismissed on document.  Use to set up any HI underneath.
- (void)documentInteractionControllerWillPresentOpenInMenu:(UIDocumentInteractionController *)controller;
- (void)documentInteractionControllerDidDismissOpenInMenu:(UIDocumentInteractionController *)controller;

// Synchronous.  May be called when inside preview.  Usually followed by app termination.  Can use willBegin... to set annotation.
- (void)documentInteractionController:(UIDocumentInteractionController *)controller willBeginSendingToApplication:(nullable NSString *)application;	 // bundle ID
- (void)documentInteractionController:(UIDocumentInteractionController *)controller didEndSendingToApplication:(nullable NSString *)application;

// Used to handle additional menu items that can be performed on the item specified by URL.  Currently only supports the "copy:", "print:" and "saveToCameraRoll:" actions.
- (BOOL)documentInteractionController:(UIDocumentInteractionController *)controller canPerformAction:(nullable SEL)action NS_DEPRECATED_IOS(3_2, 6_0);
- (BOOL)documentInteractionController:(UIDocumentInteractionController *)controller performAction:(nullable SEL)action NS_DEPRECATED_IOS(3_2, 6_0);

@end

NS_ASSUME_NONNULL_END


text:
/*
 * This file is part of Nucleus, licensed under the MIT License (MIT). See the LICENSE.txt file
 * at the root of this project for more details.
 */
package io.github.nucleuspowered.nucleus.modules.notification;

import io.github.nucleuspowered.nucleus.core.services.interfaces.annotation.PermissionMetadata;
import io.github.nucleuspowered.nucleus.core.services.interfaces.data.SuggestedLevel;

public final class NotificationPermissions {

    private NotificationPermissions() {}

    @PermissionMetadata(descriptionKey = "permission.base", replacements = { "broadcast" }, level = SuggestedLevel.ADMIN)
    public static final String BASE_BROADCAST = "nucleus.broadcast.base";

    @PermissionMetadata(descriptionKey = "permission.base", replacements = { "basictitle" }, level = SuggestedLevel.ADMIN)
    public static final String BASE_BASICTITLE = "nucleus.basictitle.base";

    @PermissionMetadata(descriptionKey = "permission.multitarget", replacements = { "basictitle" }, level = SuggestedLevel.ADMIN)
    public static final String BASICTITLE_MULTI = "nucleus.basictitle.multiple";

    @PermissionMetadata(descriptionKey = "permission.base", replacements = { "basicsubtitle" }, level = SuggestedLevel.ADMIN)
    public static final String BASE_BASICSUBTITLE = "nucleus.basicsubtitle.base";

    @PermissionMetadata(descriptionKey = "permission.multitarget", replacements = { "basicsubtitle" }, level = SuggestedLevel.ADMIN)
    public static final String BASICSUBTITLE_MULTI = "nucleus.basicsubtitle.multiple";

    @PermissionMetadata(descriptionKey = "permission.base", replacements = { "basicactionbar" }, level = SuggestedLevel.ADMIN)
    public static final String BASE_BASICACTIONBAR = "nucleus.basicactionbar.base";

    @PermissionMetadata(descriptionKey = "permission.multitarget", replacements = { "basicactionbar" }, level = SuggestedLevel.ADMIN)
    public static final String BASICACTIONBAR_MULTI = "nucleus.basicactionbar.multiple";

    @PermissionMetadata(descriptionKey = "permission.base", replacements = { "plainbroadcast" }, level = SuggestedLevel.OWNER)
    public static final String BASE_PLAINBROADCAST = "nucleus.plainbroadcast.base";
}


text:
FROM debian:wheezy

MAINTAINER Jason Gowan <gowanjason@gmail.com>

RUN groupadd sikuli && useradd -m -g sikuli -s /bin/bash sikuli --create-home

RUN apt-get -y update

RUN apt-get -y install x11vnc libsikuli-script-java tightvncserver

RUN mkdir /home/sikuli/.vnc
ADD ./xstartup /home/sikuli/.vnc/xstartup
RUN chmod -v +x /home/sikuli/.vnc/xstartup
RUN x11vnc -storepasswd secret /home/sikuli/.vnc/passwd
RUN chown -R sikuli:sikuli /home/sikuli/.vnc


text:
package poly.algebra

import poly.algebra.factory._
import poly.algebra.specgroup._

/**
 * Represents the existence of an `0` element.
 *
 * An instance of this typeclass should satisfy the following axiom:
 *  - $lawAdditiveIdentity
 * @define lawAdditiveIdentity '''Additive identity''': ∀''a''∈X, ''a'' + 0 == 0 + ''a'' == ''a''.
 * @author Tongfei Chen
 */
trait HasZero[@sp(fdil) +X] {

  /** The `0` element (additive identity) of this type. */
  def zero: X

  /** Casts this object to a `HasIdentity` with identity `0`. */
  def asIdentityWithZero: HasIdentity[X] = new HasIdentity[X] {
    def id = zero
  }
}

object HasZero extends ImplicitGetter[HasZero]


text:
// =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
// Authors: Radu Serban, Justin Madsen, Daniel Melanz
// =============================================================================
//
// Front and Rear HMMWV suspension subsystems (double A-arm).
//
// These concrete suspension subsystems are defined with respect to right-handed
// frames with X pointing towards the front, Y to the left, and Z up (as imposed
// by the base class ChDoubleWishbone) and origins at the midpoint between the
// lower control arms' connection points to the chassis.
//
// All point locations are provided for the left half of the suspension.
//
// =============================================================================

#include "chrono_models/vehicle/hmmwv/HMMWV_DoubleWishbone.h"

namespace chrono {
namespace vehicle {
namespace hmmwv {

// -----------------------------------------------------------------------------
// Static variables
// -----------------------------------------------------------------------------

static const double in2m = 0.0254;
static const double lb2kg = 0.453592;
static const double lbf2N = 4.44822162;
static const double lbfpin2Npm = 175.12677;

const double HMMWV_DoubleWishboneFront::m_UCAMass = 5.813;
const double HMMWV_DoubleWishboneFront::m_LCAMass = 23.965;
const double HMMWV_DoubleWishboneFront::m_uprightMass = 19.450;
const double HMMWV_DoubleWishboneFront::m_spindleMass = 14.705;

const double HMMWV_DoubleWishboneFront::m_spindleRadius = 0.10;
const double HMMWV_DoubleWishboneFront::m_spindleWidth = 0.06;
const double HMMWV_DoubleWishboneFront::m_LCARadius = 0.03;
const double HMMWV_DoubleWishboneFront::m_UCARadius = 0.02;
const double HMMWV_DoubleWishboneFront::m_uprightRadius = 0.04;

// TODO: Fix these values
const ChVector<> HMMWV_DoubleWishboneFront::m_spindleInertia(0.04117, 0.07352, 0.04117);
const ChVector<> HMMWV_DoubleWishboneFront::m_UCAInertiaMoments(0.03, 0.03, 0.06276);
const ChVector<> HMMWV_DoubleWishboneFront::m_UCAInertiaProducts(0.0, 0.0, 0.0);
const ChVector<> HMMWV_DoubleWishboneFront::m_LCAInertiaMoments(0.4, 0.4, 0.8938);
const ChVector<> HMMWV_DoubleWishboneFront::m_LCAInertiaProducts(0.0, 0.0, 0.0);
const ChVector<> HMMWV_DoubleWishboneFront::m_uprightInertiaMoments(0.1656, 0.1934, 0.04367);
const ChVector<> HMMWV_DoubleWishboneFront::m_uprightInertiaProducts(0.0, 0.0, 0.0);

const double HMMWV_DoubleWishboneFront::m_axleInertia = 0.4;

const double HMMWV_DoubleWishboneFront::m_springCoefficient = 167062.000;
const double HMMWV_DoubleWishboneFront::m_springRestLength = 0.339;

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

const double HMMWV_DoubleWishboneRear::m_UCAMass = 5.813;
const double HMMWV_DoubleWishboneRear::m_LCAMass = 23.965;
const double HMMWV_DoubleWishboneRear::m_uprightMass = 19.450;
const double HMMWV_DoubleWishboneRear::m_spindleMass = 14.705;

const double HMMWV_DoubleWishboneRear::m_spindleRadius = 0.10;
const double HMMWV_DoubleWishboneRear::m_spindleWidth = 0.06;
const double HMMWV_DoubleWishboneRear::m_LCARadius = 0.03;
const double HMMWV_DoubleWishboneRear::m_UCARadius = 0.02;
const double HMMWV_DoubleWishboneRear::m_uprightRadius = 0.04;

// TODO: Fix these values
const ChVector<> HMMWV_DoubleWishboneRear::m_spindleInertia(0.04117, 0.07352, 0.04117);
const ChVector<> HMMWV_DoubleWishboneRear::m_UCAInertiaMoments(0.03, 0.03, 0.06276);
const ChVector<> HMMWV_DoubleWishboneRear::m_UCAInertiaProducts(0.0, 0.0, 0.0);
const ChVector<> HMMWV_DoubleWishboneRear::m_LCAInertiaMoments(0.4, 0.4, 0.8938);
const ChVector<> HMMWV_DoubleWishboneRear::m_LCAInertiaProducts(0.0, 0.0, 0.0);
const ChVector<> HMMWV_DoubleWishboneRear::m_uprightInertiaMoments(0.1656, 0.1934, 0.04367);
const ChVector<> HMMWV_DoubleWishboneRear::m_uprightInertiaProducts(0.0, 0.0, 0.0);

const double HMMWV_DoubleWishboneRear::m_axleInertia = 0.4;

const double HMMWV_DoubleWishboneRear::m_springCoefficient = 369149.000;
const double HMMWV_DoubleWishboneRear::m_springRestLength = 0.382;

// -----------------------------------------------------------------------------
// HMMWV shock functor class - implements a nonlinear damper
// -----------------------------------------------------------------------------
class HMMWV_ShockForce : public ChLinkSpringCB::ForceFunctor {
  public:
    HMMWV_ShockForce(double midstroke_compression_slope,
                     double midstroke_rebound_slope,
                     double bumpstop_compression_slope,
                     double bumpstop_rebound_slope,
                     double metalmetal_slope,
                     double min_bumpstop_compression_force,
                     double midstroke_lower_bound,
                     double midstroke_upper_bound,
                     double metalmetal_lower_bound,
                     double metalmetal_upper_bound);

    virtual double operator()(double time,
                              double rest_length,
                              double length,
                              double vel,
                              ChLinkSpringCB* link) override;

  private:
    double m_ms_compr;
    double m_ms_rebound;
    double m_bs_compr;
    double m_bs_rebound;
    double m_metal_K;
    double m_F0;
    double m_ms_min_length;
    double m_ms_max_length;
    double m_min_length;
    double m_max_length;
};

HMMWV_ShockForce::HMMWV_ShockForce(double midstroke_compression_slope,
                                   double midstroke_rebound_slope,
                                   double bumpstop_compression_slope,
                                   double bumpstop_rebound_slope,
                                   double metalmetal_slope,
                                   double min_bumpstop_compression_force,
                                   double midstroke_lower_bound,
                                   double midstroke_upper_bound,
                                   double metalmetal_lower_bound,
                                   double metalmetal_upper_bound)
    : m_ms_compr(midstroke_compression_slope),
      m_ms_rebound(midstroke_rebound_slope),
      m_bs_compr(bumpstop_compression_slope),
      m_bs_rebound(bumpstop_rebound_slope),
      m_metal_K(metalmetal_slope),
      m_F0(min_bumpstop_compression_force),
      m_ms_min_length(midstroke_lower_bound),
      m_ms_max_length(midstroke_upper_bound),
      m_min_length(metalmetal_lower_bound),
      m_max_length(metalmetal_upper_bound) {}

double HMMWV_ShockForce::operator()(double time, double rest_length, double length, double vel, ChLinkSpringCB* link) {
    /*
    // On midstroke curve
    if (length >= m_min_length && length <= m_max_length)
      return (vel >= 0) ? -m_ms_rebound * vel : -m_ms_compr * vel;

    // Hydraulic bump engaged
    return (vel >= 0) ? -m_bs_rebound * vel : -m_bs_compr * vel + m_F0;
    */

    double force = 0;

    // Calculate Damping Force
    if (vel >= 0) {
        force = (length >= m_ms_max_length) ? -m_bs_rebound * vel : -m_ms_rebound * vel;
    } else {
        force = (length <= m_ms_min_length) ? -m_bs_compr * vel : -m_ms_compr * vel;
    }

    // Add in Shock metal to metal contact force
    if (length <= m_min_length) {
        force = m_metal_K * (m_min_length - length);
    } else if (length >= m_max_length) {
        force = -m_metal_K * (length - m_max_length);
    }

    return force;
}

// -----------------------------------------------------------------------------
// Constructors
// -----------------------------------------------------------------------------
HMMWV_DoubleWishboneFront::HMMWV_DoubleWishboneFront(const std::string& name) : ChDoubleWishbone(name) {
    m_springForceCB = new LinearSpringForce(m_springCoefficient  // coefficient for linear spring
                                            );

    m_shockForceCB = new HMMWV_ShockForce(lbfpin2Npm * 71.50,   // midstroke_compression_slope
                                          lbfpin2Npm * 128.25,  // midstroke_rebound_slope
                                          lbfpin2Npm * 33.67,   // bumpstop_compression_slope
                                          lbfpin2Npm * 343.00,  // bumpstop_rebound_slope
                                          lbfpin2Npm * 150000,  // metalmetal_slope
                                          lbf2N * 3350,         // min_bumpstop_compression_force
                                          in2m * 13.76,         // midstroke_lower_bound
                                          in2m * 15.85,         // midstroke_upper_bound
                                          in2m * 12.76,         // metalmetal_lower_bound
                                          in2m * 16.48          // metalmetal_upper_boun
                                          );
}

HMMWV_DoubleWishboneRear::HMMWV_DoubleWishboneRear(const std::string& name) : ChDoubleWishbone(name) {
    m_springForceCB = new LinearSpringForce(m_springCoefficient  // coefficient for linear spring
                                            );

    m_shockForceCB = new HMMWV_ShockForce(lbfpin2Npm * 83.00,   // midstroke_compression_slope
                                          lbfpin2Npm * 200.00,  // midstroke_rebound_slope
                                          lbfpin2Npm * 48.75,   // bumpstop_compression_slope
                                          lbfpin2Npm * 365.00,  // bumpstop_rebound_slope
                                          lbfpin2Npm * 150000,  // metalmetal_slope
                                          lbf2N * 3350,         // min_bumpstop_compression_force
                                          in2m * 13.76,         // midstroke_lower_bound
                                          in2m * 15.85,         // midstroke_upper_bound
                                          in2m * 12.76,         // metalmetal_lower_bound
                                          in2m * 16.48          // metalmetal_upper_bound
                                          );
}

// -----------------------------------------------------------------------------
// Destructors
// -----------------------------------------------------------------------------
HMMWV_DoubleWishboneFront::~HMMWV_DoubleWishboneFront() {
    delete m_springForceCB;
    delete m_shockForceCB;
}

HMMWV_DoubleWishboneRear::~HMMWV_DoubleWishboneRear() {
    delete m_springForceCB;
    delete m_shockForceCB;
}

// -----------------------------------------------------------------------------
// Implementations of the getLocation() virtual methods.
// -----------------------------------------------------------------------------

const ChVector<> HMMWV_DoubleWishboneFront::getLocation(PointId which) {
    switch (which) {
        case SPINDLE:
            return in2m * ChVector<>(-1.59, 35.815, -1.035);
        case UPRIGHT:
            return in2m * ChVector<>(-1.59, 29.5675, -1.0350);
        case UCA_F:
            return in2m * ChVector<>(-1.8864, 17.5575, 9.6308);
        case UCA_B:
            return in2m * ChVector<>(-10.5596, 18.8085, 7.6992);
        case UCA_U:
            return in2m * ChVector<>(-2.088, 28.17, 8.484);
        case UCA_CM:
            return in2m * ChVector<>(-4.155, 23.176, 8.575);
        case LCA_F:
            return in2m * ChVector<>(8.7900, 12.09, 0);
        case LCA_B:
            return in2m * ChVector<>(-8.7900, 12.09, 0);
        case LCA_U:
            return in2m * ChVector<>(-1.40, 30.965, -4.65);
        case LCA_CM:
            return in2m * ChVector<>(0, 21.528, -2.325);
        case SHOCK_C:
            return in2m * ChVector<>(4.095, 19.598, 12.722);
        case SHOCK_A:
            return in2m * ChVector<>(3.827, 21.385, -1.835);
        case SPRING_C:
            return in2m * ChVector<>(4.095, 20.07, 7.775);
        case SPRING_A:
            return in2m * ChVector<>(3.827, 21.385, -1.835);
        case TIEROD_C:
            return in2m * ChVector<>(-9.855, 17.655, 2.135);
        case TIEROD_U:
            return in2m * ChVector<>(-6.922, 32.327, -0.643);
        default:
            return ChVector<>(0, 0, 0);
    }
}

const ChVector<> HMMWV_DoubleWishboneRear::getLocation(PointId which) {
    switch (which) {
        case SPINDLE:
            return in2m * ChVector<>(1.40, 35.815, -1.035);
        case UPRIGHT:
            return in2m * ChVector<>(1.40, 29.5675, -1.035);
        case UCA_F:
            return in2m * ChVector<>(13.7445, 18.1991, 8.9604);
        case UCA_B:
            return in2m * ChVector<>(3.0355, 18.1909, 8.8096);
        case UCA_U:
            return in2m * ChVector<>(1.40, 28.17, 8.5);
        case UCA_CM:
            return in2m * ChVector<>(4.895, 23.183, 8.692);
        case LCA_F:
            return in2m * ChVector<>(8.7900, 12.09, 0);
        case LCA_B:
            return in2m * ChVector<>(-8.7900, 12.09, 0);
        case LCA_U:
            return in2m * ChVector<>(1.40, 30.965, -4.650);
        case LCA_CM:
            return in2m * ChVector<>(0, 21.527, -2.325);
        case SHOCK_C:
            return in2m * ChVector<>(-4.095, 19.598, 12.722);
        case SHOCK_A:
            return in2m * ChVector<>(-3.827, 21.415, -1.511);
        case SPRING_C:
            return in2m * ChVector<>(-4.095, 19.747, 10.098);
        case SPRING_A:
            return in2m * ChVector<>(-3.827, 21.385, -1.835);
        case TIEROD_C:
            return in2m * ChVector<>(8.790, 16.38, 2.310);
        case TIEROD_U:
            return in2m * ChVector<>(6.704, 32.327, -0.365);
        default:
            return ChVector<>(0, 0, 0);
    }
}

}  // end namespace hmmwv
}  // end namespace vehicle
}  // end namespace chrono


text:
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">

  <title>qgis._core.QgsCptCityBrowserModel</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />

         Home

         Trees

         Indices

         Help

        qgis ::
        _core ::
        QgsCptCityBrowserModel ::
        Class QgsCptCityBrowserModel

[hide private]

[frames] | no frames]

Class QgsCptCityBrowserModel

         object --+
                  |
  sip.simplewrapper --+
                      |
            sip.wrapper --+
                          |
       PyQt4.QtCore.QObject --+
                              |
PyQt4.QtCore.QAbstractItemModel --+
                                  |
                                 QgsCptCityBrowserModel

QgsCptCityBrowserModel(QObject parent=None, QgsCptCityArchive
  archive=QgsCptCityArchive.defaultArchive(),
  QgsCptCityBrowserModel.ViewType Type=QgsCptCityBrowserModel.Authors)

        Nested Classes
        [hide private]

        ViewType

        Instance Methods
        [hide private]

          addRootItems(...)

          beginInsertColumns(...)

          beginInsertItems(...)

          beginInsertRows(...)

          beginMoveColumns(...)

          beginMoveRows(...)

          beginRemoveColumns(...)

          beginRemoveItems(...)

          beginRemoveRows(...)

          beginResetModel(...)

          canFetchMore(...)

          changePersistentIndex(...)

          changePersistentIndexList(...)

          childEvent(...)

          columnCount(...)

          connectItem(...)

          connectNotify(...)

          createIndex(...)

          customEvent(...)

          data(...)

          dataItem(...)

          decodeData(...)

          disconnectNotify(...)

          encodeData(...)

          endInsertColumns(...)

          endInsertItems(...)

          endInsertRows(...)

          endMoveColumns(...)

          endMoveRows(...)

          endRemoveColumns(...)

          endRemoveItems(...)

          endRemoveRows(...)

          endResetModel(...)

          fetchMore(...)

          findItem(...)

          findPath(...)

          flags(...)

          hasChildren(...)

          headerData(...)

          index(...)

          parent(...)

          persistentIndexList(...)

          receivers(...)

          refresh(...)

          reload(...)

          removeRootItems(...)

          reset(...)

          resetInternalData(...)

          rowCount(...)

          sender(...)

          senderSignalIndex(...)

          setRoleNames(...)

          timerEvent(...)

Inherited from PyQt4.QtCore.QAbstractItemModel:
      buddy,
      columnsAboutToBeInserted,
      columnsAboutToBeMoved,
      columnsAboutToBeRemoved,
      columnsInserted,
      columnsMoved,
      columnsRemoved,
      dataChanged,
      dropMimeData,
      hasIndex,
      headerDataChanged,
      insertColumn,
      insertColumns,
      insertRow,
      insertRows,
      itemData,
      layoutAboutToBeChanged,
      layoutChanged,
      match,
      mimeData,
      mimeTypes,
      modelAboutToBeReset,
      modelReset,
      removeColumn,
      removeColumns,
      removeRow,
      removeRows,
      revert,
      roleNames,
      rowsAboutToBeInserted,
      rowsAboutToBeMoved,
      rowsAboutToBeRemoved,
      rowsInserted,
      rowsMoved,
      rowsRemoved,
      setData,
      setHeaderData,
      setItemData,
      setSupportedDragActions,
      sibling,
      sort,
      span,
      submit,
      supportedDragActions,
      supportedDropActions

Inherited from PyQt4.QtCore.QObject:
      __getattr__,
      blockSignals,
      children,
      connect,
      deleteLater,
      destroyed,
      disconnect,
      dumpObjectInfo,
      dumpObjectTree,
      dynamicPropertyNames,
      emit,
      event,
      eventFilter,
      findChild,
      findChildren,
      inherits,
      installEventFilter,
      isWidgetType,
      killTimer,
      metaObject,
      moveToThread,
      objectName,
      property,
      pyqtConfigure,
      removeEventFilter,
      setObjectName,
      setParent,
      setProperty,
      signalsBlocked,
      startTimer,
      thread,
      tr,
      trUtf8

Inherited from sip.simplewrapper:
      __init__,
      __new__

Inherited from object:
      __delattr__,
      __format__,
      __getattribute__,
      __hash__,
      __reduce__,
      __reduce_ex__,
      __repr__,
      __setattr__,
      __sizeof__,
      __str__,
      __subclasshook__

        Class Variables
        [hide private]

        Authors = 0

        List = 2

        Selections = 1

Inherited from PyQt4.QtCore.QObject:
      staticMetaObject

        Properties
        [hide private]

Inherited from object:
      __class__

        Method Details
        [hide private]

beginInsertColumns(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.beginInsertColumns

beginInsertRows(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.beginInsertRows

beginMoveColumns(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.beginMoveColumns

beginMoveRows(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.beginMoveRows

beginRemoveColumns(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.beginRemoveColumns

beginRemoveRows(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.beginRemoveRows

beginResetModel(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.beginResetModel

canFetchMore(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.canFetchMore

changePersistentIndex(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.changePersistentIndex

changePersistentIndexList(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.changePersistentIndexList

childEvent(...)

Overrides:
        PyQt4.QtCore.QObject.childEvent

columnCount(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.columnCount

connectNotify(...)

Overrides:
        PyQt4.QtCore.QObject.connectNotify

createIndex(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.createIndex

customEvent(...)

Overrides:
        PyQt4.QtCore.QObject.customEvent

data(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.data

decodeData(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.decodeData

disconnectNotify(...)

Overrides:
        PyQt4.QtCore.QObject.disconnectNotify

encodeData(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.encodeData

endInsertColumns(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.endInsertColumns

endInsertRows(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.endInsertRows

endMoveColumns(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.endMoveColumns

endMoveRows(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.endMoveRows

endRemoveColumns(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.endRemoveColumns

endRemoveRows(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.endRemoveRows

endResetModel(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.endResetModel

fetchMore(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.fetchMore

flags(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.flags

hasChildren(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.hasChildren

headerData(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.headerData

index(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.index

parent(...)

Overrides:
        PyQt4.QtCore.QObject.parent

persistentIndexList(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.persistentIndexList

receivers(...)

Overrides:
        PyQt4.QtCore.QObject.receivers

reset(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.reset

resetInternalData(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.resetInternalData

rowCount(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.rowCount

sender(...)

Overrides:
        PyQt4.QtCore.QObject.sender

senderSignalIndex(...)

Overrides:
        PyQt4.QtCore.QObject.senderSignalIndex

setRoleNames(...)

Overrides:
        PyQt4.QtCore.QAbstractItemModel.setRoleNames

timerEvent(...)

Overrides:
        PyQt4.QtCore.QObject.timerEvent

         Home

         Trees

         Indices

         Help

    Generated by Epydoc 3.0.1 on Tue Jun 14 13:29:19 2016

      http://epydoc.sourceforge.net


text:
<?php

global $posts;
global $timberLongCachetime;

$args = [
    'post_type' => 'page',
    'p' => '873',
    'post_status' => 'private',
];

$posts = get_posts($args);
foreach ($posts as $post) {
    setup_postdata($post);
}

$context = Timber::get_context();

Timber::render('view-error.twig', $context, $timberLongCachetime);


text:
<!DOCTYPE html>

<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width">
<link rel="stylesheet" type="text/css" href="../../css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="../../css/main.css">

Pre-condition

The test device doesn't install the Crosswalk Runtime Library

Setup a web server and make sure the test device can connect it

Test Steps

Build a webapp with below command:

        $ python make_apk.py --package=[package] --manifest=res/manifest.json --arch=x86 --xwalk-apk-url=[http://host/XWalkRuntimeLib.apk] --mode=shared

        Then install it on arm devices and launch it

Click "Get Crosswalk", check the launching screen

Check the status of install Crosswalk Runtime Library, click "Done" to complete installation process

Check the display content of the launched test app

Note: In formal test process, when click "Get Crosswalk" button, it should launch a Google Play or third party app store on Android, or even launch an app store selector
    (if there are two or more app stores were installed on device) for user to select one to download Crosswalk Runtime Library


text:
package com.cg.main;

import java.io.ObjectInputStream.GetField;

import com.cg.person.Person;

/**
 * @author Brijesh
 *
 */
public class TestPerson {

	public static void main(String[] args) {
		System.out.println("In Main()....");
		Person p1 = new Person();
		System.out.println(p1);//string will be printed
//whenever we try to print object
//callback is given to toString() method of the class
//if the class does not have toString() Method
		//then Object class toString is invoke

		Person p2 = new Person();
		System.out.println(p2);

		Person p3 = new Person();
		System.out.println(p3);

		Person p4 = new Person();
		System.out.println(p4);
		System.out.println("Total number of person is :"
				+Person.getPersonCount());
		System.out.println("Nationtionalty is :"
				+Person.getNationality());
	}

}


text:
using System;
using System.Reflection;
using UnityEngine;
using System.Collections.Generic;
using Object = UnityEngine.Object;
using HutongGames.PlayMaker;

namespace HutongGames.PlayMaker.Actions
{
    [ActionCategory(ActionCategory.ScriptControl)]
    public class CallMethod : FsmStateAction
    {
        [ObjectType(typeof(MonoBehaviour))]
        [Tooltip("Store the component in an Object variable.\nNOTE: Set theObject variable's Object Type to get a component of that type. E.g., set Object Type to UnityEngine.AudioListener to get the AudioListener component on the camera.")]
        public FsmObject behaviour;

        //[UIHint(UIHint.Method)]
        [Tooltip("Name of the method to call on the component")]
        public FsmString methodName;

        [Tooltip("Method paramters. NOTE: these must match the method's signature!")]
        public FsmVar[] parameters;

        [ActionSection("Store Result")]

        [UIHint(UIHint.Variable)]
        [Tooltip("Store the result of the method call.")]
        public FsmVar storeResult;

        [Tooltip("Repeat every frame.")]
        public bool everyFrame;

        private Object cachedBehaviour;
        private Type cachedType;
        private MethodInfo cachedMethodInfo;
        private ParameterInfo[] cachedParameterInfo;
        private object[] parametersArray;
        private string errorString;

        public override void OnEnter()
        {
            parametersArray = new object[parameters.Length];

            DoMethodCall();

            if (!everyFrame)
            {
                Finish();
            }
        }

        public override void OnUpdate()
        {
            DoMethodCall();
        }

        private void DoMethodCall()
        {
            if (behaviour.Value == null)
            {
                Finish();
                return;
            }

            if (cachedBehaviour != behaviour.Value)
            {
                errorString = string.Empty;
                if(!DoCache())
                {
                    Debug.LogError(errorString);
                    Finish();
                    return;
                }
            }

            object result = null;
            if (cachedParameterInfo.Length == 0)
            {
                result = cachedMethodInfo.Invoke(cachedBehaviour, null);
            }
            else
            {
                for (var i = 0; i < parameters.Length; i++)
                {
                    var parameter = parameters[i];
                    parameter.UpdateValue();
                    parametersArray[i] = parameter.GetValue();
                }

                result = cachedMethodInfo.Invoke(cachedBehaviour, parametersArray);
            }
            storeResult.SetValue(result);
        }

        private bool DoCache()
        {
            cachedBehaviour = behaviour.Value as MonoBehaviour;
            if (cachedBehaviour == null)
            {
                errorString += "Behaviour is invalid!\n";
                Finish();
                return false;
            }

            cachedType = behaviour.Value.GetType();

#if NETFX_CORE
            cachedMethodInfo = cachedType.GetTypeInfo().GetDeclaredMethod(methodName.Value);
#else
            cachedMethodInfo = cachedType.GetMethod(methodName.Value);
#endif
            if (cachedMethodInfo == null)
            {
                errorString += "Method Name is invalid: " + methodName.Value +"\n";
                Finish();
                return false;
            }

            cachedParameterInfo = cachedMethodInfo.GetParameters();
            return true;
        }

        public override string ErrorCheck()
        {
            errorString = string.Empty;
            DoCache();

            if (!string.IsNullOrEmpty(errorString))
            {
                return errorString;
            }

            if (parameters.Length != cachedParameterInfo.Length)
            {
                return "Parameter count does not match method.\nMethod has " + cachedParameterInfo.Length + " parameters.\nYou specified " +parameters.Length + " paramaters.";
            }

            for (var i = 0; i < parameters.Length; i++)
            {
                var p = parameters[i];
                var paramType = p.RealType;
                var paramInfoType = cachedParameterInfo[i].ParameterType;
                if (!ReferenceEquals(paramType, paramInfoType ))
                {
                    return "Parameters do not match method signature.\nParameter " + (i + 1) + " (" + paramType + ") should be of type: " + paramInfoType;
                }
            }

            if (ReferenceEquals(cachedMethodInfo.ReturnType, typeof(void)))
            {
                if (!string.IsNullOrEmpty(storeResult.variableName))
                {
                    return "Method does not have return.\nSpecify 'none' in Store Result.";
                }
            }
            else if (!ReferenceEquals(cachedMethodInfo.ReturnType,storeResult.RealType))
            {
                return "Store Result is of the wrong type.\nIt should be of type: " + cachedMethodInfo.ReturnType;
            }

            return string.Empty;
        }
    }
}


text:
#include "../../Application/jucer_Headers.h"
#include "jucer_EditingPanelBase.h"
#include "jucer_JucerDocumentEditor.h"

//==============================================================================
class EditingPanelBase::MagnifierComponent  : public Component
{
public:
    explicit MagnifierComponent (Component* c) : content (c)
    {
        addAndMakeVisible (content.get());
        childBoundsChanged (content.get());
    }

    void childBoundsChanged (Component* child)
    {
        auto childArea = getLocalArea (child, child->getLocalBounds());
        setSize (childArea.getWidth(), childArea.getHeight());
    }

    double getScaleFactor() const   { return scaleFactor; }

    void setScaleFactor (double newScale)
    {
        scaleFactor = newScale;
        content->setTransform (AffineTransform::scale ((float) scaleFactor));
    }

private:
    double scaleFactor = 1.0;
    std::unique_ptr<Component> content;
};

//==============================================================================
class ZoomingViewport   : public Viewport
{
public:
    explicit ZoomingViewport (EditingPanelBase* p) : panel (p)
    {
    }

    void mouseWheelMove (const MouseEvent& e, const MouseWheelDetails& wheel)
    {
        if (e.mods.isCtrlDown() || e.mods.isAltDown() || e.mods.isCommandDown())
            mouseMagnify (e, 1.0f / (1.0f - wheel.deltaY));
        else
            Viewport::mouseWheelMove (e, wheel);
    }

    void mouseMagnify (const MouseEvent& e, float factor)
    {
        panel->setZoom (panel->getZoom() * factor, e.x, e.y);
    }

    void dragKeyHeldDown (const bool isKeyDown)
    {
        if (isSpaceDown != isKeyDown)
        {
            isSpaceDown = isKeyDown;

            if (isSpaceDown)
            {
                auto dc = new DraggerOverlayComp();
                addAndMakeVisible (dc);
                dc->setBounds (getLocalBounds());
            }
            else
            {
                for (int i = getNumChildComponents(); --i >= 0;)
                    std::unique_ptr<DraggerOverlayComp> deleter (dynamic_cast<DraggerOverlayComp*> (getChildComponent (i)));
            }
        }
    }

private:
    EditingPanelBase* const panel;
    bool isSpaceDown = false;

    //==============================================================================
    class DraggerOverlayComp    : public Component
    {
    public:
        DraggerOverlayComp()
        {
            setMouseCursor (MouseCursor::DraggingHandCursor);
            setAlwaysOnTop (true);
        }

        void mouseDown (const MouseEvent&)
        {
            if (Viewport* viewport = findParentComponentOfClass<Viewport>())
            {
                startX = viewport->getViewPositionX();
                startY = viewport->getViewPositionY();
            }
        }

        void mouseDrag (const MouseEvent& e)
        {
            if (Viewport* viewport = findParentComponentOfClass<Viewport>())
                viewport->setViewPosition (jlimit (0, jmax (0, viewport->getViewedComponent()->getWidth() - viewport->getViewWidth()),
                                                   startX - e.getDistanceFromDragStartX()),
                                           jlimit (0, jmax (0, viewport->getViewedComponent()->getHeight() - viewport->getViewHeight()),
                                                   startY - e.getDistanceFromDragStartY()));
        }

    private:
        int startX, startY;
    };
};

//==============================================================================
EditingPanelBase::EditingPanelBase (JucerDocument& doc, Component* props, Component* editorComp)
    : document (doc),
      editor (editorComp),
      propsPanel (props)
{
    addAndMakeVisible (viewport = new ZoomingViewport (this));
    addAndMakeVisible (propsPanel);

    viewport->setViewedComponent (magnifier = new MagnifierComponent (editor));
}

EditingPanelBase::~EditingPanelBase()
{
    deleteAllChildren();
}

void EditingPanelBase::resized()
{
    const int contentW = jmax (1, getWidth() - 260);

    propsPanel->setBounds (contentW + 4, 4, jmax (100, getWidth() - contentW - 8), getHeight() - 8);

    viewport->setBounds (4, 4, contentW - 8, getHeight() - 8);

    if (document.isFixedSize())
        editor->setSize (jmax (document.getInitialWidth(),
                               roundToInt ((viewport->getWidth() - viewport->getScrollBarThickness()) / getZoom())),
                         jmax (document.getInitialHeight(),
                               roundToInt ((viewport->getHeight() - viewport->getScrollBarThickness()) / getZoom())));
    else
        editor->setSize (viewport->getWidth(),
                         viewport->getHeight());
}

void EditingPanelBase::paint (Graphics& g)
{
    g.fillAll (findColour (secondaryBackgroundColourId));
}

void EditingPanelBase::visibilityChanged()
{
    if (isVisible())
    {
        updatePropertiesList();

        if (Component* p = getParentComponent())
        {
            resized();

            if (JucerDocumentEditor* const cdh = dynamic_cast<JucerDocumentEditor*> (p->getParentComponent()))
                cdh->setViewportToLastPos (viewport, *this);

            resized();
        }
    }
    else
    {
        if (Component* p = getParentComponent())
            if (JucerDocumentEditor* const cdh = dynamic_cast<JucerDocumentEditor*> (p->getParentComponent()))
                cdh->storeLastViewportPos (viewport, *this);
    }

    editor->setVisible (isVisible());
}

double EditingPanelBase::getZoom() const
{
    return magnifier->getScaleFactor();
}

void EditingPanelBase::setZoom (double newScale)
{
    setZoom (jlimit (1.0 / 8.0, 16.0, newScale),
             viewport->getWidth() / 2,
             viewport->getHeight() / 2);
}

void EditingPanelBase::setZoom (double newScale, int anchorX, int anchorY)
{
    Point<int> anchor (editor->getLocalPoint (viewport, Point<int> (anchorX, anchorY)));

    magnifier->setScaleFactor (newScale);

    resized();

    jassert (viewport != nullptr);
    anchor = viewport->getLocalPoint (editor, anchor);

    viewport->setViewPosition (jlimit (0, jmax (0, viewport->getViewedComponent()->getWidth() - viewport->getViewWidth()),
                                       viewport->getViewPositionX() + anchor.getX() - anchorX),
                               jlimit (0, jmax (0, viewport->getViewedComponent()->getHeight() - viewport->getViewHeight()),
                                       viewport->getViewPositionY() + anchor.getY() - anchorY));
}

void EditingPanelBase::xyToTargetXY (int& x, int& y) const
{
    Point<int> pos (editor->getLocalPoint (this, Point<int> (x, y)));
    x = pos.getX();
    y = pos.getY();
}

void EditingPanelBase::dragKeyHeldDown (bool isKeyDown)
{
    ((ZoomingViewport*) viewport)->dragKeyHeldDown (isKeyDown);
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>ISB JoP June 10</title><meta name="keywords" content="physics,  shuttlecock, drag, double ball bounce, impulse" />
</head>

<frameset rows="*" cols="210,800" frameborder="yes" bordercolor="#121B85">
  <frame src="menu.html" NAME="frame1" />
  <frame src="contents.html" NAME="frame2"  />
</frameset>
<noframes><body>
</body>
</noframes></html>


text:
#include <aws/appflow/model/VeevaMetadata.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace Appflow
{
namespace Model
{

VeevaMetadata::VeevaMetadata()
{
}

VeevaMetadata::VeevaMetadata(JsonView jsonValue)
{
  *this = jsonValue;
}

VeevaMetadata& VeevaMetadata::operator =(JsonView jsonValue)
{
  AWS_UNREFERENCED_PARAM(jsonValue);
  return *this;
}

JsonValue VeevaMetadata::Jsonize() const
{
  JsonValue payload;

  return payload;
}

} // namespace Model
} // namespace Appflow
} // namespace Aws


text:
"use strict";

const Koa = require('koa');
const Router = require('../routes');
const Broker = require('../broker');
const Config = require("../config");

class App extends Koa {
    constructor() {
        super();
        let self = this;

        self.router = new Router();
        self.broker = new Broker();
    }

    attachRoutes() {
        let self = this;

        self.router.declareRoutes();
        self.use(self.router.routes());
    }

    attachBroker() {
        let self = this;
        self.broker.attachListeners();
    }

    startServer() {
        let self = this;

        self.listen(Config.server.port, () => {
            console.log("server started")
        });

    }

}

module.exports = App;


text:
class ServiceCanto < ActiveRecord::Base
   belongs_to :service
   belongs_to :canto ;end


text:
package org.assertj.core.internal.bigintegers;

import static java.math.BigInteger.ONE;
import static java.math.BigInteger.TEN;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.assertj.core.error.ShouldBeEqual.shouldBeEqual;
import static org.assertj.core.test.TestData.someInfo;
import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown;
import static org.assertj.core.util.FailureMessages.actualIsNull;
import static org.mockito.Mockito.verify;

import java.math.BigInteger;

import org.assertj.core.api.AssertionInfo;
import org.assertj.core.internal.BigIntegers;
import org.assertj.core.internal.BigIntegersBaseTest;
import org.assertj.core.presentation.StandardRepresentation;
import org.junit.jupiter.api.Test;

/**
 * Tests for <code>{@link BigIntegers#assertEqualByComparison(AssertionInfo, BigInteger, BigInteger)}</code>.
 */
public class BigIntegers_assertEqualByComparison_Test extends BigIntegersBaseTest {

  @Test
  public void should_fail_if_actual_is_null() {
    assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> numbers.assertEqualByComparison(someInfo(), null, ONE))
                                                   .withMessage(actualIsNull());
  }

  @Test
  public void should_pass_if_big_integers_are_equal_by_comparison() {
    numbers.assertEqualByComparison(someInfo(), new BigInteger("5"), new BigInteger("5"));
  }

  @Test
  public void should_fail_if_big_integers_are_not_equal_by_comparison() {
    AssertionInfo info = someInfo();
    try {
      numbers.assertEqualByComparison(info, TEN, ONE);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldBeEqual(TEN, ONE, info.representation()));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }

  @Test
  public void should_fail_if_actual_is_null_whatever_custom_comparison_strategy_is() {
    assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> numbersWithAbsValueComparisonStrategy.assertEqualByComparison(someInfo(), null, ONE))
                                                   .withMessage(actualIsNull());
  }

  @Test
  public void should_pass_if_big_integers_are_equal_by_comparison_whatever_custom_comparison_strategy_is() {
    numbersWithAbsValueComparisonStrategy.assertEqualByComparison(someInfo(), new BigInteger("5"), new BigInteger("5"));
  }

  @Test
  public void should_fail_if_big_integers_are_not_equal_by_comparison_whatever_custom_comparison_strategy_is() {
    AssertionInfo info = someInfo();
    try {
      numbersWithAbsValueComparisonStrategy.assertEqualByComparison(info, TEN, ONE);
    } catch (AssertionError e) {
      verify(failures).failure(info, shouldBeEqual(TEN, ONE, absValueComparisonStrategy,
                                                   new StandardRepresentation()));
      return;
    }
    failBecauseExpectedAssertionErrorWasNotThrown();
  }
}


text:
import backend
backend.main('-e', 'test')


text:
/*
 * File:   MemberwiseSerializer.h
 * Author: michal
 *
 * Created on March 3, 2016, 12:10 AM
 */

#ifndef MEMBERWISESERIALIZER_H
#define	MEMBERWISESERIALIZER_H

namespace Serialize
{
    template <class Format>
    struct MemberSerializer
    {
        MemberSerializer(IOutputStream &stream) : stream(stream) {}
        Serialize::FormattedOStream<Format> stream;

        template <class T>
        void operator()(const T &member)
        {
            stream << member;
        }
    };
    template <class Format>
    struct MemberDeserializer
    {
        MemberDeserializer(IInputStream &stream) : stream(stream) {}
        Serialize::FormattedIStream<Format> stream;

        template <class T>
        void operator()(T &member)
        {
            stream >> member;
        }
    };

    template <class Format, class T>
    struct SerializerCheckMemberwise<Format, T, true>
    {
        void serialize(IOutputStream &out, const T &object)
        {
            MemberSerializer<Format> S(out);
            memberwise<serialization_purpose<Format>>(S, object);
        }
    };

    template <class Format, class T>
    struct DeserializerCheckMemberwise<Format, T, true>
    {
        void deserialize(IInputStream &in, T &object)
        {
            MemberDeserializer<Format> D(in);
            memberwise<deserialization_purpose<Format>>(D, object);
        }
    };
}

#define SERIALIZE_MEMBERS(Format, Type, ...) template <> struct member_list<Type, serialization_purpose<Format> > : decltype(member_ptr_list<>() MEMBER_LIST_ARGS(Type, __VA_ARGS__)) {}

// only use if member list is different than one specified in SERIALIZE_MEMBERS
// or if SERIALIZE_MEMBERS is deliberately not specified
#define DESERIALIZE_MEMBERS(Format, Type, ...) template <> struct member_list<Type, deserialization_purpose<Format> > : decltype(member_ptr_list<>() MEMBER_LIST_ARGS(Type, __VA_ARGS__)) {}

#endif	/* MEMBERWISESERIALIZER_H */


text:
package net.ihiroky.niotty.codec;

import net.ihiroky.niotty.buffer.Buffers;
import net.ihiroky.niotty.buffer.CodecBuffer;

/**
 *
 */
public class InputSupport {

    private CodecBuffer buffer_;

    /**
     *
Reads data to the amount of specified {@code requiredLength}.

     *
     *
If enough data exist in the {@code input}, then this method returns a buffer
     * which contains data at least {@code requiredLength}. Otherwise, returns null
     * and pools a content of the {@code input} to a member field.

     *
     * @param input a input buffer
     * @param requiredLength expected read length
     * @param noCopyIfEnough true if this method returns the {@code input} when the {@code input}
     *                       has enough data to read data to the amount of {@code requiredLength},
     *                       or returns new copied buffer.
     * @return the buffer which contains the data at least the {@code requiredLength}, or null.
     */
    CodecBuffer readFully(CodecBuffer input, int requiredLength, boolean noCopyIfEnough) {
        if (buffer_ != null) {
            buffer_.drainFrom(input, requiredLength - buffer_.remaining());
            if (buffer_.remaining() == requiredLength) {
                CodecBuffer fulfilled = buffer_;
                buffer_ = null;
                return fulfilled;
            }
            return null;
        }

        int remainingBytes = input.remaining();
        if (remainingBytes >= requiredLength) {
            return noCopyIfEnough ? input : drain(input, requiredLength);
        }
        if (remainingBytes == 0) {
            return null;
        }
        buffer_ = drain(input, requiredLength);
        return null;
    }

    /**
     * Creates a new buffer and drains the content in {@code input}.
     * @param input the input
     * @param bytes the length to drain
     * @return the new buffer
     */
    static CodecBuffer drain(CodecBuffer input, int bytes) {
        CodecBuffer b = Buffers.wrap(new byte[bytes], 0, 0);
        b.drainFrom(input, bytes);
        return b;
    }

    /**
     * Retruns the buffer.
     * @return the buffer
     */
    CodecBuffer getPooling() {
        return buffer_;
    }
}


text:
const {
  Client
} = require("node-rest-client");
const Callback = require("events");

const apiBase = "https://curse-rest-proxy.azurewebsites.net/api";
const apiAuth = `${apiBase}/authenticate`;
const apiGetAddon = apiBase + "/addon/${projectId}";
const apiGetAddonFiles = apiBase + "/addon/${projectId}/files";
const apiGetFile = apiBase + "/addon/${projectId}/file/${fileId}";

class LoginCallback extends Callback {}
class GetInfoCallback extends Callback {}

class Curse {
  constructor(token = null) {
    this.token = token;
    this.client = new Client();
  }

  login(username, password) {
    let args = {
      data: {
        username,
        password
      },
      headers: {
        "Content-Type": "application/json"
      }
    };

    let callback = new LoginCallback();

    this.client.post(apiAuth, args, (data, response) => {
      if (Math.floor(response.statusCode / 100) == 2) {
        if (data.status == "Success") {
          this.token = "Token " + data.session.user_id + ":" + data.session.token;
          callback.emit('login', {
            token: this.token,
            username: data.session.username
          })
        } else {
          callback.emit('error', {
            type: 'unsuccessful login',
            data
          });
        }
      } else {
        callback.emit('error', {
          type: 'bad response code',
          response
        });
      }
    });

    return callback;
  }

  isLoggedIn() {
    return !!this.token;
  }

  getProject(projectId) {
    if (!this.token) {
      throw new Error("The curse api has not been authenticated");
    }

    let args = {
      path: {
        projectId
      },
      headers: {
        "Authorization": this.token
      }
    };

    let callback = new GetInfoCallback();

    this.client.get(apiGetAddon, args, (data, response) => {
      if (Math.floor(response.statusCode / 100) == 2) {
        callback.emit('finish', data);
      } else {
        callback.emit('error', {
          type: 'bad response code',
          response
        });
      }
    });

    return callback;
  }

  getProjectFiles(projectId) {
    if (!this.token) {
      throw new Error("The curse api has not been authenticated");
    }

    let args = {
      path: {
        projectId
      },
      headers: {
        "Authorization": this.token
      }
    };

    let callback = new GetInfoCallback();

    this.client.get(apiGetAddonFiles, args, (data, response) => {
      if (Math.floor(response.statusCode / 100) == 2) {
        callback.emit('finish', data);
      } else {
        callback.emit('error', {
          type: 'bad response code',
          response
        });
      }
    });

    return callback;
  }

  getFile(projectId, fileId) {
    if (!this.token) {
      throw new Error("The curse api has not been authenticatd");
    }

    let args = {
      path: {
        projectId,
        fileId
      },
      headers: {
        "Authorization": this.token
      }
    };

    let callback = new GetInfoCallback();

    this.client.get(apiGetFile, args, (data, response) => {
      if (Math.floor(response.statusCode / 100) == 2) {
        callback.emit('finish', data);
      } else {
        callback.emit('error', {
          type: 'bad response code',
          response
        });
      }
    });

    return callback;
  }
}

module.exports.Curse = Curse;


text:
package q5;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;

/**
 * Computes shortest path using Dijkstra's algorithm.
 */
public class Dijkstra {

  public static void main(String[] args) throws IOException {
    String sourceNodeLabel = "1";
    String targetDestinations = "7,37,59,82,99,115,133,165,188,197";
    // String targetDestinations = "1,2,3,4,5,6,7,8";

    Dijkstra algo = new Dijkstra();
    algo.loadGraph(args[0]);
    System.out.println("Graph loaded.");
    Map<DijkstraNode, Integer> dists = algo.calculateShortestDistancesFrom(sourceNodeLabel);
    System.out.println("Distances calculated for " + sourceNodeLabel + ".");

    String[] parts = targetDestinations.split(",");
    for (String dst : parts) {
      System.out.print(dists.get(algo.graph.getNodes().get(dst)) + ",");
    }
    System.out.println();
  }

  private static final int EXPECTED_NODES = 200;
  private DijkstraGraph graph = new DijkstraGraph(EXPECTED_NODES);

  public void loadGraph(String fileName) throws IOException {
    for (String line : Files.readAllLines(Paths.get(fileName), StandardCharsets.UTF_8)) {
      String[] parts = line.split("\\s+");
      String nodeLabel = parts[0];
      for (int i = 1; i < parts.length; ++i) {
        String[] nodeParts = parts[i].split(",");
        graph.connectNodes(nodeLabel, nodeParts[0], Integer.parseInt(nodeParts[1]));
      }
    }
  }

  public Map<DijkstraNode, Integer> calculateShortestDistancesFrom(String nodeLabel) {
    Map<DijkstraNode, Integer> minDistances = new HashMap<>(EXPECTED_NODES);
    Map<DijkstraNode, Integer> knownDistances = new HashMap<>(EXPECTED_NODES);

    DijkstraNode sourceNode = graph.getNodes().get(nodeLabel);
    minDistances.put(sourceNode, 0);
    for (DijkstraNode outLink : sourceNode.getOutLinks().keySet()) {
      int distance = sourceNode.getOutLinks().get(outLink);
      knownDistances.put(outLink, distance);
    }

    while (!knownDistances.isEmpty()) {
      DijkstraNode shortestNode = null;
      int shortestDistance = Integer.MAX_VALUE;
      for (DijkstraNode node : knownDistances.keySet()) {
        if (knownDistances.get(node) < shortestDistance) {
          shortestNode = node;
          shortestDistance = knownDistances.get(node);
        }
      }

      knownDistances.remove(shortestNode);

      if (!minDistances.containsKey(shortestNode)) {
        minDistances.put(shortestNode, shortestDistance);

        for (DijkstraNode outLink : shortestNode.getOutLinks().keySet()) {
          int outLinkDistance =
              shortestNode.getOutLinks().get(outLink) + minDistances.get(shortestNode);
          if (knownDistances.get(outLink) == null) {
            knownDistances.put(outLink, outLinkDistance);
          } else {
            knownDistances.put(outLink, Math.min(outLinkDistance, knownDistances.get(outLink)));
          }
        }
      }
    }

    return minDistances;
  }

}


text:
@protocol JSONParser <NSObject>

+ (instancetype)instanceWithJSONObject:(NSObject *)obj;

@end


text:
package models;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import play.db.ebean.Model;
import play.db.ebean.Model.Finder;

/**
 * A representation of a User adding a Surfer as a favorite.
 */
@Entity
public class Favorite extends Model {
  private static final long serialVersionUID = 1L;

  @Id
  private long id;

  @ManyToOne
  private Surfer surfer;
  @ManyToOne
  private UserInfo userInfo;

  /**
   * Constructor.
   * @param surfer A Surfer.
   * @param userInfo An UserInfo.
   */
  public Favorite(Surfer surfer, UserInfo userInfo) {
    this.surfer = surfer;
    this.userInfo = userInfo;
  }

  /**
   * @return the id
   */
  public long getId() {
    return id;
  }

  /**
   * @param id the id to set
   */
  public void setId(long id) {
    this.id = id;
  }

  /**
   * @return the surfer
   */
  public Surfer getSurfer() {
    return surfer;
  }

  /**
   * @param surfer the surfer to set
   */
  public void setSurfer(Surfer surfer) {
    this.surfer = surfer;
  }

  /**
   * @return the userInfo
   */
  public UserInfo getUserInfo() {
    return userInfo;
  }

  /**
   * @param userInfo the userInfo to set
   */
  public void setUserInfo(UserInfo userInfo) {
    this.userInfo = userInfo;
  }

  /**
   * The EBean ORM finder method for database queries on ID.
   * @return The finder method for Favorites.
   */
  public static Finder<Long, Favorite> find() {
    return new Finder<Long, Favorite>(Long.class, Favorite.class);
  }

}


text:
package org.apache.derby.iapi.services.jmx;

import org.apache.derby.shared.common.error.StandardException;
import org.apache.derby.mbeans.ManagementMBean;

/**
*

* This interface represents a Management Service. An implementation of this
* service is started by the Derby monitor if the system property derby.system.jmx has
* been set. The following services are provided:
*

*
*

*
 Create and start an instance of MBean server to register MBeans.

*
 Create managed beans (MBeans) to instrument derby resources for
*            management and monitoring.

*

*
*

* The following code can be used to locate an instance of this service
* if running.
*

*
*

* ManagementService ms = (ManagementService)
*        Monitor.getSystemModule(Module.JMX);
*

*
*/
public interface ManagementService extends ManagementMBean {

    /**
     * The domain for all of derby's mbeans: org.apache.derby
     */
    public static final String DERBY_JMX_DOMAIN = "org.apache.derby";

    /**
     * Registers an MBean with the MBean server.
     * The mbean will be unregistered automatically when Derby shuts down.
     *
     *
     * @param <T> The kind of bean
     * @param bean The MBean to wrap with a StandardMBean and register
     * @param beanInterface The management interface for the MBean.
     * @param keyProperties The String representation of the MBean's key properties,
     * they will be added into the ObjectName with Derby's domain. Key
     * type should be first with a short name for the bean, typically the
     * class name without the package.
     *
     * @return An identifier that can later be used to unregister the mbean.
     * @throws StandardException on error
     */
    public <T> Object registerMBean(T bean,
            Class<T> beanInterface,
            String keyProperties)
            throws StandardException;

    /**
     * Unregister a mbean previously registered with registerMBean.
     *
     * @param mbeanIdentifier An identifier returned by registerMBean.
     */
    public void unregisterMBean(Object mbeanIdentifier);

    /**
     * Quote an MBean key property value, so that it is safe to pass to
     * {@link #registerMBean} even if it potentially contains special
     * characters.
     *
     * @param value the value to quote
     * @return the quoted value
     * @see javax.management.ObjectName#quote(String)
     */
    String quotePropertyValue(String value);
}


text:
rpm -q kernel

yum -y install yum-utils

package-cleanup --oldkernels --count=1

yum -y remove yum-utils