text:
var util = require('util')
  , Message = require('./message');

var debug = false;
var verbose = false;
var fieldName = 'flash';

module.exports.REQUEST_SCOPE = Message.REQUEST_SCOPE;
module.exports.SESSION_SCOPE = Message.SESSION_SCOPE;

module.exports.configure = function(config) {
  config = config || {};
  debug = config.debug || debug;
  verbose = config.verbose || verbose;
  fieldName = config.fieldName || fieldName;
}

module.exports.init = function(req, res, next) {
  if (!req.flash) req.flash = flashReq;
  if (!req.flashBody) req.flashBody = flashBody;
  flashToLocals(req, res);
  next();
}

function flashReq() {
  if (this.session === undefined)
    throw Error('req.flash(): requires sessions !');
  var flash = this.session.flash = this.session.flash || [];
  if (arguments.length == 0) return flash;
  if (arguments.length == 1) {
    arg = arguments[0];
    if (typeof arg == 'string') return pull(flash, arg);
    if (util.isArray(arg)) {
      for (var index = 0; index < arg.length; ++index) {
        addToFlash(flash, buildMessage(arg[index]));
      }
    } else addToFlash(flash, buildMessage(arg));
  } else if (arguments.length > 1) {
    addToFlash(flash, buildMessage(arguments[0], arguments[1], arguments[2]));
  }
}

function buildMessage() {
  try {
    if (arguments.length == 1)
      return new Message(arguments[0]);
    if (arguments.length == 3)
      return new Message(arguments[0], arguments[1], arguments[2]);
  } catch(ex) { console.error("Build Flash Message Error:", ex.message); }
  return undefined;
}

function addToFlash(flash, message) {
  if (message == undefined) return;
  if (verbose) console.log("Add flash:", message);
  for (var index = 0; index < flash.length; ++index) {
    if (flash[index] && flash[index].key == message.key) {
      if (message.value != undefined) flash[index] = message;
      else flash.splice(index, 1);
      return;
    }
  }
  flash.push(message);
}

function pull(flash, key) {
  var message;
  var index = 0;
  while (index < flash.length) {
    if (flash[index] && flash[index].key == key) {
      message = flash[index];
      break;
    }
    ++index;
  }
  removeMessage(flash, message, index);
  return message;
}

function removeMessage(flash, message, index) {
  if (message) {
    if (verbose) console.log("Pull flash:", message);
    if (message.scope == Message.REQUEST_SCOPE) {
      flash.splice(index, 1);
      return true;
    }
  }
  return false;
}

function flashToLocals(req, res) {
  res.locals[fieldName] = res.locals[fieldName] || {};
  var flash = req.flash();
  var index = 0;
  while (index < flash.length) {
    var message = flash[index];
    if (!removeMessage(flash, message, index)) ++index;
    addToLocals(res, message.key, message.value);
  }
}

function addToLocals(res, key, value) {
  res.locals[fieldName][key] = value;
  if (verbose) console.log(util.format(
        "Flash local message [%s]: \"%s\" added !", key, value));
}

function flashBody() {
  if (this.body == null) return;
  var messages = [];
  for (var key in this.body) {
    messages.push({ key: key, value: this.body[key]});
  }
  this.flash(messages);
}


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

<title>MageFactory</title>
<meta name="date" content="2015-04-22">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Class MageFactory

java.lang.Object

SoldierFactory

MageFactory

public class MageFactory
extends SoldierFactory

Factory class that produces Mage objects

Author:

Mehmet Can Boysan

See Also:

Mage

Constructor Summary

Constructors

Constructor and Description

MageFactory()

Method Summary

Methods

Modifier and Type
Method and Description

Knight
produce(double x,
       double y,
       int health,
       int normalHitPoint,
       int specialHitPoint,
       int specialSkillRadius,
       int normalAttackRadius,
       int speed,
       Team assignedTeam)

Produces Mage objects.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

MageFactory

public MageFactory()

Method Detail

produce

public Knight produce(double x,
             double y,
             int health,
             int normalHitPoint,
             int specialHitPoint,
             int specialSkillRadius,
             int normalAttackRadius,
             int speed,
             Team assignedTeam)

Produces Mage objects.

Parameters:

x - X position of the Knight

y - Y position of the Knight

health - Current and Maximum health of the Knight

normalHitPoint - Normal hit damage

specialHitPoint - Special hit damage

specialSkillRadius - Radius of the Knight's special skill

normalAttackRadius - Radius of the Knight's special skill

speed - Knight's speed

assignedTeam - Team of the knight that is assigned to

Returns:

new Mage object

See Also:

Mage

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

redpajama_set_name: RedPajamaGithub


text:
layout: post
microblog: true
audio:
photo:
date: 2017-01-06 09:39:08 -0700
guid: http://curt.micro.blog/2017/01/06/t817410179167752192.html
---
I love this idea of the size of types. It puts the problems of stringly typed code on a quantitative foundation. [https://t.co/koaEqAxrW9](https://t.co/koaEqAxrW9)


text:
@implementation JAModel

+ (NSArray *)blackList {
    return @[@"superclass",@"debugDescription",@"hash",@"description"];
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
#if DEBUG
    NSLog(@"[JA]:%@ %@ 赋值 %@ 报错! 原因:未找到key",[self class],key,value);
#endif
}

@end


text:
from datetime import time
from typing import List, Optional

class Arduino:
    def __init__(self, id: int, name: str, template_id: int):
        self.__id = id
        self.name = name
        self.template_id = template_id

    @property
    def id(self) -> int:
        return self.__id

class Template:
    def __init__(self, id: int, name: str, nb_input_pins: int, nb_output_pins: int):
        self.__id = id
        self.name = name
        self.nb_input_pins = nb_input_pins
        self.nb_output_pins = nb_output_pins

    @property
    def id(self) -> int:
        return self.__id

class OutputPin:
    def __init__(self, id: int, number: int, parent_id: int):
        self.parent_id = parent_id
        self.number = number
        self.__id = id

    @property
    def id(self) -> int:
        return self.__id

class InputPin:
    def __init__(self, id: int, number: int, action_ids: List[int], parent_id: int, time_between_clicks: float):
        self.parent_id = parent_id
        self.action_ids = action_ids
        self.number = number
        self.time_between_clicks = time_between_clicks
        self.__id = id

    @property
    def id(self) -> int:
        return self.__id

class Action:
    def __init__(self,
                 id: int,
                 action_type: int,
                 trigger_id: int,
                 notification_ids: List[int],
                 delay: int,
                 timer: int,
                 output_pin_ids: List[int],
                 condition_id: Optional[int],
                 master_id: Optional[int],
                 click_number: int,
                 dimmer_speed: Optional[int],
                 cancel_on_button_release: Optional[bool],
                 dimmer_light_value: Optional[int],
                 master_dimmer_id: Optional[int]):
        """
        Creates a new Action

        :param id: The identifier of this action
        :param action_type: The kind of action. See src.button.domain.ActionType class for possible values
        :param trigger_id: The identifier of the trigger of this action
        :param notification_ids: The identifiers of the notifications of this action. Can be empty.
        :param delay: The delay before this action should be executed.
        :param timer: The timer after which the action should be reverted. Only applies for ON/OFF actions
        :param output_pin_ids: The identifiers of the output pins affected by this action.
        :param condition_id: The (optional) identifier of the condition that should apply for this action.
        :param master_id: The master pin that should determine the TOGGLE action. This pin will be looked at when
                            determining whether it should toggle on or off
        :param click_number: Number of times that has to be clicked on multiclick action to activate
        :param dimmer_speed: How fast/slow the dimmer has to change light intensity
        :param cancel_on_button_release: If this is set to true, the dimmer will stop dimming as soon
                                            as the button is released
        :param dimmer_light_value: If set to -1, a dimmer will remember its last known value before switching off
                                    If set to a value, a dimmer will go to this value by default/not remember last value
        :param master_dimmer_id: The identifier of the dimmer whose last known value should be taken when switching
                                    the dimmer on.
        """
        # General properties
        self.__id = id
        self.__trigger_id = trigger_id
        self.__action_type = action_type
        self.__delay = delay
        self.__output_pin_ids = output_pin_ids
        self.__notification_ids = notification_ids
        self.__condition_id = condition_id
        self.__click_number = click_number

        # ON/OFF/ON_DIMMER/OFF_DIMMER action
        self.__timer = timer

        # TOGGLE/TOGGLE_DIMMER action
        self.__master_id = master_id

        # DIMMER
        self.__dimmer_speed = dimmer_speed
        self.__cancel_on_button_release = cancel_on_button_release

        # ON_DIMMER/TOGGLE_DIMMER action
        self.__dimmer_light_value = dimmer_light_value
        self.__master_dimmer_id = master_dimmer_id

    @property
    def id(self) -> int:
        return self.__id

    @property
    def trigger_id(self) -> int:
        return self.__trigger_id

    @property
    def action_type(self) -> int:
        return self.__action_type

    @property
    def notification_ids(self) -> List[int]:
        return self.__notification_ids

    @property
    def delay(self) -> int:
        return self.__delay

    @property
    def output_pin_ids(self) -> List[int]:
        return self.__output_pin_ids

    @property
    def timer(self) -> int:
        return self.__timer

    @property
    def condition_id(self) -> Optional[int]:
        return self.__condition_id

    @property
    def master_id(self) -> Optional[int]:
        return self.__master_id

    @property
    def click_number(self) -> int:
        return self.__click_number

    @property
    def dimmer_speed(self) -> Optional[int]:
        return self.__dimmer_speed

    @property
    def cancel_on_button_release(self) -> Optional[bool]:
        return self.__cancel_on_button_release

    @property
    def dimmer_light_value(self) -> Optional[int]:
        return self.__dimmer_light_value

    @property
    def master_dimmer_id(self) -> Optional[int]:
        return self.__master_dimmer_id

class Trigger:
    def __init__(self, id: int, trigger_type: int, seconds_down: Optional[int]):
        self.__id = id
        self.trigger_type = trigger_type
        self.seconds_down = seconds_down

    @property
    def id(self) -> int:
        return self.__id

class Condition:
    def __init__(self, id: int, type: int, operator: Optional[int], condition_ids: Optional[List[int]],
                 output_pin_id: Optional[int], status: Optional[bool], from_time: Optional[time],
                 to_time: Optional[time]):
        self.__id = id
        self.type = type
        self.to_time = to_time
        self.from_time = from_time
        self.status = status
        self.output_pin_id = output_pin_id
        self.condition_ids = condition_ids
        self.operator = operator

    @property
    def id(self) -> int:
        return self.__id

class Notification:
    def __init__(self, id: int, message: str, notification_type: int, enabled: bool, subject: Optional[str],
                 mail_address: List[str], tokens: List[str]):
        self.__id = id
        self.notification_type = notification_type
        self.message = message
        self.enabled = enabled
        self.subject = subject
        self.emails = mail_address
        self.tokens = tokens

    @property
    def id(self) -> int:
        return self.__id


text:
define(['content.models.AbstractContent', 'jsclass'], function (AbstractContent) {

    'use strict';

    var Content = new JS.Class(AbstractContent, {

        /**
         * Initialize Content
         *
         * @param {Object} config
         */
        initialize: function (config) {
            this.callSuper(config);
        },

        getElements: function () {
            return;
        }
    });

    return Content;
});


text:
void ofApp::setup()
{
    ofSetWindowShape(ofGetScreenWidth(), 200);
    ofSetWindowPosition(0, 20);

    watcher.registerAllEvents(this);

    std::string folderToWatch = ofToDataPath("", true);
    bool listExistingItemsOnStart = true;

    watcher.addPath(folderToWatch, listExistingItemsOnStart, &fileFilter);

}

void ofApp::draw()
{
    ofBackground(0);
    ofFill();

    int y = TXT_HEIGHT;

    for (std::size_t i = 0; i < messages.size(); ++i)
    {
        ofSetColor(ofMap(i, 0, messages.size(), 255, 90));
        ofDrawBitmapString(messages[i], 10, y);
        y += TXT_HEIGHT;
    }
}

void ofApp::gotMessage(ofMessage msg)
{
    int height = ofGetHeight();

    std::size_t numLines = static_cast<std::size_t>(height / TXT_HEIGHT);

    messages.push_front(msg.message);

    while (messages.size() > numLines)
    {
        messages.pop_back();
    }
}


text:
/**
 * @author: nthienan
 */

package agu.thesis2015.security;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;

import agu.thesis2015.domain.User;
import agu.thesis2015.jms.message.Message;
import agu.thesis2015.jms.message.Message.MessageAction;
import agu.thesis2015.jms.message.Message.MessageMethod;
import agu.thesis2015.jms.producer.UserProducer;
import agu.thesis2015.model.RequestData;
import agu.thesis2015.model.Response;
import agu.thesis2015.model.UserDetail;

@Component
public class UserDetailService implements UserDetailsService {

	@Autowired
	private UserProducer producer;

	@Override
	public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
		RequestData requestData = new RequestData();
		requestData.addId(username);
		Message message = new Message(MessageMethod.GET, MessageAction.SECURITY, requestData.toJson());

		User user = null;
		try {
			Response response = producer.sendAndReceive(message);
			user = User.fromJson(response.getResponse().toString());
		} catch (Exception e) {
			return null;
		}
		UserDetail userDetail = new UserDetail(user);
		return userDetail;
	}
}


text:
package com.allesad.habraclient.fragments.posts;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.allesad.habraclient.R;
import com.allesad.habraclient.adapters.posts.FeedPostsPagerAdapter;
import com.allesad.habraclient.components.ViewPagerExtended;
import com.allesad.habraclient.components.widgets.SlidingTabLayout;

/**
 * Created by Allesad on 14.04.2014.
 */
public class PostsContainerFragment extends Fragment {

    //=============================================================
    // Variables
    //=============================================================
    private FeedPostsPagerAdapter mAdapter;

    //=============================================================
    // Fragment lifecycle
    //=============================================================

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mAdapter = new FeedPostsPagerAdapter(getChildFragmentManager());
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.view_pager, container, false);
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        ViewPagerExtended viewPager = (ViewPagerExtended) view.findViewById(R.id.pager);
        SlidingTabLayout slidingTabLayout = (SlidingTabLayout) view.findViewById(R.id.sliding_tabs);

        slidingTabLayout.setDistributeEvenly(true);
        slidingTabLayout.setSelectedIndicatorColors(getResources().getColor(R.color.color_accent));

        viewPager.setAdapter(mAdapter);
        slidingTabLayout.setViewPager(viewPager);
    }
}


text:
package org.graphwalker.java.source;

import org.graphwalker.io.common.ResourceUtils;
import org.json.JSONObject;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.skyscreamer.jsonassert.JSONAssert;

import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;

import static org.graphwalker.java.utils.OccurrencesOfString.occurrencesOfString;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.stringContainsInOrder;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;

/**
 * @author Nils Olsson
 */
public class GenerateTest {

  @Rule
  public TemporaryFolder testFolder = new TemporaryFolder();

  @Test
  public void generate() throws IOException {
    List<String> sources = new CodeGenerator().generate("/org/graphwalker/java/annotation/MyModel.graphml");
    assertThat(sources.size(), is(1));
    assertThat(sources.get(0), containsString("package org.graphwalker.java.annotation;"));
    assertThat(sources.get(0), containsString("edge12"));
    assertThat(sources.get(0), containsString("vertex2"));
    assertThat(sources.get(0), not(containsString("SHARED")));
  }

  @Test
  public void generatePathWithSpace() throws IOException {
    List<String> sources = new CodeGenerator().generate("/org/graphwalker/java/path with space/MyModel.graphml");
    assertThat(sources.size(), is(1));
    assertThat(sources.get(0), containsString("edge12"));
    assertThat(sources.get(0), containsString("vertex2"));
    assertThat(sources.get(0), not(containsString("SHARED")));
    assertThat(sources.get(0), containsString("package org.graphwalker.java.path_with_space;"));
  }

  @Test
  public void generateMultiModelFile() throws IOException {
    List<String> sources = new CodeGenerator().generate("/org/graphwalker/java/test/PetClinic.json");
    assertThat(sources.size(), is(5));

    assertThat(sources.get(0), containsString("public interface FindOwners {"));
    assertThat(sources.get(0), occurrencesOfString("@Vertex()", 3));
    assertThat(sources.get(0), occurrencesOfString("@Edge()", 3));
    assertThat(sources.get(0), stringContainsInOrder(Arrays.asList(
      "void e_AddOwner();",
      "void v_FindOwners();",
      "void e_Search();",
      "void e_FindOwners();",
      "void v_NewOwner();"
    )));

    assertThat(sources.get(1), containsString("public interface NewOwner {"));
    assertThat(sources.get(1), occurrencesOfString("@Vertex()", 3));
    assertThat(sources.get(1), occurrencesOfString("@Edge()", 2));
    assertThat(sources.get(1), stringContainsInOrder(Arrays.asList(
      "void v_OwnerInformation();",
      "void e_CorrectData();",
      "void e_IncorrectData();",
      "void v_IncorrectData();",
      "void v_NewOwner();"
    )));

    assertThat(sources.get(2), containsString("public interface OwnerInformation {"));
    assertThat(sources.get(2), occurrencesOfString("@Vertex()", 5));
    assertThat(sources.get(2), occurrencesOfString("@Edge()", 9));
    assertThat(sources.get(2), stringContainsInOrder(Arrays.asList(
      "void v_OwnerInformation();",
      "void e_UpdatePet();",
      "void v_FindOwners();",
      "void e_EditPet();",
      "void e_AddNewPet();",
      "void e_AddVisit();",
      "void e_FindOwners();",
      "void e_AddPetSuccessfully();",
      "void v_NewPet();",
      "void e_VisitAddedSuccessfully();",
      "void v_NewVisit();",
      "void v_Pet();",
      "void e_AddPetFailed();",
      "void e_VisitAddedFailed();"
    )));

    assertThat(sources.get(3), containsString("public interface PetClinic {"));
    assertThat(sources.get(3), occurrencesOfString("@Vertex()", 3));
    assertThat(sources.get(3), occurrencesOfString("@Edge()", 4));
    assertThat(sources.get(3), stringContainsInOrder(Arrays.asList(
      "void v_FindOwners();",
      "void e_HomePage();",
      "void e_StartBrowser();",
      "void e_Veterinarians();",
      "void e_FindOwners();",
      "void v_HomePage();"
    )));

    assertThat(sources.get(4), containsString("public interface Veterinarians {"));
    assertThat(sources.get(4), occurrencesOfString("@Vertex()", 2));
    assertThat(sources.get(4), occurrencesOfString("@Edge()", 1));
    assertThat(sources.get(4), stringContainsInOrder(Arrays.asList(
      "void e_Search();",
      "void v_SearchResult();",
      "void v_Veterinarians();"
    )));
  }

  static String readFile(Path path, Charset encoding)
    throws IOException {
    byte[] encoded = Files.readAllBytes(path);
    return new String(encoded, encoding);
  }

  @Test
  public void generateAndWriteFromGraphml() throws IOException {
    Path tmpFolder = testFolder.getRoot().toPath();

    new CodeGenerator().generate(
      ResourceUtils.getResourceAsFile("/CodeGenerator/graphml/").toPath(), tmpFolder
    );

    File cacheFile = new File(tmpFolder + "/cache.json");
    String jsonString = readFile(cacheFile.toPath(), StandardCharsets.UTF_8);

    // If test runs on windows, replace all double back slashes with single forward slash
    jsonString = jsonString.replaceAll("\\\\+", "/");

    jsonString = jsonString.replaceFirst(
      "\\{.*/CodeGenerator/graphml/org/graphwalker/java/graphml/MyModel\\.graphml",
      "{\"CodeGenerator/graphml/org/graphwalker/java/graphml/MyModel.graphml"
    );
    jsonString = jsonString.replaceFirst(
      "\"modified\":[0-9]+,",
      "\"modified\":123123123,"
    );
    JSONObject data = new JSONObject(jsonString);

    String expected = "{\"CodeGenerator/graphml/org/graphwalker/java/graphml/MyModel.graphml\":{modified:123123123,generated:true}}";
    JSONAssert.assertEquals(expected, data, false);

    File sourceFile = new File(tmpFolder + "/org/graphwalker/java/graphml/MyModel.java");
    assertThat(sourceFile.exists(), is(true));

    String content = readFile(sourceFile.toPath(), StandardCharsets.UTF_8);
    assertThat(content, equalTo(
      "// Generated by GraphWalker (http://www.graphwalker.org)\n" +
        "package org.graphwalker.java.graphml;\n" +
        "\n" +
        "import org.graphwalker.java.annotation.Model;\n" +
        "import org.graphwalker.java.annotation.Vertex;\n" +
        "import org.graphwalker.java.annotation.Edge;\n" +
        "\n" +
        "@Model(file = \"org/graphwalker/java/graphml/MyModel.graphml\")\n" +
        "public interface MyModel {\n" +
        "\n" +
        "    @Edge()\n" +
        "    void edge12();\n" +
        "\n" +
        "    @Vertex()\n" +
        "    void vertex1();\n" +
        "\n" +
        "    @Vertex()\n" +
        "    void vertex2();\n" +
        "}\n"
    ));
  }

  @Test
  public void incorrectGraphml() throws IOException {
    Path tmpFolder = testFolder.getRoot().toPath();

    new CodeGenerator().generate(
      ResourceUtils.getResourceAsFile("/CodeGenerator/incorrect_graphml/").toPath(), tmpFolder
    );

    File cacheFile = new File(tmpFolder + "/cache.json");
    String jsonString = readFile(cacheFile.toPath(), StandardCharsets.UTF_8);

    // If test runs on windows, replace all double back slashes with single forward slash
    jsonString = jsonString.replaceAll("\\\\+", "/");

    jsonString = jsonString.replaceFirst(
      "\\{.*/CodeGenerator/incorrect_graphml/org/graphwalker/java/graphml/MyModel\\.graphml",
      "{\"CodeGenerator/incorrect_graphml/org/graphwalker/java/graphml/MyModel.graphml"
    );
    jsonString = jsonString.replaceFirst(
      "\"modified\":[0-9]+,",
      "\"modified\":123123123,"
    );
    JSONObject data = new JSONObject(jsonString);

    String expected = "{\"CodeGenerator/incorrect_graphml/org/graphwalker/java/graphml/MyModel.graphml\":{modified:123123123,generated:false}}";
    JSONAssert.assertEquals(expected, data, false);

    File sourceDir = new File(tmpFolder + "/org");
    assertThat(sourceDir.exists(), is(false));

    File sourceFile = new File(tmpFolder + "/org/graphwalker/java/graphml/MyModel.java");
    assertThat(sourceFile.exists(), is(false));
  }
}


text:
<?php

namespace Mero\Monolog\Handler\Factory;

use Monolog\Logger;
use yii\db\Connection;

class YiiDbFactoryTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @expectedException \Mero\Monolog\Exception\ParameterNotFoundException
     */
    public function testParameterNotFound()
    {
        new YiiDbFactory([
            'type' => 'yii_db',
            'level' => Logger::DEBUG,
        ]);
    }

    public function testCreateHandler()
    {
        $factory = $this
            ->getMockBuilder(YiiDbFactory::className())
            ->disableOriginalConstructor()
            ->setMethods(['getYiiConnection'])
            ->getMock();

        $yiiConn = $this
            ->getMockBuilder(Connection::className())
            ->disableOriginalConstructor()
            ->getMock();

        $factory
            ->expects($this->once())
            ->method('getYiiConnection')
            ->willReturn($yiiConn);

        $reflection = new \ReflectionClass(YiiDbFactory::className());
        $constructor = $reflection->getConstructor();
        $constructor->invoke(
            $factory,
            ['reference' => 'db']
        );

        $method = $reflection->getMethod('createHandler');
        $method->invoke($factory);
    }
}


text:
class CreateCards < ActiveRecord::Migration
  def change
    create_table :cards do |t|
      t.references :member
      t.integer :academic_year
      t.integer :number
      t.string :status, :default => "unpaid"
      t.boolean :valid, :default => false

      t.timestamps
    end
  end
end


text:
layout:     post
title:      Tralfamadore
date:       2016-11-14 08:40:00
summary:    Experiências musicais
categories: Música
---

Embora já tenha uns tempos, aqui está Tralfamadore.

Tralfamadore by João Reis


text:
use strict;
use warnings;

use FindBin;

use lib $FindBin::Bin;

use HelloWorld;

# CouchDB local.ini:
#
#   [external]
#   hello = /path/to/helloWorld.pl
#
#   [httpd_db_handlers]
#   _hello = {couch_httpd_external, handle_external_req, <<"hello">>}
#
# Then go to the url, where "database" is one of your databases:
#
#   http://yourserver/database/_hello/hello_world
#
# And even:
#
#   http://yourserver/database/_hello/hello_world?greeting_target=Dude

HelloWorld->new->run;


text:
'use strict';
var winston = require('winston');

module.exports = {
    up: function (queryInterface, Sequelize) {
        return queryInterface.removeColumn('vod', 'category_id').catch(function (err) {
            winston.error('Dropping column vod.category_id failed with error message: ', err.message);
        });
    }
};


text:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { UpgradeModule } from '@angular/upgrade/static';

import { HttpModule } from '@angular/http';
import { Phone } from './core/phone/phone.service';

import { FormsModule } from '@angular/forms';
import { PhoneListComponent } from './phone-list/phone-list.component';

@NgModule({
  imports: [
    BrowserModule,
    UpgradeModule,
    HttpModule,
    FormsModule,
  ],
  declarations: [
    PhoneListComponent,
  ],
  entryComponents: [
    PhoneListComponent,
  ],
  providers: [
    Phone,
  ]
})
export class AppModule {
  ngDoBootstrap() { }
}


text:
export default {
  lang: 'ga',
  dir: 'ltr',
  common: {
    ok: 'Sábháil',
    cancel: 'Cealaigh',
    key_backspace: 'backspace',
    key_del: 'delete',
    key_down: 'down',
    key_up: 'up',
    more_opts: 'More Options',
    url: 'URL',
    width: 'Width',
    height: 'Height'
  },
  misc: {
    powered_by: 'Powered by'
  },
  ui: {
    toggle_stroke_tools: 'Show/hide more stroke tools',
    palette_info: 'Cliceáil chun athrú a líonadh dath, aistriú-cliceáil chun dath a athrú stróc',
    zoom_level: 'Athraigh súmáil leibhéal',
    panel_action: 'Click to open side panel',
    quality: 'Quality:',
    pathNodeTooltip: 'Drag node to move it. Double-click node to change segment type',
    pathCtrlPtTooltip: 'Drag control point to adjust curve properties',
    pick_stroke_paint_opacity: 'Pick a Stroke Paint and Opacity',
    pick_fill_paint_opacity: 'Pick a Fill Paint and Opacity',
    group_identify_label: 'Group identification label',
    export_type_label: 'Select an image type for export:'
  },
  properties: {
    id: 'Identify the element',
    fill_color: 'Athraigh an dath a líonadh',
    stroke_color: 'Dath stróc Athrú',
    stroke_style: 'Athraigh an stíl Fleasc stróc',
    stroke_width: 'Leithead stróc Athrú',
    pos_x: 'Change X coordinate',
    pos_y: 'Change Y coordinate',
    linecap_butt: 'Linecap: Butt',
    linecap_round: 'Linecap: Round',
    linecap_square: 'Linecap: Square',
    linejoin_bevel: 'Linejoin: Bevel',
    linejoin_miter: 'Linejoin: Miter',
    linejoin_round: 'Linejoin: Round',
    angle: 'Uillinn rothlaithe Athrú',
    blur: 'Change gaussian blur value',
    opacity: 'Athraigh roghnaithe teimhneacht mír',
    circle_cx: 'Athraigh an ciorcal a chomhordú CX',
    circle_cy: 'Athraigh an ciorcal a chomhordú ga',
    circle_r: 'Athraigh an ciorcal's ga',
    ellipse_cx: 'Athraigh Éilips's CX a chomhordú',
    ellipse_cy: 'Athraigh an Éilips a chomhordú ga',
    ellipse_rx: 'Éilips Athraigh an gha x',
    ellipse_ry: 'Éilips Athraigh an gha y',
    line_x1: 'Athraigh an líne tosaigh a chomhordú x',
    line_x2: 'Athraigh an líne deireadh x chomhordú',
    line_y1: 'Athraigh an líne tosaigh a chomhordú y',
    line_y2: 'Athrú ar líne deireadh y chomhordú',
    rect_height: 'Airde dronuilleog Athrú',
    rect_width: 'Leithead dronuilleog Athrú',
    corner_radius: 'Athraigh Dronuilleog Cúinne na Ga',
    image_width: 'Leithead íomhá Athrú',
    image_height: 'Airde íomhá Athrú',
    image_url: 'Athraigh an URL',
    node_x: "Change node's x coordinate",
    node_y: "Change node's y coordinate",
    seg_type: 'Change Segment type',
    straight_segments: 'Straight',
    curve_segments: 'Curve',
    text_contents: 'Inneachar Athraigh téacs',
    font_family_label: 'Font:',
    font_family: 'Athraigh an Cló Teaghlaigh',
    font_size: 'Athraigh Clómhéid',
    bold: 'Trom Téacs',
    text_decoration_underline: 'Underline',
    text_decoration_linethrough: 'Line-Through',
    text_decoration_overline: 'Overline',
    italic: 'Iodálach Téacs',
    text_anchor_start: 'Align the text in start',
    text_anchor_middle: 'Align the text in middle',
    text_anchor_end: 'Align the text in end',
    text_letter_spacing: 'Change the letter spacing',
    text_word_spacing: 'Change the word spacing',
    text_length: 'Lets you specify the width of the space into which the text will draw',
    text_length_adjust: 'Length adjust',
    text_length_adjust_spacing: 'Spacing',
    text_length_adjust_spacing_and_glyphs: 'Spacing & Glyphs',
    class: 'Element class',
    serif: 'Serif',
    sans_serif: 'Sans-serif',
    cursive: 'Cursive',
    fantasy: 'Fantasy',
    monospace: 'Monospace',
    courier: 'Courier',
    helvetica: 'Helvetica',
    times: 'times',
    prefs_and_content: 'Store preferences and SVG content locally',
    prefs_only: 'Only store preferences locally',
    no_prefs_or_content: 'Do not store my preferences or SVG content locally',
    jgraduate_pad: 'Pad',
    jgraduate_reflect: 'Reflect',
    jgraduate_repeat: 'Repeat'
  },
  tools: {
    main_menu: 'Main Menu',
    bkgnd_color_opac: 'Dath cúlra Athraigh / teimhneacht',
    connector_no_arrow: 'No arrow',
    fitToContent: 'Fit to Content',
    fit_to_all: 'Laghdaigh do gach ábhar',
    fit_to_canvas: 'Laghdaigh ar chanbhás',
    fit_to_layer_content: 'Laghdaigh shraith ábhar a',
    fit_to_sel: 'Laghdaigh a roghnú',
    align_relative_to: 'Ailínigh i gcomparáid leis ...',
    relativeTo: 'i gcomparáid leis:',
    page: 'leathanach',
    largest_object: 'réad is mó',
    selected_objects: 'réada tofa',
    smallest_object: 'lú réad',
    new_doc: 'Íomhá Nua',
    open_doc: 'Íomhá Oscailte',
    export_img: 'Export',
    save_doc: 'Sábháil Íomhá',
    import_doc: 'Import SVG',
    align_to_page: 'Align Element to Page',
    align_bottom: 'Cineál Bun',
    align_center: 'Ailínigh sa Lár',
    align_left: 'Ailínigh ar Chlé',
    align_middle: 'Cineál Middle',
    align_right: 'Ailínigh ar Dheis',
    align_top: 'Cineál Barr',
    mode_select: 'Roghnaigh Uirlis',
    mode_fhpath: 'Phionsail Uirlis',
    mode_line: 'Uirlis Líne',
    mode_rect: 'Rectangle Tool',
    mode_square: 'Square Tool',
    mode_fhrect: 'Saor Hand Dronuilleog',
    mode_ellipse: 'Éilips',
    mode_circle: 'Ciorcal',
    mode_fhellipse: 'Free-Hand Ellipse',
    mode_path: 'Path Tool',
    mode_text: 'Téacs Uirlis',
    mode_image: 'Íomhá Uirlis',
    mode_zoom: 'Zúmáil Uirlis',
    no_embed: 'NOTE: This image cannot be embedded. It will depend on this path to be displayed',
    undo: 'Cealaigh',
    redo: 'Athdhéan',
    tool_source: 'Cuir Foinse',
    wireframe_mode: 'Wireframe Mode',
    clone: 'Clone Element(s)',
    del: 'Delete Element(s)',
    group_elements: 'Eilimintí Grúpa',
    make_link: 'Make (hyper)link',
    set_link_url: 'Set link URL (leave empty to remove)',
    to_path: 'Convert to Path',
    reorient_path: 'Reorient path',
    ungroup: 'Eilimintí Díghrúpáil',
    docprops: 'Doiciméad Airíonna',
    editor_homepage: 'SVG-Edit Home Page',
    move_bottom: 'Téigh go Bun',
    move_top: 'Téigh go Barr',
    node_clone: 'Clone Node',
    node_delete: 'Delete Node',
    node_link: 'Link Control Points',
    add_subpath: 'Add sub-path',
    openclose_path: 'Open/close sub-path',
    source_save: 'Sábháil',
    cut: 'Cut',
    copy: 'Copy',
    paste: 'Paste',
    paste_in_place: 'Paste in Place',
    delete: 'Delete',
    group: 'Group',
    move_front: 'Bring to Front',
    move_up: 'Bring Forward',
    move_down: 'Send Backward',
    move_back: 'Send to Back',
    tool_unlink_use: 'Break link to reference element (make unique)',
    ellipse_circle_tool: 'Ellipse/Circle Tool',
    square_rect_tool: 'Square/Rect Tool',
    remember_this_choice: 'Remember this choice?',
    remember_this_choice_title: 'If you choose to opt out of storage while remembering this choice, the URL will change so as to avoid asking again.'
  },
  layers: {
    layer: 'Layer',
    layers: 'Layers',
    del: 'Scrios Sraith',
    move_down: 'Bog Sraith Síos',
    new: 'Sraith Nua',
    rename: 'Athainmnigh Sraith',
    move_up: 'Bog Sraith Suas',
    dupe: 'Duplicate Layer',
    merge_down: 'Merge Down',
    merge_all: 'Merge All',
    move_elems_to: 'Move elements to:',
    move_selected: 'Move selected elements to a different layer'
  },
  config: {
    image_props: 'Image Properties',
    doc_title: 'Title',
    doc_dims: 'Canvas Dimensions',
    included_images: 'Included Images',
    image_opt_embed: 'Embed data (local files)',
    image_opt_ref: 'Use file reference',
    editor_prefs: 'Editor Preferences',
    language: 'Language',
    background: 'Editor Background',
    editor_img_url: 'Image URL',
    editor_bg_note: 'Note: Background will not be saved with image.',
    select_predefined: 'Roghnaigh réamhshainithe:',
    units_and_rulers: 'Units & Rulers',
    show_rulers: 'Show rulers',
    base_unit: 'Base Unit:',
    grid: 'Grid',
    snapping_onoff: 'Snapping on/off',
    snapping_stepsize: 'Snapping Step-Size:',
    grid_color: 'Grid color',
    done: 'Done',
    change_xxx_color: 'Change xxx color',
    pick_paint_opavity: 'Pick a {{newValue}} Paint and Opacity',
    open_color_picker: 'Click To Open Color Picker',
    jpicker_title: 'Drag Markers To Pick A Color',
    jpicker_new_color: 'new',
    jpicker_current_color: 'current',
    jpicker_tooltip_colors_new_color: 'New Color - Press "OK" To Commit',
    jpicker_tooltip_colors_current_color: 'Click To Revert To Original Color',
    jpicker_tooltip_buttons_ok: 'Commit To This Color Selection',
    jpicker_tooltip_buttons_cancel: 'Cancel And Revert To Original Color',
    jpicker_tooltip_hue_radio: 'Set To "Hue" Color Mode',
    jpicker_tooltip_hue_textbox: 'Enter A "Hue" Value (0-360°)',
    jpicker_tooltip_saturation_radio: 'Set To "Saturation" Color Mode',
    jpicker_tooltip_saturation_textbox: 'Enter A "Saturation" Value (0-100%)',
    jpicker_tooltip_value_radio: 'Set To "Value" Color Mode',
    jpicker_tooltip_value_textbox: 'Enter A "Value" Value (0-100%)',
    jpicker_tooltip_red_radio: 'Set To "Red" Color Mode',
    jpicker_tooltip_red_textbox: 'Enter A "Red" Value (0-255)',
    jpicker_tooltip_green_radio: 'Set To "Green" Color Mode',
    jpicker_tooltip_green_textbox: 'Enter A "Green" Value (0-255)',
    jpicker_tooltip_blue_radio: 'Set To "Blue" Color Mode',
    jpicker_tooltip_blue_textbox: 'Enter A "Blue" Value (0-255)',
    jpicker_tooltip_alpha_radio: 'Set To "Alpha" Color Mode',
    jpicker_tooltip_alpha_textbox: 'Enter A "Alpha" Value (0-100)',
    jpicker_tooltip_hex_textbox: 'Enter A "Hex" Color Value (#000000-#ffffff)',
    jpicker_tooltip_hex_alpha: 'Enter A "Alpha" Value (#00-#ff)',
    jgraduate_solid_color: 'Solid Color',
    jgraduate_linear_gradient: 'Linear Gradient',
    jgraduate_radial_gradient: 'Radial Gradient',
    jgraduate_begin_point: 'Begin Point',
    jgraduate_enter_starting_x: 'Enter starting x value between 0.0 and 1.0',
    jgraduate_enter_starting_y: 'Enter starting y value between 0.0 and 1.0',
    jgraduate_end_point: 'End Point',
    jgraduate_enter_ending_x: 'Enter ending x value between 0.0 and 1.0',
    jgraduate_enter_ending_y: 'Enter ending y value between 0.0 and 1.0',
    jgraduate_center_point: 'Center Point',
    jgraduate_enter_value_x: 'Enter x value between 0.0 and 1.0',
    jgraduate_enter_value_y: 'Enter y value between 0.0 and 1.0',
    jgraduate_focal_point: 'Focal Point',
    jgraduate_match_center: 'Match center:',
    jgraduate_enter_focal_x: 'Enter x value between 0.0 and 1.0',
    jgraduate_enter_focal_y: 'Enter y value between 0.0 and 1.0',
    jgraduate_spread_method: 'Spread method',
    jgraduate_radius: 'Radius:',
    jgraduate_set_radius: 'Click to set radius',
    jgraduate_ellip: 'Ellip:',
    jgraduate_set_ellip: 'Click to set Ellip',
    jgraduate_angle: 'Angle:',
    jgraduate_set_angle: 'Click to set Angle',
    jgraduate_deg: 'deg:',
    jgraduate_opac: 'Opac:',
    jgraduate_set_opac: 'Click to set Opac'
  },
  notification: {
    invalidAttrValGiven: 'Invalid value given',
    noContentToFitTo: 'No content to fit to',
    dupeLayerName: 'There is already a layer named that!',
    enterUniqueLayerName: 'Please enter a unique layer name',
    enterNewLayerName: 'Please enter the new layer name',
    layerHasThatName: 'Layer already has that name',
    QmoveElemsToLayer: "Move selected elements to layer '%s'?",
    QwantToClear: 'Do you want to clear the drawing?\nThis will also erase your undo history!',
    QwantToOpen: 'Do you want to open a new file?\nThis will also erase your undo history!',
    QerrorsRevertToSource: 'There were parsing errors in your SVG source.\nRevert back to original SVG source?',
    QignoreSourceChanges: 'Ignore changes made to SVG source?',
    featNotSupported: 'Feature not supported',
    enterNewImgURL: 'Enter the new image URL',
    defsFailOnSave: 'NOTE: Due to a bug in your browser, this image may appear wrong (missing gradients or elements). It will however appear correct once actually saved.',
    loadingImage: 'Loading image, please wait...',
    saveFromBrowser: "Select 'Save As...' in your browser (possibly via file menu or right-click context-menu) to save this image as a {{type}} file.",
    noteTheseIssues: 'Also note the following issues: ',
    unsavedChanges: 'There are unsaved changes.',
    enterNewLinkURL: 'Enter the new hyperlink URL',
    errorLoadingSVG: 'Error: Unable to load SVG data',
    URLLoadFail: 'Unable to load from URL',
    retrieving: 'Retrieving \'%s\' ...',
    popupWindowBlocked: 'Popup window may be blocked by browser',
    exportNoBlur: 'Blurred elements will appear as un-blurred',
    exportNoforeignObject: 'foreignObject elements will not appear',
    exportNoDashArray: 'Strokes will appear filled',
    exportNoText: 'Text may not appear as expected',
    editorPreferencesMsg: 'By default and where supported, SVG-Edit can store your editor preferences and SVG content locally on your machine so you do not need to add these back each time you load SVG-Edit. If, for privacy reasons, you do not wish to store this information on your machine, you can change away from the default option below.',
    source_dialog_note: 'Copy the contents of this box into a text editor, then save the file with a .svg extension.'
  }
}


text:
// This file is automatically generated.

package adila.db;

/*
 * Hisense LED40L288
 *
 * DEVICE: mt5880
 * MODEL: LED40L288
 */
final class mt5880_led40l288 {
    public static final String DATA = "Hisense|LED40L288|";
}


text:
package org.apache.geode.test.compiler;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.catchThrowable;

import java.util.List;

import org.junit.Test;

public class InMemoryJavaCompilerTest {
  private final InMemoryJavaCompiler compiler = new InMemoryJavaCompiler();

  @Test
  public void compileSingleClass() {
    String sourceCode = "package test.pkg;"
        + "public class MyClassName {}";

    List<InMemoryClassFile> classFiles = compiler.compile(sourceCode);

    assertThat(classFiles)
        .extracting(InMemoryClassFile::getName)
        .containsExactly("test.pkg.MyClassName");
  }

  @Test
  public void compileTwoDependentClasses() {
    String baseClassSourceCode = "package test.pkg;"
        + "public class BaseClass {}";
    String derivedClassSourceCode = "package test.pkg;"
        + "public class DerivedClass extends BaseClass {}";

    List<InMemoryClassFile> classFiles =
        compiler.compile(derivedClassSourceCode, baseClassSourceCode);

    assertThat(classFiles)
        .extracting(InMemoryClassFile::getName)
        .containsExactlyInAnyOrder("test.pkg.BaseClass", "test.pkg.DerivedClass");
  }

  @Test
  public void invalidSourceThrowsException() {
    String invalidSourceCode = ("public class foo {this is not valid java source code}");
    Throwable thrown = catchThrowable(() -> compiler.compile(invalidSourceCode));
    assertThat(thrown)
        .hasMessageContaining(invalidSourceCode);
  }
}


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

<title>Uses of Package com.esotericsoftware.kryonet.rmi</title>
<meta name="date" content="2013-11-12">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Package
com.esotericsoftware.kryonet.rmi

Packages that use com.esotericsoftware.kryonet.rmi

Package
Description

com.esotericsoftware.kryonet.rmi

Classes in com.esotericsoftware.kryonet.rmi used by com.esotericsoftware.kryonet.rmi

Class and Description

RemoteObject

Provides access to various settings on a remote object.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
<?php

	// General Constants Configuration
	/** DEFINED IN MAIN CONFIG FILE **/
	//define('DEFAULT_CONTROLLER', 'home');									// Default Controller Name
	/** DEFINED IN MAIN CONFIG FILE **/
	//define('DEFAULT_ACTION', 'index');									// Default Action Name
	define('METANAME_SEPARATOR', '.');										// Meta name separator

	// Model Constants Configuration
	define('MODEL_DIRECTORY', MVC_DIRECTORY . DS . 'models');				// Models Directory Location
	define('MODEL_FILE_PREFIX', 'model' . METANAME_SEPARATOR);				// Models File Prefix
	define('MODEL_FILE_EXTENSION', '.php');									// Models File Extension
	define('MODEL_CLASS_SUFFIX', 'Model');									// Model Class Suffix

	// Views Constants Configuration
	define('VIEW_DIRECTORY', MVC_DIRECTORY . DS . 'views');					// Views Directory Location
	define('VIEW_FILE_PREFIX', 'view' . METANAME_SEPARATOR);				// Views File Prefix
	define('VIEW_FILE_EXTENSION', '.php');									// Views File Extension

	// Controllers Constants Configuration
	define('CONTROLLER_DIRECTORY', MVC_DIRECTORY . DS . 'controllers');		// Controllers Directory Location
	define('CONTROLLER_FILE_PREFIX', 'controller' . METANAME_SEPARATOR);	// Controllers File Prefix
	define('CONTROLLER_FILE_EXTENSION', '.php');							// Controllers File Extension
	define('CONTROLLER_CLASS_SUFFIX', 'Controller');						// Controllers Class Suffix
	define('ERROR_CONTROLLER', 'error');									// Error Controller Name

	// Default Layout (View Templates) Configuration
	$template['main'] = VIEW_DIRECTORY . DS . 'shared' . DS . VIEW_FILE_PREFIX . 'shared' . METANAME_SEPARATOR . 'main' . VIEW_FILE_EXTENSION;		// Main Layout Location


text:
<?php
namespace Aspose\Email\ProgrammingOutlook\WorkingWithOutlookPersonalStorage;

use com\aspose\email\MapiContact as MapiContact;
use com\aspose\email\MapiContactNamePropertySet as MapiContactNamePropertySet;
use com\aspose\email\MapiContactGender as MapiContactGender;
use com\aspose\email\MapiContactProfessionalPropertySet as MapiContactProfessionalPropertySet;
use com\aspose\email\MapiContactElectronicAddress as MapiContactElectronicAddress;
use com\aspose\email\MapiContactTelephonePropertySet as MapiContactTelephonePropertySet;
use com\aspose\email\PersonalStorage as PersonalStorage;
use com\aspose\email\FileFormatVersion as FileFormatVersion;
use com\aspose\email\StandardIpmFolder as StandardIpmFolder;

class AddMapiContactToPST{

    public static function run($dataDir=null){

        # Create an instance of MapiContact
        $mapi_contact = new MapiContact();

        # Contact #1
        $contact1 = new MapiContact("Sebastian Wright", "SebastianWright@dayrep.com");

        # Contact #2
        $contact2 = new MapiContact("Wichert Kroos", "WichertKroos@teleworm.us", "Grade A Investment");

        # Contact #3
        $contact3 = new MapiContact("Christoffer van de Meeberg", "ChristoffervandeMeeberg@teleworm.us", "Krauses Sofa Factory", "046-630-4614");

        # Contact #4
        $contact4 = new MapiContact();
        $contact4->setNameInfo(new MapiContactNamePropertySet("Margaret", "J.", "Tolle"));

        $mapiContactGender=new MapiContactGender();

        $contact4->getPersonalInfo()->setGender($mapiContactGender->Female);
        $contact4->setProfessionalInfo(new MapiContactProfessionalPropertySet("Adaptaz", "Recording engineer"));
        $contact4->getPhysicalAddresses()->getWorkAddress()->setAddress("4 Darwinia Loop EIGHTY MILE BEACH WA 6725");
        $contact4->getElectronicAddresses()->setEmail1(new MapiContactElectronicAddress("Hisen1988", "SMTP", "MargaretJTolle@dayrep.com"));
        $contact4->getTelephones()->setBusinessTelephoneNumber("(08)9080-1183");
        $contact4->getTelephones()->setMobileTelephoneNumber("(925)599-3355");

        # Contact #5
        $contact5 = new MapiContact();
        $contact5->setNameInfo(new MapiContactNamePropertySet("Matthew", "R.", "Wilcox"));
        $contact5->getPersonalInfo()->setGender($mapiContactGender->Male);
        $contact5->setProfessionalInfo(new MapiContactProfessionalPropertySet("Briazz", "Psychiatric aide"));
        $contact5->getPhysicalAddresses()->getWorkAddress()->setAddress("Horner Strasse 12 4421 SAASS");
        $contact5->getTelephones()->setBusinessTelephoneNumber("0650 675 73 30");
        $contact5->getTelephones()->setHomeTelephoneNumber("(661)387-5382");

        # Contact #6
        $contact6 = new MapiContact();
        $contact6->setNameInfo(new MapiContactNamePropertySet("Bertha", "A.", "Buell"));
        $contact6->setProfessionalInfo(new MapiContactProfessionalPropertySet("Awthentikz", "Social work assistant"));
        $contact6->getPersonalInfo()->setPersonalHomePage("B2BTies.com");
        $contact6->getPhysicalAddresses()->getWorkAddress()->setAddress("Im Astenfeld 59 8580 EDELSCHROTT");
        $contact6->getElectronicAddresses()->setEmail1(new MapiContactElectronicAddress("Experwas", "SMTP", "BerthaABuell@armyspy.com"));
        $contact6->setTelephones(new MapiContactTelephonePropertySet("06605045265"));

        $personalStorage=new PersonalStorage();
        $fileFormatVersion=new FileFormatVersion();
        $standardIpmFolder=new StandardIpmFolder();

        $pst = $personalStorage->create($dataDir . "MapiContactToPST1.pst", $fileFormatVersion->Unicode);
        $contactFolder = $pst->createPredefinedFolder("Contacts", $standardIpmFolder->Contacts);
        $contactFolder->addMapiMessageItem($contact1);
        $contactFolder->addMapiMessageItem($contact2);
        $contactFolder->addMapiMessageItem($contact3);
        $contactFolder->addMapiMessageItem($contact4);
        $contactFolder->addMapiMessageItem($contact5);
        $contactFolder->addMapiMessageItem($contact6);

        print "Added MapiContacts Successfully.".PHP_EOL;
    }
}
?>


text:
namespace ark {
namespace plugin {
namespace cmft {

namespace {

struct OpenCLContext {
    OpenCLContext() {
        int ec = ::cmft::clLoad();
        WARN(ec != 0, "Loading OpenCL contexting failed.");
        if(ec != 0)
            cl_context = ::cmft::clInit();
    }
    ~OpenCLContext() {
        ::cmft::clDestroy(cl_context);
        ::cmft::clUnload();
    }

    ::cmft::ClContext* cl_context;
};

}

RadianceCubemapUploader::RadianceCubemapUploader(sp<Bitmap> bitmap, sp<Size> size)
    : _bitmap(std::move(bitmap)), _size(std::move(size))
{
}

void RadianceCubemapUploader::initialize(GraphicsContext& graphicsContext, Texture::Delegate& delegate) {
    DCHECK(_size->width() == _size->height(), "Cubemap should be square, but (%.2f, %.2f) provided", _size->width(), _size->height());
    DCHECK(delegate.type() == Texture::TYPE_CUBEMAP, "This uploader uploads bitmaps to a cubmap, not Texture::Type(%d)", delegate.type());

    ::cmft::Image input;
    ::cmft::imageConvert(input, ::cmft::TextureFormat::RGBA32F, CMFTUtil::bitmapToImage(_bitmap));

    uint32_t n = static_cast<uint32_t>(_size->width());
    ::cmft::imageResize(input, n * 2, n);

    Bitmap::Util<float>::hflip(reinterpret_cast<float*>(input.m_data), n * 2, n, 4);
    ::cmft::imageToCubemap(input);

    ::cmft::Image output;
    ::cmft::imageCreate(output, n, n, 0, 1, 6, ::cmft::TextureFormat::RGBA32F);
    ::cmft::imageRadianceFilter(output, n, ::cmft::LightingModel::BlinnBrdf, false, 1, 8, 1, input, ::cmft::EdgeFixup::None, 6, nullptr);

    ::cmft::Image faceList[6];
    ::cmft::imageFaceListFromCubemap(faceList, output);

    const uint32_t imageFaceIndices[6] = {4, 5, 2, 3, 1, 0};

    Bitmap::Util<float>::rotate(reinterpret_cast<float*>(faceList[2].m_data), n, n, 4, 270);
    Bitmap::Util<float>::hvflip(reinterpret_cast<float*>(faceList[3].m_data), n, n, 4);
    Bitmap::Util<float>::hflip(reinterpret_cast<float*>(faceList[3].m_data), n, n, 4);

    const Bitmap uploadingBitmap(n, n, n * 4 * 4, 4, false);
    std::vector<sp<ByteArray>> imagedata;
    for(uint32_t i = 0; i < 6; ++i)
        imagedata.push_back(sp<ByteArray::Borrowed>::make(reinterpret_cast<uint8_t*>(faceList[imageFaceIndices[i]].m_data), faceList[imageFaceIndices[i]].m_dataSize));
    delegate.uploadBitmap(graphicsContext, uploadingBitmap, imagedata);

    ::cmft::imageUnload(input);
    ::cmft::imageUnload(output);
}

RadianceCubemapUploader::BUILDER::BUILDER(BeanFactory& factory, const document& manifest)
    : _bitmap(factory.ensureConcreteClassBuilder<Bitmap>(manifest, Constants::Attributes::BITMAP)), _size(factory.ensureConcreteClassBuilder<Size>(manifest, Constants::Attributes::SIZE))
{
}

sp<Texture::Uploader> RadianceCubemapUploader::BUILDER::build(const Scope& args)
{
    return sp<RadianceCubemapUploader>::make(_bitmap->build(args), _size->build(args));
}

}
}
}


text:
register({
  name: 'Join',
  description: 'Join lines with delimiter.',
  fields: [
    {
      name: "delimiter",
      type: "string"
    },
  ],
  process: function(options, input) {
    return {
      "output": input.split("\n").join(options['delimiter']),
    };
  },
});


text:
FROM bids/base_fsl:5.0.9-3
MAINTAINER Eric Bridgeford <ericwb95@gmail.com>
RUN apt-get update
RUN apt-get install -y zip

RUN apt-get install -y python-dev
RUN wget https://bootstrap.pypa.io/get-pip.py
RUN python get-pip.py

RUN apt-get install -y git libpng-dev libfreetype6-dev pkg-config zlib1g-dev g++ vim

RUN pip install numpy networkx>=1.11 nibabel>=2.0 dipy>=0.1 scipy boto3 matplotlib==1.5.1 plotly==1.12.1 nilearn>=0.2 sklearn>=0.0 pandas

RUN git clone -b eric-dev-gkiar-fmri https://github.com/neurodata/ndmg.git /ndmg && cd /ndmg && python setup.py install

RUN mkdir /ndmg_atlases && cd /ndmg_atlases && wget -rnH --cut-dirs=3 --no-parent -P /ndmg_atlases http://openconnecto.me/mrdata/share/eric_atlases/fmri_atlases.zip && unzip fmri_atlases.zip

RUN pip install boto3
#RUN mkdir ~/.aws
#RUN echo '[default]\nregion=us-east-1' >~/.aws/config

# copy over the entrypoint script
COPY ./startfngs.sh /
ADD ./.vimrc .vimrc

COPY ./testentrypoint.sh /
COPY ./testentrypoint.py /

# and add it as an entrypoint
ENTRYPOINT ["/testentrypoint.sh"]


text:
package com.tle.web.viewitem.largeimageviewer;

import com.tle.beans.item.Item;
import com.tle.common.Pair;
import com.tle.common.PathUtils;
import com.tle.common.URLUtils;
import com.tle.common.filesystem.handle.FileHandle;
import com.tle.common.i18n.CurrentLocale;
import com.tle.core.guice.Bind;
import com.tle.core.i18n.BundleCache;
import com.tle.core.services.FileSystemService;
import com.tle.web.sections.SectionInfo;
import com.tle.web.sections.SectionResult;
import com.tle.web.sections.SectionTree;
import com.tle.web.sections.SectionsRuntimeException;
import com.tle.web.sections.annotations.Bookmarked;
import com.tle.web.sections.annotations.EventFactory;
import com.tle.web.sections.annotations.EventHandlerMethod;
import com.tle.web.sections.annotations.TreeLookup;
import com.tle.web.sections.equella.annotation.PlugKey;
import com.tle.web.sections.equella.component.NavBar;
import com.tle.web.sections.equella.component.NavBarBuilder;
import com.tle.web.sections.events.RenderContext;
import com.tle.web.sections.events.js.EventGenerator;
import com.tle.web.sections.jquery.libraries.JQueryCore;
import com.tle.web.sections.jquery.libraries.JQueryDraggable;
import com.tle.web.sections.jquery.libraries.JQueryDroppable;
import com.tle.web.sections.js.JSCallable;
import com.tle.web.sections.js.generic.expression.ElementIdExpression;
import com.tle.web.sections.js.generic.expression.FunctionCallExpression;
import com.tle.web.sections.js.generic.function.ExternallyDefinedFunction;
import com.tle.web.sections.js.generic.function.ReloadFunction;
import com.tle.web.sections.js.generic.statement.FunctionCallStatement;
import com.tle.web.sections.js.generic.statement.ScriptStatement;
import com.tle.web.sections.render.Label;
import com.tle.web.sections.result.util.BundleLabel;
import com.tle.web.sections.result.util.IconLabel;
import com.tle.web.sections.result.util.IconLabel.Icon;
import com.tle.web.sections.standard.Button;
import com.tle.web.sections.standard.Link;
import com.tle.web.sections.standard.annotations.Component;
import com.tle.web.sections.standard.js.modules.StandardModule;
import com.tle.web.template.Decorations;
import com.tle.web.template.Decorations.FullScreen;
import com.tle.web.template.Decorations.MenuMode;
import com.tle.web.viewable.ViewableItem;
import com.tle.web.viewitem.section.RootItemFileSection;
import com.tle.web.viewitem.viewer.AbstractViewerSection;
import com.tle.web.viewurl.UseViewer;
import com.tle.web.viewurl.ViewAuditEntry;
import com.tle.web.viewurl.ViewItemFilter;
import com.tle.web.viewurl.ViewItemResource;
import com.tle.web.viewurl.ViewItemUrl;
import com.tle.web.viewurl.ViewItemUrlFactory;
import java.io.File;
import java.util.Collection;
import java.util.Collections;
import java.util.Objects;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
import org.apache.log4j.Logger;

@SuppressWarnings("nls")
@Bind
public class LargeImageViewerSection
    extends AbstractViewerSection<LargeImageViewerSection.LargeImageViewerModel>
    implements ViewItemFilter {
  private static final Logger LOGGER = Logger.getLogger(LargeImageViewerSection.class);
  private static final long TIMEOUT = TimeUnit.MINUTES.toMillis(5);
  private static final long RELOAD_INTERVAL = TimeUnit.SECONDS.toMillis(7);
  private static final int[] ROTATION_TO_ANGLE = new int[] {270, 180, 90};

  @PlugKey("livviewer.title")
  private static Label TITLE_LABEL;

  @PlugKey("hideThumb")
  private static String HIDE_THUMB_KEY;

  @PlugKey("showThumb")
  private static String SHOW_THUMB_KEY;

  @Inject private FileSystemService fileSystemService;
  @Inject private LargeImageViewer largeImageViewer;
  @Inject private ViewItemUrlFactory itemUrls;
  @Inject private BundleCache bundleCache;

  @EventFactory private EventGenerator events;
  @Component private Button startButton;
  @TreeLookup private RootItemFileSection rootSection;

  @Inject @Component private NavBar navBar;
  @Component private Link title;

  @Component
  @PlugKey(value = "nav.zoomin", icon = Icon.ZOOM_IN)
  private Link zoomIn;

  @Component
  @PlugKey(value = "nav.zoomout", icon = Icon.ZOOM_OUT)
  private Link zoomOut;

  @Component
  @PlugKey(value = "nav.rotateleft", icon = Icon.ROTATE_LEFT)
  private Link rotateLeft;

  @Component
  @PlugKey(value = "nav.rotateright", icon = Icon.ROTATE_RIGHT)
  private Link rotateRight;

  @Component
  @PlugKey("hideThumb")
  private Link hideThumb;

  @Override
  public String getDefaultPropertyName() {
    return "liv";
  }

  @Override
  public Class<LargeImageViewerModel> getModelClass() {
    return LargeImageViewerModel.class;
  }

  @Override
  public void registered(String id, SectionTree tree) {
    super.registered(id, tree);

    startButton.setClickHandler(events.getNamedHandler("startProcessing"));

    navBar.setTitle(title);
    NavBarBuilder nbb = navBar.buildRight();
    nbb.divider().action(zoomIn).action(zoomOut);
    nbb.divider().action(rotateLeft).action(rotateRight);
    nbb.divider().action(hideThumb);

    // Init the javascript
    JSCallable function =
        new ExternallyDefinedFunction(
            "initializeGraphic", JQueryDraggable.PRERENDER, JQueryDroppable.PRERENDER);
    title.addReadyStatements(
        new ScriptStatement(
            new FunctionCallExpression(
                function,
                new ElementIdExpression(zoomIn),
                new ElementIdExpression(zoomOut),
                new ElementIdExpression(rotateLeft),
                new ElementIdExpression(rotateRight),
                new ElementIdExpression(hideThumb),
                CurrentLocale.get(HIDE_THUMB_KEY),
                CurrentLocale.get(SHOW_THUMB_KEY))));
  }

  public Button getStartButton() {
    return startButton;
  }

  public NavBar getNavBar() {
    return navBar;
  }

  @EventHandlerMethod
  public void startProcessing(SectionInfo info) {
    LargeImageViewerModel model = getModel(info);
    model.setStartProcess(true);
    model.setAutoPageRefresh(false); // this gets changed later
    model.setMethod("view");
  }

  @Override
  public void treeFinished(String id, SectionTree tree) {
    rootSection.addFilterViewer(this);
  }

  @Override
  public ViewItemResource filter(SectionInfo info, ViewItemResource resource) {
    LargeImageViewerModel model = getModel(info);
    String method = model.getMethod();
    if (method == null) {
      return resource;
    }
    if ("tile".equals(method)) {
      int rotation = model.getRotation();
      if (rotation < 1 || rotation > 3) {
        return resource;
      }
    }
    return new UseViewer(resource, this);
  }

  @Override
  public ViewAuditEntry getAuditEntry(SectionInfo info, ViewItemResource resource) {
    LargeImageViewerModel model = getModel(info);
    if (!Objects.equals(model.getMethod(), "tile")) {
      FileHandle tileBaseHandle =
          largeImageViewer.getTileBaseHandle(resource.getViewableItem(), resource.getFilepath());

      if (getTiledImageProperties(info, tileBaseHandle) != null) {
        return resource.getViewAuditEntry();
      }
    }
    return null;
  }

  @Override
  public Collection<String> ensureOnePrivilege() {
    return VIEW_ITEM_AND_VIEW_ATTACHMENTS_PRIV;
  }

  @Override
  public SectionResult view(RenderContext info, ViewItemResource resource) {
    final Decorations decorations = Decorations.getDecorations(info);
    decorations.setFullscreen(FullScreen.YES_WITH_TOOLBAR);
    decorations.setTitle(TITLE_LABEL);

    final LargeImageViewerModel model = getModel(info);
    if (Objects.equals(model.getMethod(), "tile")) {
      decorations.clearAllDecorations();
      return tile(info, resource);
    }

    final ViewableItem<Item> viewableItem = resource.getViewableItem();
    final FileHandle tileBaseHandle =
        largeImageViewer.getTileBaseHandle(viewableItem, resource.getFilepath());

    final File tileBaseFolder = fileSystemService.getExternalFile(tileBaseHandle, null);

    final Properties tiledImageProps = getTiledImageProperties(info, tileBaseHandle);
    if (tiledImageProps != null) {
      decorations.clearAllDecorations();

      // Image has been successfully tiled previously
      model.setTileBaseUri(
          URLUtils.urlEncode(
              viewableItem.getItemdir()
                  + largeImageViewer.getTileBasePath(resource.getFilepath())
                  + '/',
              false));
      model.setJsGeometry(tiledImageProps.getProperty("geometry"));

      final Item item = viewableItem.getItem();
      title.setLabel(
          info,
          new IconLabel(Icon.BACK, new BundleLabel(item.getName(), item.getUuid(), bundleCache)));
      title.setBookmark(
          info,
          itemUrls.createItemUrl(
              info,
              resource.getViewableItem().getItem().getItemId(),
              ViewItemUrl.FLAG_IS_RESOURCE));

      return viewFactory.createTemplateResult("viewimage.ftl", this);
    }

    decorations.setMenuMode(MenuMode.HIDDEN);

    boolean confirmStart = false;

    final long lastModified = fileSystemService.mostRecentModification(tileBaseHandle, null);
    final String error = largeImageViewer.getError(tileBaseFolder);

    if (error == null && lastModified > System.currentTimeMillis() - TIMEOUT) {
      // Tell them it's processing
      setupModelForProcessing(model);
    } else if (model.isStartProcess()) {
      // Start the process
      startTileProcessor(resource, tileBaseHandle);
      setupModelForProcessing(model);
    } else {
      if (error != null) {
        // Ask them if they want to restart the processing
        model.setMessageKey("msg.processcrash");
        model.setStackTrace(error);
        confirmStart = true;
      }
      // Note: isAutoPageRefresh means it's already processing
      else if (lastModified == 0 && !model.isAutoPageRefresh()) {
        // Ask if they want to process the image for the first time
        model.setMessageKey("msg.unprocessed");
        confirmStart = true;
      }
    }

    model.setImageFilePath(resource.getFilepath());
    model.setConfirmStartProcess(confirmStart);

    if (!confirmStart) {
      // append reloading script
      JQueryCore.appendReady(
          info,
          new FunctionCallStatement(
              StandardModule.SET_TIMEOUT, new ReloadFunction(false), RELOAD_INTERVAL));
    }

    return viewFactory.createTemplateResult("imageprocessing.ftl", this);
  }

  public SectionResult tile(SectionInfo info, ViewItemResource resource) {
    LargeImageViewerModel model = getModel(info);

    int rotation = model.getRotation();
    if (rotation < 1 || rotation > 3) {
      info.forwardToUrl(resource.createCanonicalURL().getHref());
      return null;
    }
    int angle = ROTATION_TO_ANGLE[rotation - 1];
    try {
      String filepath = getRotatedFilename(resource.getFilepath(), angle);
      File rotatedFile =
          fileSystemService.getExternalFile(resource.getViewableItem().getFileHandle(), filepath);

      if (!rotatedFile.exists()) {
        // image magick rotate on demand!
        File sourceFile =
            fileSystemService.getExternalFile(
                resource.getViewableItem().getFileHandle(), resource.getFilepath());
        largeImageViewer.rotateImage(sourceFile, rotatedFile, angle);
      }
      info.forwardToUrl(resource.getViewableItem().createStableResourceUrl(filepath).getHref());
    } catch (Exception ex) {
      LOGGER.error("Error rotating tile", ex);
      throw new SectionsRuntimeException(ex);
    }
    return null;
  }

  private String getRotatedFilename(String originalFilename, int angle) {
    Pair<String, String> fileBits = PathUtils.fileParts(originalFilename);
    return fileBits.getFirst() + "_r" + angle + '.' + fileBits.getSecond();
  }

  /**
   * @param tilesFolder
   * @return Can return null if the previous tiling never finised without error (or no tiling has
   *     ever occurred)
   */
  private Properties getTiledImageProperties(SectionInfo info, FileHandle tileBaseHandle) {
    LargeImageViewerModel model = getModel(info);
    Properties tiledImageProperties = model.getTiledImageProperties();
    if (tiledImageProperties == null) {
      tiledImageProperties =
          largeImageViewer.getTileProperties(
              fileSystemService.getExternalFile(tileBaseHandle, null));
      model.setTiledImageProperties(tiledImageProperties);
    }
    return tiledImageProperties;
  }

  private void startTileProcessor(ViewItemResource resource, FileHandle tileBaseHandle) {
    final File originalImage =
        fileSystemService.getExternalFile(
            resource.getViewableItem().getFileHandle(), resource.getFilepath());
    final File destFolder = fileSystemService.getExternalFile(tileBaseHandle, null);

    largeImageViewer.startTileProcessor(
        Collections.singleton(new Pair<File, File>(originalImage, destFolder)));
  }

  private void setupModelForProcessing(LargeImageViewerModel model) {
    model.setMessageKey("msg.processing");
    model.setAutoPageRefresh(true);
    model.setStartProcess(false);
  }

  public static class LargeImageViewerModel {
    @Bookmarked private String method;

    @Bookmarked(name = "s")
    private boolean startProcess;

    @Bookmarked(stateful = false)
    private int rotation;

    @Bookmarked(name = "a")
    private boolean autoPageRefresh;

    private Properties tiledImageProperties;
    private String tileBaseUri;
    private String jsGeometry;
    private String messageKey;
    private boolean confirmStartProcess;
    private String imageFilePath;
    private String stackTrace;

    public String getTileBaseUri() {
      return tileBaseUri;
    }

    public void setTileBaseUri(String tileBaseUri) {
      this.tileBaseUri = tileBaseUri;
    }

    public String getJsGeometry() {
      return jsGeometry;
    }

    public void setJsGeometry(String jsGeometry) {
      this.jsGeometry = jsGeometry;
    }

    public int getRotation() {
      return rotation;
    }

    public void setRotation(int rotation) {
      this.rotation = rotation;
    }

    public String getMessageKey() {
      return messageKey;
    }

    public void setMessageKey(String message) {
      this.messageKey = message;
    }

    public boolean isConfirmStartProcess() {
      return confirmStartProcess;
    }

    public void setConfirmStartProcess(boolean showConfirm) {
      this.confirmStartProcess = showConfirm;
    }

    public boolean isAutoPageRefresh() {
      return autoPageRefresh;
    }

    public void setAutoPageRefresh(boolean autoPageRefresh) {
      this.autoPageRefresh = autoPageRefresh;
    }

    public boolean isStartProcess() {
      return startProcess;
    }

    public void setStartProcess(boolean startProcess) {
      this.startProcess = startProcess;
    }

    public String getImageFilePath() {
      return imageFilePath;
    }

    public void setImageFilePath(String imageFilePath) {
      this.imageFilePath = imageFilePath;
    }

    public String getMethod() {
      return method;
    }

    public void setMethod(String method) {
      this.method = method;
    }

    public Properties getTiledImageProperties() {
      return tiledImageProperties;
    }

    public void setTiledImageProperties(Properties tiledImageProperties) {
      this.tiledImageProperties = tiledImageProperties;
    }

    public String getStackTrace() {
      return stackTrace;
    }

    public void setStackTrace(String stackTrace) {
      this.stackTrace = stackTrace;
    }
  }

  @Override
  public int getOrder() {
    return 0;
  }
}


text:
import { get, post, put, delete } from './api'

import {
	LOAD_OVERVIEW,
	LOAD_OVERVIEW_SUCCESS,
	LOAD_OVERVIEW_ERROR,
	LOAD_EXPENSES,
	LOAD_EXPENSES_SUCCESS,
	LOAD_EXPENSES_ERROR,
	ADD_EXPENSE,
	ADD_EXPENSE_SUCCESS,
	ADD_EXPENSE_ERROR,
	LOAD_EXPENSE,
	LOAD_EXPENSE_SUCCESS,
	LOAD_EXPENSE_ERROR,
	UPDATE_EXPENSE,
	UPDATE_EXPENSE_SUCCESS,
	UPDATE_EXPENSE_ERROR,
	DELETE_EXPENSE,
	DELETE_EXPENSE_SUCCESS,
	DELETE_EXPENSE_ERROR
} from '../constants/ActionTypes'

export function fetchExpenses(page = 0) {
	return dispatch => {

		dispatch(startFetchingExpenses(page))

		return get('/expenses', {
			params: {page: page}
		}).then(response => {
			dispatch(fetchExpensesSuccess(response.data))
		}).catch(err => {
			dispatch(fetchExpensesError(err))
		})
	}
}

function startFetchingExpenses(page) {
	return {
		type: LOAD_EXPENSES,
		payload: {
			page
		}
	}
}

function fetchExpensesSuccess(data) {
	return {
		type: LOAD_EXPENSES_SUCCESS,
		payload: {
			items: data.items,
			total: data.total
		}
	}
}

function fetchExpensesError(error) {
	return {
		type: LOAD_EXPENSES_ERROR,
		payload: {
			error
		}
	}
}

export function loadOverview() {
	return dispatch => {

		dispatch(startFetchingOverview())

		return get('/expenses/overview')
		.then(response => {
			dispatch(fetchOverviewSuccess(response.data))
		}).catch(err => {
			dispatch(fetchOverviewError(err))
		})
	}
}

function startFetchingOverview() {
	return {
		type: LOAD_OVERVIEW
	}
}

function fetchOverviewSuccess(data) {
	return {
		type: LOAD_OVERVIEW_SUCCESS,
		payload: {
			overview: data
		}
	}
}

function fetchOverviewError(error) {
	return {
		type: LOAD_OVERVIEW_ERROR,
		payload: {
			error
		}
	}
}

export function loadExpenseById(id) {
	return dispatch => {

		dispatch(startFetchingExpense(id))

		return get(`/expenses/${id}`)
		.then(response => {
			dispatch(fetchExpenseSuccess(response.data))
		}).catch(err => {
			dispatch(fetchExpenseError(err))
		})
	}
}

function startFetchingExpense() {
	return {
		type: LOAD_EXPENSE
	}
}

function fetchExpenseSuccess(expense) {
	return {
		type: LOAD_EXPENSE_SUCCESS,
		payload: {
			expense
		}
	}
}

function fetchExpenseError(error) {
	return {
		type: LOAD_EXPENSE_ERROR,
		payload: {
			error
		}
	}
}

export function deleteExpense(id) {
	return dispatch => {

		dispatch(startDeletingExpense(id))

		return delete(`/expenses/${id}`).then(data => {
			dispatch(deleteExpenseSuccess())
		}).catch(err => {
			dispatch(deleteExpenseError(err))
		})
	}
}

function startDeletingExpense() {
	return {
		type: DELETE_EXPENSE
	}
}

function deleteExpenseSuccess() {
	return {
		type: DELETE_EXPENSE_SUCCESS
	}
}

function deleteExpenseError(error) {
	return {
		type: DELETE_EXPENSE_ERROR,
		payload: {
			error
		}
	}
}

export function updateExpense(id, expense) {

	return dispatch => {

		dispatch(startUpdatingExpense())

		return put(`/expenses/${id}`, expense).then(data => {
			dispatch(updateExpenseSuccess())
		}).catch(err => {
			dispatch(updateExpenseError(err))
		})
	}
}

function startUpdatingExpense() {
	return {
		type: UPDATE_EXPENSE
	}
}

function updateExpenseSuccess() {
	return {
		type: UPDATE_EXPENSE_SUCCESS
	}
}

function updateExpenseError(error) {
	return {
		type: UPDATE_EXPENSE_ERROR,
		payload: {
			error
		}
	}
}

export function addExpense(expense) {

	return dispatch => {

		dispatch(startAddingExpense())

		return post('expenses', expense).then(data => {
			dispatch(addExpenseSuccess())
		}).catch(err => {
			dispatch(addExpenseError(err))
		})
	}
}

function startAddingExpense() {
	return {
		type: ADD_EXPENSE
	}
}

function addExpenseSuccess() {
	return {
		type: ADD_EXPENSE_SUCCESS
	}
}

function addExpenseError(error) {
	return {
		type: ADD_EXPENSE_ERROR,
		payload: {
			error
		}
	}
}


text:
<?php

namespace timeessentials;

use pocketmine\event\Listener;
use timeessentials\TimeEssentialsAPI;

class TimeEssentialsListener implements Listener{

    public function __construct(TimeEditAPI $plugin){
        $this->plugin = $plugin;
        $this->getPlugin()->getServer()->getPluginManager()->registerEvents($this, $this->plugin);
    }
    public function getPlugin(){
        return $this->plugin;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>success</status>
  <result>
    <project>
      <id>3975</id>
      <name>VLC media player</name>
      <url>https://www.openhub.net/p/vlc.xml</url>
      <html_url>https://www.openhub.net/p/vlc</html_url>
      <created_at>2007-01-12T11:52:45Z</created_at>
      <updated_at>2015-07-19T22:09:21Z</updated_at>
      <description>VLC - the cross-platform media player and streaming server

VLC media player is a highly portable multimedia player for various audio and video formats (MPEG-1, MPEG-2, MPEG-4, DivX, mp3, ogg, ...) as well as DVDs, VCDs, and various streaming protocols. It can also be used as a server to stream in unicast or multicast in IPv4 or IPv6 on a high-bandwidth network.</description>
      <homepage_url>http://videolan.org/</homepage_url>
      <download_url>http://www.videolan.org/vlc/</download_url>
      <url_name>vlc</url_name>
      <medium_logo_url>https://s3.amazonaws.com/cloud.ohloh.net/attachments/174/vlc_med.png</medium_logo_url>
      <small_logo_url>https://s3.amazonaws.com/cloud.ohloh.net/attachments/174/vlc_small.png</small_logo_url>
      <user_count>3594</user_count>
      <average_rating>4.40221</average_rating>
      <rating_count>813</rating_count>
      <review_count>5</review_count>
      <analysis_id>25125796</analysis_id>
      <tags>
        <tag>blu_ray</tag>
        <tag>mpeg_2</tag>
        <tag>matroska</tag>
        <tag>media_player</tag>
        <tag>visualization</tag>
        <tag>dvd</tag>
        <tag>id3</tag>
        <tag>client</tag>
        <tag>ac3</tag>
        <tag>pvr</tag>
        <tag>ripper</tag>
        <tag>videolan</tag>
        <tag>mpeg</tag>
        <tag>plugin</tag>
        <tag>macosx</tag>
        <tag>musepack</tag>
        <tag>monkeys_audio</tag>
        <tag>ogg</tag>
        <tag>wma</tag>
        <tag>lastfm</tag>
        <tag>ape</tag>
        <tag>id3v2</tag>
        <tag>multi_platform</tag>
        <tag>cd</tag>
        <tag>mpeg_1</tag>
        <tag>linux</tag>
        <tag>application</tag>
        <tag>apple</tag>
        <tag>windows</tag>
        <tag>upnp</tag>
        <tag>osx</tag>
        <tag>movie</tag>
        <tag>podcast</tag>
        <tag>xp</tag>
        <tag>avi</tag>
        <tag>audioscrobbler</tag>
        <tag>mkv</tag>
        <tag>vorbis</tag>
        <tag>mov</tag>
        <tag>audiocd</tag>
        <tag>mozilla</tag>
        <tag>audio</tag>
        <tag>player</tag>
        <tag>aac</tag>
        <tag>theora</tag>
        <tag>mp3</tag>
        <tag>music</tag>
        <tag>video</tag>
        <tag>server</tag>
        <tag>mpeg4</tag>
        <tag>rtp</tag>
        <tag>wavpack</tag>
        <tag>rtsp</tag>
        <tag>script</tag>
        <tag>cross_platform</tag>
        <tag>dvb</tag>
        <tag>movies</tag>
        <tag>mp4</tag>
        <tag>streaming</tag>
        <tag>wav</tag>
        <tag>flac</tag>
        <tag>dts</tag>
        <tag>multimedia</tag>
        <tag>h264</tag>
        <tag>c</tag>
      </tags>
      <analysis>
        <id>25125796</id>
        <url>https://www.openhub.net/analyses/25125796.xml</url>
        <project_id>3975</project_id>
        <updated_at>2015-07-19T22:09:21Z</updated_at>
        <logged_at>2015-07-19T22:02:32Z</logged_at>
        <min_month>1999-08-01T00:00:00Z</min_month>
        <max_month>2015-07-01T00:00:00Z</max_month>
        <twelve_month_contributor_count>102</twelve_month_contributor_count>
        <total_contributor_count>709</total_contributor_count>
        <twelve_month_commit_count>3728</twelve_month_commit_count>
        <total_commit_count>61513</total_commit_count>
        <total_code_lines>612716</total_code_lines>
        <factoids>
          <factoid type="FactoidAgeVeryOld">
Mature, well-established codebase          </factoid>
          <factoid type="FactoidTeamSizeVeryLarge">
Very large, active development team          </factoid>
          <factoid type="FactoidCommentsAverage">
Average number of code comments          </factoid>
          <factoid type="FactoidActivityStable">
Stable Y-O-Y development activity          </factoid>
        </factoids>
        <languages graph_url="https://www.openhub.net/p/vlc/analyses/25125796/languages.png">
          <language percentage="63" color="FF8F00" id="42">
C          </language>
          <language percentage="17" color="F35F1F" id="44">
C++          </language>
          <language percentage="9" color="555555" id="3">
XML          </language>
          <language percentage="11" color="000000" id="">
16 Other          </language>
        </languages>
        <main_language_id>42</main_language_id>
        <main_language_name>C</main_language_name>
      </analysis>
      <licenses>
        <license>
          <name>gpl</name>
          <nice_name>GNU General Public License v2.0 or later</nice_name>
        </license>
        <license>
          <name>lgpl</name>
          <nice_name>GNU Library or "Lesser" GPL (LGPL)</nice_name>
        </license>
      </licenses>
      <project_activity_index>
        <value>70</value>
        <description>Very High</description>
      </project_activity_index>
      <links>
        <link>
          <title>Wiki</title>
          <url>http://wiki.videolan.org/</url>
          <category>Community</category>
        </link>
        <link>
          <title>Forum</title>
          <url>http://forum.videolan.org/</url>
          <category>Forums</category>
        </link>
        <link>
          <title>Tracker</title>
          <url>https://trac.videolan.org/vlc/</url>
          <category>Issue Trackers</category>
        </link>
        <link>
          <title>Mailing lists</title>
          <url>https://mailman.videolan.org/vlc/</url>
          <category>Mailing Lists</category>
        </link>
      </links>
    </project>
  </result>
</response>


text:
package br.com.alura.agenda;

import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.google.android.gms.maps.SupportMapFragment;

public class MapaActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mapa);

        FragmentManager manager = getSupportFragmentManager();
        FragmentTransaction tx = manager.beginTransaction();
        tx.replace(R.id.frame_mapa, new MapaFragment());
        tx.commit();
    }
}


text:
CREATE TABLE `WEB_HOOK` (
    `USER_NAME` VARCHAR(100) NOT NULL,
	`REPOSITORY_NAME` VARCHAR(100) NOT NULL,
	`URL` VARCHAR(200) NOT NULL,
	PRIMARY KEY (`USER_NAME`, `REPOSITORY_NAME`, `URL`),
    CONSTRAINT `IDX_WEB_HOOK_FK0` FOREIGN KEY (`USER_NAME`, `REPOSITORY_NAME`) REFERENCES `REPOSITORY` (`USER_NAME`, `REPOSITORY_NAME`)
);


text:
import { Injectable }    from '@angular/core';
import { Headers, Http, Jsonp, URLSearchParams } from '@angular/http';

import 'rxjs/add/operator/toPromise';
import 'rxjs/Rx';

import { Location } from './location';

@Injectable()
export class ParkingService {

	//private parkingUrl = 'http://www.mocky.io/v2/575fe9c40f0000720ca6b109';  // URL to web api

	//private parkingUrl = 'http://parkingonrent.locationku.com/api/parkingsjsonp';  // URL to web api

	private parkingUrl = 'http://localhost:5000/api/parkingsjsonp';  // URL to web api

	constructor(private http: Http,
	private jsonp: Jsonp) { }

	getParkings(): Promise<any> {

	var params = new URLSearchParams();
    params.set('callback', 'JSONP_CALLBACK');

	return this.jsonp.get(this.parkingUrl, { search: params })
				   .toPromise()
				   .then(response => {
				   	 console.log(response.json());
				   })
				   .catch(function(rejected){
      					console.log(rejected);
	  				});
	}
}


text:
/**
 * Paging.java
 * <p>
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */

package com.microsoft.bingads.v11.customermanagement.entities;

public class Paging implements java.io.Serializable {
    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
            new org.apache.axis.description.TypeDesc(Paging.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("https://bingads.microsoft.com/Customer/v11/Entities", "Paging"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("index");
        elemField.setXmlName(new javax.xml.namespace.QName("https://bingads.microsoft.com/Customer/v11/Entities", "Index"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("size");
        elemField.setXmlName(new javax.xml.namespace.QName("https://bingads.microsoft.com/Customer/v11/Entities", "Size"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }

    private java.lang.Integer index;
    private java.lang.Integer size;
    private java.lang.Object __equalsCalc = null;
    private boolean __hashCodeCalc = false;

    public Paging() {
    }

    public Paging(
            java.lang.Integer index,
            java.lang.Integer size) {
        this.index = index;
        this.size = size;
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
            java.lang.String mechType,
            java.lang.Class _javaType,
            javax.xml.namespace.QName _xmlType) {
        return
                new org.apache.axis.encoding.ser.BeanSerializer(
                        _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
            java.lang.String mechType,
            java.lang.Class _javaType,
            javax.xml.namespace.QName _xmlType) {
        return
                new org.apache.axis.encoding.ser.BeanDeserializer(
                        _javaType, _xmlType, typeDesc);
    }

    /**
     * Gets the index value for this Paging.
     *
     * @return index
     */
    public java.lang.Integer getIndex() {
        return index;
    }

    /**
     * Sets the index value for this Paging.
     *
     * @param index
     */
    public void setIndex(java.lang.Integer index) {
        this.index = index;
    }

    /**
     * Gets the size value for this Paging.
     *
     * @return size
     */
    public java.lang.Integer getSize() {
        return size;
    }

    /**
     * Sets the size value for this Paging.
     *
     * @param size
     */
    public void setSize(java.lang.Integer size) {
        this.size = size;
    }

    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof Paging)) return false;
        Paging other = (Paging) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
                ((this.index == null && other.getIndex() == null) ||
                        (this.index != null &&
                                this.index.equals(other.getIndex()))) &&
                ((this.size == null && other.getSize() == null) ||
                        (this.size != null &&
                                this.size.equals(other.getSize())));
        __equalsCalc = null;
        return _equals;
    }

    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getIndex() != null) {
            _hashCode += getIndex().hashCode();
        }
        if (getSize() != null) {
            _hashCode += getSize().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

}


text:
using System;
using Xunit;

namespace CSharpInternals.ExceptionHandling
{
    public class Basics
    {
        // Fact - ToString allocates a lot, especially with AggregateException
        // https://referencesource.microsoft.com/#mscorlib/system/AggregateException.cs,448

        [Fact]
        public void ThrowsNull()
        {
            Assert.Throws<NullReferenceException>(() => ThrowsNullReferenceException());
        }

        private static void ThrowsNullReferenceException() => throw null;
    }
}


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

<TITLE>
MathCmds
</TITLE>

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

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.hecl

Class MathCmds

java.lang.Object
  org.hecl.Operator
      org.hecl.MathCmds

All Implemented Interfaces:
Command

public class MathCmds
extends Operator

The MathCmds class implements a variety of math
 commands, depending on which version of Java Hecl is compiled for.

Version:

1.0

Field Summary

static int
ABS

static int
ACOS

static int
AND

static int
ASIN

static int
ATAN

static int
BINADD

static int
BINDIV

static int
BINMUL

static int
BINSUB

static int
CASTDOUBLE

static int
CASTFLOAT

static int
CASTINT

static int
CASTLONG

static int
CBRT

static int
CEIL

static int
COS

static int
COSH

static int
DECR

static Thing
E

static int
EQ

static int
EXP

static int
EXPM1

static int
FALSE

static int
FLOOR

static int
GE

static int
GT

static int
HYPOT

static int
INCR

static int
LE

static int
LOG

static int
LOG10

static int
LOG1P

static int
LT

static int
MAX

static int
MIN

static int
MINUS

static int
MOD

static int
MUL

static int
NEQ

static int
NOT

static int
OR

static Thing
PI

static int
PLUS

static int
POW

static int
RANDOM

static int
ROUND

static int
SIGNUM

static int
SIN

static int
SINH

static int
SQRT

static int
TAN

static int
TANH

static int
TODEGREES

static int
TORADIANS

static int
TRUE

Fields inherited from class org.hecl.Operator

cmdcode, maxargs, minargs

Constructor Summary

protected
MathCmds(int cmdcode,
         int minargs,
         int maxargs)

Method Summary

static Thing
binary(int cmdcode,
       Interp ip,
       NumberThing a,
       NumberThing b)

protected static int
compare(double v1,
        double v2)

protected static int
compare(int v1,
        int v2)

protected static int
compare(long v1,
        long v2)

static int
compare(NumberThing a,
        NumberThing b)

static int
compare(Thing a,
        Thing b)

static void
load(Interp ip)

 Thing
operate(int cmdcode,
        Interp ip,
        Thing[] argv)

          The operate method dispatches to the actual code.

static Thing
unary(int cmdcode,
      Interp ip,
      NumberThing a)

static void
unload(Interp ip)

Methods inherited from class org.hecl.Operator

cmdCode, load, unload

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

E

public static final Thing E

PI

public static final Thing PI

CASTINT

public static final int CASTINT

See Also:
Constant Field Values

CASTLONG

public static final int CASTLONG

See Also:
Constant Field Values

CASTFLOAT

public static final int CASTFLOAT

See Also:
Constant Field Values

CASTDOUBLE

public static final int CASTDOUBLE

See Also:
Constant Field Values

TODEGREES

public static final int TODEGREES

See Also:
Constant Field Values

TORADIANS

public static final int TORADIANS

See Also:
Constant Field Values

ABS

public static final int ABS

See Also:
Constant Field Values

SQRT

public static final int SQRT

See Also:
Constant Field Values

LOG

public static final int LOG

See Also:
Constant Field Values

SIN

public static final int SIN

See Also:
Constant Field Values

COS

public static final int COS

See Also:
Constant Field Values

TAN

public static final int TAN

See Also:
Constant Field Values

ASIN

public static final int ASIN

See Also:
Constant Field Values

ACOS

public static final int ACOS

See Also:
Constant Field Values

ATAN

public static final int ATAN

See Also:
Constant Field Values

EXP

public static final int EXP

See Also:
Constant Field Values

FLOOR

public static final int FLOOR

See Also:
Constant Field Values

CEIL

public static final int CEIL

See Also:
Constant Field Values

POW

public static final int POW

See Also:
Constant Field Values

RANDOM

public static final int RANDOM

See Also:
Constant Field Values

ROUND

public static final int ROUND

See Also:
Constant Field Values

MIN

public static final int MIN

See Also:
Constant Field Values

MAX

public static final int MAX

See Also:
Constant Field Values

SIGNUM

public static final int SIGNUM

See Also:
Constant Field Values

CBRT

public static final int CBRT

See Also:
Constant Field Values

LOG10

public static final int LOG10

See Also:
Constant Field Values

LOG1P

public static final int LOG1P

See Also:
Constant Field Values

SINH

public static final int SINH

See Also:
Constant Field Values

COSH

public static final int COSH

See Also:
Constant Field Values

TANH

public static final int TANH

See Also:
Constant Field Values

EXPM1

public static final int EXPM1

See Also:
Constant Field Values

HYPOT

public static final int HYPOT

See Also:
Constant Field Values

INCR

public static final int INCR

See Also:
Constant Field Values

DECR

public static final int DECR

See Also:
Constant Field Values

TRUE

public static final int TRUE

See Also:
Constant Field Values

FALSE

public static final int FALSE

See Also:
Constant Field Values

NOT

public static final int NOT

See Also:
Constant Field Values

AND

public static final int AND

See Also:
Constant Field Values

OR

public static final int OR

See Also:
Constant Field Values

EQ

public static final int EQ

See Also:
Constant Field Values

NEQ

public static final int NEQ

See Also:
Constant Field Values

LT

public static final int LT

See Also:
Constant Field Values

LE

public static final int LE

See Also:
Constant Field Values

GT

public static final int GT

See Also:
Constant Field Values

GE

public static final int GE

See Also:
Constant Field Values

BINADD

public static final int BINADD

See Also:
Constant Field Values

BINSUB

public static final int BINSUB

See Also:
Constant Field Values

BINMUL

public static final int BINMUL

See Also:
Constant Field Values

BINDIV

public static final int BINDIV

See Also:
Constant Field Values

MOD

public static final int MOD

See Also:
Constant Field Values

PLUS

public static final int PLUS

See Also:
Constant Field Values

MINUS

public static final int MINUS

See Also:
Constant Field Values

MUL

public static final int MUL

See Also:
Constant Field Values

Constructor Detail

MathCmds

protected MathCmds(int cmdcode,
                   int minargs,
                   int maxargs)

Method Detail

compare

public static int compare(Thing a,
                          Thing b)

compare

public static int compare(NumberThing a,
                          NumberThing b)

unary

public static Thing unary(int cmdcode,
                          Interp ip,
                          NumberThing a)
                   throws HeclException

Throws:

HeclException

binary

public static Thing binary(int cmdcode,
                           Interp ip,
                           NumberThing a,
                           NumberThing b)
                    throws HeclException

Throws:

HeclException

operate

public Thing operate(int cmdcode,
                     Interp ip,
                     Thing[] argv)
              throws HeclException

Description copied from class: Operator

The operate method dispatches to the actual code.

Specified by:
operate in class Operator

Parameters:
cmdcode - an int value
ip - an Interp value
argv - a Thing[] value

Returns:
a Thing value, or null when no value has been

Throws:

HeclException - if an error occurs

load

public static void load(Interp ip)
                 throws HeclException

Throws:

HeclException

unload

public static void unload(Interp ip)
                   throws HeclException

Throws:

HeclException

compare

protected static int compare(int v1,
                             int v2)

compare

protected static int compare(long v1,
                             long v2)

compare

protected static int compare(double v1,
                             double v2)

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Chapter 39.  InvalidArgumentException</title>
    <link rel="stylesheet" href="apiReference.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Berkeley DB C++ Standard Template Library API Reference" />
    <link rel="up" href="index.html" title="Berkeley DB C++ Standard Template Library API Reference" />
    <link rel="prev" href="InvalidFunctionCall.html" title="Chapter 38.  InvalidFunctionCall" />

          Chapter 39.
 InvalidArgumentException

          Prev

Chapter 39.
 InvalidArgumentException

Some argument of a function is invalid.

 Public Members

          <colgroup>
            <col />
            <col />
          </colgroup>

              Member
              Description

InvalidArgumentException

Group

 Dbstl Exception Classes

InvalidArgumentException

Function Details

InvalidArgumentException(const char *errmsg)

InvalidArgumentException(const char *argtype,
    const char *arg)

Class

  InvalidArgumentException

          Prev

          Chapter 38.
 InvalidFunctionCall

            Home


text:
namespace libgm {
  template class moment_gaussian_mle<double>;
  template class moment_gaussian_mle<float>;
}

using namespace libgm;

std::size_t nsamples = 10000;
double tol = 0.05;

BOOST_AUTO_TEST_CASE(test_mle) {
  typedef dense_vector<double> vec_type;
  moment_gaussian_param<> param(3, 0);
  param.mean << 1.0, 3.0, 2.0;
  param.cov  << 3.0, 2.0, 1.0,
                2.0, 1.5, 1.0,
                1.0, 1.0, 1.5;

  // generate a few samples
  std::mt19937 rng;
  multivariate_normal_distribution<> dist(param);
  std::vector<std::pair<vec_type, double>> samples;
  samples.reserve(nsamples);
  for (std::size_t i = 0; i < nsamples; ++i) {
    samples.emplace_back(dist(rng), 1.0);
  }

  // compute the MLE and compare against ground truth
  moment_gaussian_param<> estim = moment_gaussian_mle<>()(samples, 3);
  BOOST_CHECK_SMALL((param.mean - estim.mean).cwiseAbs().maxCoeff(), tol);
  BOOST_CHECK_SMALL((param.cov - estim.cov).cwiseAbs().maxCoeff(), tol);

  // check if the log-likelihoods are close
  typedef range_ll<moment_gaussian_ll<> > range_ll_type;
  double ll_truth = range_ll_type(param).value(samples);
  double ll_estim = range_ll_type(estim).value(samples);
  std::cout << "Log-likelihood of the original: " << ll_truth << std::endl;
  std::cout << "Log-likelihood of the estimate: " << ll_estim << std::endl;
  BOOST_CHECK_CLOSE(ll_truth, ll_estim, 1.0);
}


text:
<!doctype html>

  <meta charset="utf-8">
  <title>Aromato.Client</title>
  <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <link rel="stylesheet" href="./assets/css/please-wait.css">
  <link rel="stylesheet" href="./assets/css/spinner.css">

  <app-root></app-root>


text:
package solar.dimensions.api.event.player;

import solar.dimensions.api.event.common.PlayerEvent;

public class PlayerEditBookEvent extends PlayerEvent {

}