text:
// Copyright (c) 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include <string>
#include <vector>

#include "gmock/gmock.h"
#include "test/opt/assembly_builder.h"
#include "test/opt/pass_fixture.h"
#include "test/opt/pass_utils.h"

namespace spvtools {
namespace opt {
namespace {

using ::testing::HasSubstr;
using EliminateDeadFunctionsBasicTest = PassTest<::testing::Test>;

TEST_F(EliminateDeadFunctionsBasicTest, BasicDeleteDeadFunction) {
  // The function Dead should be removed because it is never called.
  const std::vector<const char*> common_code = {
      // clang-format off
               "OpCapability Shader",
               "OpMemoryModel Logical GLSL450",
               "OpEntryPoint Fragment %main \"main\"",
               "OpName %main \"main\"",
               "OpName %Live \"Live\"",
       "%void = OpTypeVoid",
          "%7 = OpTypeFunction %void",
       "%main = OpFunction %void None %7",
         "%15 = OpLabel",
         "%16 = OpFunctionCall %void %Live",
         "%17 = OpFunctionCall %void %Live",
               "OpReturn",
               "OpFunctionEnd",
  "%Live = OpFunction %void None %7",
         "%20 = OpLabel",
               "OpReturn",
               "OpFunctionEnd"
      // clang-format on
  };

  const std::vector<const char*> dead_function = {
      // clang-format off
      "%Dead = OpFunction %void None %7",
         "%19 = OpLabel",
               "OpReturn",
               "OpFunctionEnd",
      // clang-format on
  };

  SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
  SinglePassRunAndCheck<EliminateDeadFunctionsPass>(
      JoinAllInsts(Concat(common_code, dead_function)),
      JoinAllInsts(common_code), /* skip_nop = */ true);
}

TEST_F(EliminateDeadFunctionsBasicTest, BasicKeepLiveFunction) {
  // Everything is reachable from an entry point, so no functions should be
  // deleted.
  const std::vector<const char*> text = {
      // clang-format off
               "OpCapability Shader",
               "OpMemoryModel Logical GLSL450",
               "OpEntryPoint Fragment %main \"main\"",
               "OpName %main \"main\"",
               "OpName %Live1 \"Live1\"",
               "OpName %Live2 \"Live2\"",
       "%void = OpTypeVoid",
          "%7 = OpTypeFunction %void",
       "%main = OpFunction %void None %7",
         "%15 = OpLabel",
         "%16 = OpFunctionCall %void %Live2",
         "%17 = OpFunctionCall %void %Live1",
               "OpReturn",
               "OpFunctionEnd",
      "%Live1 = OpFunction %void None %7",
         "%19 = OpLabel",
               "OpReturn",
               "OpFunctionEnd",
      "%Live2 = OpFunction %void None %7",
         "%20 = OpLabel",
               "OpReturn",
               "OpFunctionEnd"
      // clang-format on
  };

  SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
  std::string assembly = JoinAllInsts(text);
  auto result = SinglePassRunAndDisassemble<EliminateDeadFunctionsPass>(
      assembly, /* skip_nop = */ true, /* do_validation = */ false);
  EXPECT_EQ(Pass::Status::SuccessWithoutChange, std::get<1>(result));
  EXPECT_EQ(assembly, std::get<0>(result));
}

TEST_F(EliminateDeadFunctionsBasicTest, BasicKeepExportFunctions) {
  // All functions are reachable.  In particular, ExportedFunc and Constant are
  // reachable because ExportedFunc is exported.  Nothing should be removed.
  const std::vector<const char*> text = {
      // clang-format off
               "OpCapability Shader",
               "OpCapability Linkage",
               "OpMemoryModel Logical GLSL450",
               "OpEntryPoint Fragment %main \"main\"",
               "OpName %main \"main\"",
               "OpName %ExportedFunc \"ExportedFunc\"",
               "OpName %Live \"Live\"",
               "OpDecorate %ExportedFunc LinkageAttributes \"ExportedFunc\" Export",
       "%void = OpTypeVoid",
          "%7 = OpTypeFunction %void",
       "%main = OpFunction %void None %7",
         "%15 = OpLabel",
               "OpReturn",
               "OpFunctionEnd",
"%ExportedFunc = OpFunction %void None %7",
         "%19 = OpLabel",
         "%16 = OpFunctionCall %void %Live",
               "OpReturn",
               "OpFunctionEnd",
  "%Live = OpFunction %void None %7",
         "%20 = OpLabel",
               "OpReturn",
               "OpFunctionEnd"
      // clang-format on
  };

  SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
  std::string assembly = JoinAllInsts(text);
  auto result = SinglePassRunAndDisassemble<EliminateDeadFunctionsPass>(
      assembly, /* skip_nop = */ true, /* do_validation = */ false);
  EXPECT_EQ(Pass::Status::SuccessWithoutChange, std::get<1>(result));
  EXPECT_EQ(assembly, std::get<0>(result));
}

TEST_F(EliminateDeadFunctionsBasicTest, BasicRemoveDecorationsAndNames) {
  // We want to remove the names and decorations associated with results that
  // are removed.  This test will check for that.
  const std::string text = R"(
               OpCapability Shader
               OpMemoryModel Logical GLSL450
               OpEntryPoint Vertex %main "main"
               OpName %main "main"
               OpName %Dead "Dead"
               OpName %x "x"
               OpName %y "y"
               OpName %z "z"
               OpDecorate %x RelaxedPrecision
               OpDecorate %y RelaxedPrecision
               OpDecorate %z RelaxedPrecision
               OpDecorate %6 RelaxedPrecision
               OpDecorate %7 RelaxedPrecision
               OpDecorate %8 RelaxedPrecision
       %void = OpTypeVoid
         %10 = OpTypeFunction %void
      %float = OpTypeFloat 32
%_ptr_Function_float = OpTypePointer Function %float
    %float_1 = OpConstant %float 1
       %main = OpFunction %void None %10
         %14 = OpLabel
               OpReturn
               OpFunctionEnd
       %Dead = OpFunction %void None %10
         %15 = OpLabel
          %x = OpVariable %_ptr_Function_float Function
          %y = OpVariable %_ptr_Function_float Function
          %z = OpVariable %_ptr_Function_float Function
               OpStore %x %float_1
               OpStore %y %float_1
          %6 = OpLoad %float %x
          %7 = OpLoad %float %y
          %8 = OpFAdd %float %6 %7
               OpStore %z %8
               OpReturn
               OpFunctionEnd)";

  const std::string expected_output = R"(OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %main "main"
OpName %main "main"
%void = OpTypeVoid
%10 = OpTypeFunction %void
%float = OpTypeFloat 32
%_ptr_Function_float = OpTypePointer Function %float
%float_1 = OpConstant %float 1
%main = OpFunction %void None %10
%14 = OpLabel
OpReturn
OpFunctionEnd
)";

  SetAssembleOptions(SPV_TEXT_TO_BINARY_OPTION_PRESERVE_NUMERIC_IDS);
  SinglePassRunAndCheck<EliminateDeadFunctionsPass>(text, expected_output,
                                                    /* skip_nop = */ true);
}

TEST_F(EliminateDeadFunctionsBasicTest, DebugRemoveFunctionFromDebugFunction) {
  // We want to remove id of OpFunction from DebugFunction.
  const std::string text = R"(OpCapability Shader
%1 = OpExtInstImport "OpenCL.DebugInfo.100"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %2 "main" %3 %4
OpExecutionMode %2 OriginUpperLeft
%5 = OpString "ps.hlsl"
OpSource HLSL 600 %5 "float4 foo() {
  return 1;
}
float4 main(float4 color : COLOR) : SV_TARGET {
  return foo() + color;
}
"
%6 = OpString "float"
%7 = OpString "main"
%8 = OpString "foo"
; CHECK: [[foo:%\d+]] = OpString "foo"
OpDecorate %3 Location 0
OpDecorate %4 Location 0
%uint = OpTypeInt 32 0
%uint_32 = OpConstant %uint 32
%float = OpTypeFloat 32
%float_1 = OpConstant %float 1
%v4float = OpTypeVector %float 4
%14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%_ptr_Input_v4float = OpTypePointer Input %v4float
%_ptr_Output_v4float = OpTypePointer Output %v4float
%void = OpTypeVoid
%18 = OpTypeFunction %void
%19 = OpTypeFunction %v4float
%3 = OpVariable %_ptr_Input_v4float Input
%4 = OpVariable %_ptr_Output_v4float Output
%_ptr_Function_v4float = OpTypePointer Function %v4float
; CHECK: [[info_none:%\d+]] = OpExtInst %void %1 DebugInfoNone
%20 = OpExtInst %void %1 DebugSource %5
%21 = OpExtInst %void %1 DebugCompilationUnit 1 4 %20 HLSL
%22 = OpExtInst %void %1 DebugTypeBasic %6 %uint_32 Float
%23 = OpExtInst %void %1 DebugTypeVector %22 4
%24 = OpExtInst %void %1 DebugTypeFunction FlagIsProtected|FlagIsPrivate %23 %23
%25 = OpExtInst %void %1 DebugTypeFunction FlagIsProtected|FlagIsPrivate %23
%26 = OpExtInst %void %1 DebugFunction %7 %24 %20 4 1 %21 %7 FlagIsProtected|FlagIsPrivate 4 %2
%27 = OpExtInst %void %1 DebugFunction %8 %25 %20 1 1 %21 %8 FlagIsProtected|FlagIsPrivate 1 %28
; CHECK: {{%\d+}} = OpExtInst %void %1 DebugFunction [[foo]] {{%\d+}} {{%\d+}} 1 1 {{%\d+}} {{%\d+}} FlagIsProtected|FlagIsPrivate 1 [[info_none]]
%29 = OpExtInst %void %1 DebugLexicalBlock %20 1 14 %27
%40 = OpExtInst %void %1 DebugInlinedAt 4 %26
%2 = OpFunction %void None %18
%30 = OpLabel
%39 = OpVariable %_ptr_Function_v4float Function
%41 = OpExtInst %void %1 DebugScope %27 %40
OpStore %39 %14
%32 = OpLoad %v4float %39
%42 = OpExtInst %void %1 DebugScope %26
%33 = OpLoad %v4float %3
%34 = OpFAdd %v4float %32 %33
OpStore %4 %34
%43 = OpExtInst %void %1 DebugNoScope
OpReturn
OpFunctionEnd
%28 = OpFunction %v4float None %19
%36 = OpLabel
OpReturnValue %14
OpFunctionEnd
)";

  SinglePassRunAndMatch<EliminateDeadFunctionsPass>(text, false);
}

TEST_F(EliminateDeadFunctionsBasicTest,
       DebugRemoveFunctionUsingExistingDebugInfoNone) {
  // We want to remove id of OpFunction from DebugFunction.
  const std::string text = R"(OpCapability Shader
%1 = OpExtInstImport "OpenCL.DebugInfo.100"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %2 "main" %3 %4
OpExecutionMode %2 OriginUpperLeft
%5 = OpString "ps.hlsl"
OpSource HLSL 600 %5 "float4 foo() {
  return 1;
}
float4 main(float4 color : COLOR) : SV_TARGET {
  return foo() + color;
}
"
%6 = OpString "float"
%7 = OpString "main"
%8 = OpString "foo"
; CHECK: [[foo:%\d+]] = OpString "foo"
OpDecorate %3 Location 0
OpDecorate %4 Location 0
%uint = OpTypeInt 32 0
%uint_32 = OpConstant %uint 32
%float = OpTypeFloat 32
%float_1 = OpConstant %float 1
%v4float = OpTypeVector %float 4
%14 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%_ptr_Input_v4float = OpTypePointer Input %v4float
%_ptr_Output_v4float = OpTypePointer Output %v4float
%void = OpTypeVoid
%18 = OpTypeFunction %void
%19 = OpTypeFunction %v4float
%3 = OpVariable %_ptr_Input_v4float Input
%4 = OpVariable %_ptr_Output_v4float Output
%_ptr_Function_v4float = OpTypePointer Function %v4float
; CHECK: [[info_none:%\d+]] = OpExtInst %void %1 DebugInfoNone
%20 = OpExtInst %void %1 DebugSource %5
%21 = OpExtInst %void %1 DebugCompilationUnit 1 4 %20 HLSL
%22 = OpExtInst %void %1 DebugTypeBasic %6 %uint_32 Float
%23 = OpExtInst %void %1 DebugTypeVector %22 4
%24 = OpExtInst %void %1 DebugTypeFunction FlagIsProtected|FlagIsPrivate %23 %23
%25 = OpExtInst %void %1 DebugTypeFunction FlagIsProtected|FlagIsPrivate %23
%26 = OpExtInst %void %1 DebugFunction %7 %24 %20 4 1 %21 %7 FlagIsProtected|FlagIsPrivate 4 %2
%27 = OpExtInst %void %1 DebugFunction %8 %25 %20 1 1 %21 %8 FlagIsProtected|FlagIsPrivate 1 %28
; CHECK: {{%\d+}} = OpExtInst %void %1 DebugFunction [[foo]] {{%\d+}} {{%\d+}} 1 1 {{%\d+}} {{%\d+}} FlagIsProtected|FlagIsPrivate 1 [[info_none]]
%29 = OpExtInst %void %1 DebugLexicalBlock %20 1 14 %27
%35 = OpExtInst %void %1 DebugInfoNone
%40 = OpExtInst %void %1 DebugInlinedAt 4 %26
%2 = OpFunction %void None %18
%30 = OpLabel
%39 = OpVariable %_ptr_Function_v4float Function
%41 = OpExtInst %void %1 DebugScope %27 %40
OpStore %39 %14
%32 = OpLoad %v4float %39
%42 = OpExtInst %void %1 DebugScope %26
%33 = OpLoad %v4float %3
%34 = OpFAdd %v4float %32 %33
OpStore %4 %34
%43 = OpExtInst %void %1 DebugNoScope
OpReturn
OpFunctionEnd
%28 = OpFunction %v4float None %19
%36 = OpLabel
OpReturnValue %14
OpFunctionEnd
)";

  SinglePassRunAndMatch<EliminateDeadFunctionsPass>(text, false);
}

}  // namespace
}  // namespace opt
}  // namespace spvtools


text:
require 'fog/azurerm'
require 'yaml'

########################################################################################################################
######################                   Services object required by all actions                  ######################
######################                              Keep it Uncommented!                          ######################
########################################################################################################################

azure_credentials = YAML.load_file(File.expand_path('credentials/azure.yml', __dir__))

resources = Fog::Resources::AzureRM.new(
  tenant_id: azure_credentials['tenant_id'],
  client_id: azure_credentials['client_id'],
  client_secret: azure_credentials['client_secret'],
  subscription_id: azure_credentials['subscription_id']
)

traffic_manager = Fog::TrafficManager::AzureRM.new(
  tenant_id: azure_credentials['tenant_id'],
  client_id: azure_credentials['client_id'],
  client_secret: azure_credentials['client_secret'],
  subscription_id: azure_credentials['subscription_id']
)

########################################################################################################################
######################                                 Prerequisites                              ######################
########################################################################################################################

begin
  resource_group = resources.resource_groups.create(
    name: 'TestRG-TM',
    location: LOCATION
  )

  ########################################################################################################################
  ######################                   Check Traffic Manager Profile Exists?                    ######################
  ########################################################################################################################

  flag = traffic_manager.traffic_manager_profiles.check_traffic_manager_profile_exists('TestRG-TM', 'test-tmp')
  puts "Traffic Manager Profile doesn't exist." unless flag

  ########################################################################################################################
  ######################                         Create Traffic Manager Profile                     ######################
  ########################################################################################################################

  tags = { key1: 'value1', key2: 'value2' }

  traffic_manager_profile = traffic_manager.traffic_manager_profiles.create(
    name: 'test-tmp',
    resource_group: 'TestRG-TM',
    tags: tags,
    traffic_routing_method: 'Performance',
    relative_name: 'testapplication',
    ttl: '30',
    protocol: 'http',
    port: '80',
    path: '/monitorpage.aspx',
    endpoints: [{
      name: 'endpoint1',
      type: 'externalEndpoints',
      target: 'test-app.com',
      endpoint_location: 'eastus',
      endpoint_status: 'Enabled',
      priority: 5,
      weight: 10
    }]
  )
  puts "Created traffic manager profile: #{traffic_manager_profile.name}"

  ########################################################################################################################
  ######################                   Check Traffic Manager Endpoint Exists?                   ######################
  ########################################################################################################################

  flag = traffic_manager.traffic_manager_end_points.check_traffic_manager_endpoint_exists('TestRG-TM', 'test-tmp', 'myendpoint', 'externalEndpoints')
  puts "Traffic Manager Endpoint doesn't exist." unless flag

  ########################################################################################################################
  ######################                        Create Traffic Manager Endpoint                    ######################
  ########################################################################################################################

  traffic_manager_end_point = traffic_manager.traffic_manager_end_points.create(
    name: 'myendpoint',
    resource_group: 'TestRG-TM',
    traffic_manager_profile_name: 'test-tmp',
    type: 'externalEndpoints',
    target: 'test-app1.com',
    endpoint_location: 'eastus'
  )
  puts "Created traffic manager endpoint: #{traffic_manager_end_point.name}"

  ########################################################################################################################
  ######################                   Get and Update Traffic Manager Endpoint                ######################
  ########################################################################################################################

  end_point = traffic_manager.traffic_manager_end_points.get('TestRG-TM', 'test-tmp', 'myendpoint', 'externalEndpoints')
  puts "Get traffic manager endpoint: #{end_point.name}"
  end_point.update(
    type: 'externalEndpoints',
    target: 'test-app2.com',
    endpoint_location: 'centralus'
  )
  puts 'Updated traffic manager endpoint'

  ########################################################################################################################
  ######################                   Get and Destroy Traffic Manager Endpoint                ######################
  ########################################################################################################################

  end_point = traffic_manager.traffic_manager_end_points.get('TestRG-TM', 'test-tmp', 'myendpoint', 'externalEndpoints')
  puts "Deleted traffic manager endpoint: #{end_point.destroy}"

  ########################################################################################################################
  ######################                    Get and Update Traffic Manager Profile                 ######################
  ########################################################################################################################

  traffic_manager_profile = traffic_manager.traffic_manager_profiles.get('TestRG-TM', 'test-tmp')
  puts "Get traffic manager profile: #{traffic_manager_profile.name}"
  traffic_manager_profile.update(traffic_routing_method: 'Weighted',
                                 ttl: '35',
                                 protocol: 'https',
                                 port: '90',
                                 path: '/monitorpage1.aspx')
  puts 'Updated traffic manager profile'

  ########################################################################################################################
  ######################                    Get and Destroy Traffic Manager Profile                 ######################
  ########################################################################################################################

  traffic_manager_profile = traffic_manager.traffic_manager_profiles.get('TestRG-TM', 'test-tmp')
  puts "Deleted traffic manager profile: #{traffic_manager_profile.destroy}"

  ########################################################################################################################
  ######################                                   CleanUp                                  ######################
  ########################################################################################################################

  resource_group = resources.resource_groups.get('TestRG-TM')
  resource_group.destroy

  puts 'Integration test for Traffic Manager ran successfully!'
rescue
  puts 'Integration Test for traffic manager is failing'
  resource_group.destroy unless resource_group.nil?
end

redpajama_set_name: RedPajamaGithub


text:
namespace NoMoreIIS.Models
{
    public class LaunchSettingsMetadata
    {
        public string ProjectName { get; set; }

        public string Location { get; set; }

        public LaunchSettingsMetadata(string projectName, string location)
        {
            ProjectName = projectName;
            Location = location;
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Daniel Berkompas">
<meta name="description" content="Describe your website">
<meta name="generator" content="Hugo 0.47.1" />
<title>On Keeping Your ETS Tables Alive · Bits & Sundry</title>
<link rel="shortcut icon" href="https://blog.danielberkompas.com/favicon.ico">
<link rel="stylesheet" href="https://blog.danielberkompas.com/css/style.css">

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inconsolata">

<link rel="stylesheet" href="https://blog.danielberkompas.com/css/syntax.css">

<link rel="stylesheet" href="https://blog.danielberkompas.com/css/overrides.css">

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css">

<link href="https://blog.danielberkompas.com/index.xml" rel="alternate" type="application/rss+xml" title="Bits & Sundry" />

<meta property="og:title" content="On Keeping Your ETS Tables Alive" />
<meta property="og:description" content="In my ongoing quest to make Elixir libraries that integrate with
Twilio, I found that I needed a lookup table to store the state of ongoing calls in.

In Rails, this table would probably be a Postgres table or a list key in Redis. But before jumping to one of these familiar solutions, I thought, “What does Elixir/Erlang already have that would meet this need?”

" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://blog.danielberkompas.com/2015/04/17/keep-your-ets-tables-alive/" /><meta property="article:published_time" content="2015-04-17T00:00:00+00:00"/>
<meta property="article:modified_time" content="2015-04-17T00:00:00+00:00"/>

<meta itemprop="name" content="On Keeping Your ETS Tables Alive">
<meta itemprop="description" content="In my ongoing quest to make Elixir libraries that integrate with
Twilio, I found that I needed a lookup table to store the state of ongoing calls in.

In Rails, this table would probably be a Postgres table or a list key in Redis. But before jumping to one of these familiar solutions, I thought, “What does Elixir/Erlang already have that would meet this need?”

">

<meta itemprop="datePublished" content="2015-04-17T00:00:00+00:00" />
<meta itemprop="dateModified" content="2015-04-17T00:00:00+00:00" />
<meta itemprop="wordCount" content="490">

<meta itemprop="keywords" content="elixir," />

<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="On Keeping Your ETS Tables Alive"/>
<meta name="twitter:description" content="In my ongoing quest to make Elixir libraries that integrate with
Twilio, I found that I needed a lookup table to store the state of ongoing calls in.

In Rails, this table would probably be a Postgres table or a list key in Redis. But before jumping to one of these familiar solutions, I thought, “What does Elixir/Erlang already have that would meet this need?”

"/>
<meta name="twitter:site" content="@https://www.twitter.com/dberkom"/>

		 ←Home

 		Projects

 		About

 		Tags

		Subscribe

On Keeping Your ETS Tables Alive

      April 17, 2015

      elixir

In my ongoing quest to make Elixir libraries that integrate with
Twilio, I found that I needed a lookup table to store the state of ongoing calls in.

In Rails, this table would probably be a Postgres table or a list key in Redis. But before jumping to one of these familiar solutions, I thought, “What does Elixir/Erlang already have that would meet this need?”

Erlang Term Storage (ETS)

I was not disappointed. It turns out that Erlang has an in-memory store called ETS, which is perfect for my use case, and here’s why.

In Ruby/Rails apps, most of your state is thrown away after every request unless you save it in a database. Then, on the next request, you have to load it all up again and convert it back into Ruby data types, making the request take longer than it needs to. This is because Rails doesn’t really offer a persistent in-memory store that survives between requests.

I didn’t want to have to calculate the previous state of a call or load it out of a database. After all, I just calculated it! It should still be available in memory when the user takes another action. The ETS store is great for this because:

It persists between requests, and

The data stored in it (regular Erlang tuples) doesn’t have to be converted back into Erlang types, so there’s very little overhead.

The Problem: Process Death

There was just one little problem. ETS tables are erased as soon as the process which owns them dies. So, if there is ever a crash in my table owner, my entire ETS table will be erased, leaving on-going calls in an inconsistent state.

This is a case where Erlang’s “Let it crash” philosophy shouldn’t be followed. The OTP supervisor can reboot my crashed process, but the ETS table it owned will be gone, making for a poor crash recovery. This is a case where the defaults need to be improved.

The Solution: A Table Manager

To prevent this, I set up a very simple TableManager process. It has to be very simple to ensure that it never crashes. This process creates the table, sets itself as the “heir”, and then gives away the table to a designated consumer process.

If that consumer process ever dies, the TableManager will receive back
control, wait until the consumer is rebooted, and then hand it back. The ETS table stays alive, and everybody’s happy.

Since I’ve been open sourcing my Elixir work so far, I decided to open source this TableManager process. You can find it in my Immortal library on Github.

Final Thoughts

I don’t need Redis any more!

Seriously, I was impressed at how easy it was to create a durable state storage system without any external dependencies in Elixir/Erlang. This concept of persistent state makes my applications feel more like OS programming rather than transactional, web programming. So far, I like the difference.

      Daniel Berkompas
      Lead software engineer at LeadSimple

     tweet

 Share

Please enable JavaScript to view the comments powered by Disqus.
comments powered by Disqus

Read more

            Cloak 1.0.0 Alpha Released!Dec 31 2018

            Is the Elixir Hype Real?Sep 10 2018

            ElixirConf 2018 Talk PicksAug 22 2018

            Flexible Design with AdaptersMar 17 2018

            Why Your Software Projects FailSep 30 2017

            Reusable Templates in PhoenixJan 17 2017

            Replace Callbacks with Ecto.MultiSep 27 2016

            Multidimensional Arrays in ElixirApr 23 2016

            Background Jobs in PhoenixApr 5 2016

            SEO Tags In PhoenixJan 28 2016

        © Copyright 2018 Daniel Berkompas


text:
{% extends "../layout_full-width.html" %}

{% block page_title %}
	Service Green
{% endblock %}

{% block content %}

{% include "../includes/phase_banner_beta_full-width.html" %}

Service Green

Explore what kind of work is right for you, and take the next steps towards what you want to be

                    <form id="searchForm">

                                   <input id="searchInput" class="PROD_search__input" autocomplete="off" placeholder="Enter a job title or keywords" type="text">

                              <input class="PROD_search__submit" onclick="saveSearchTermsAndContinue()" type="button" value="Search">

                    </form>

Explore by job category

Animal care and agriculture

Beauty and wellbeing

Business and finance

Caring

Computing, technology and digital

Construction and manufacturing

Creative and media

Distribution and storage

Emergency and uniform services

Engineering

Health

Law and administration

Retail and sales

Science and research

Sports and leisure

Teaching and education

Tourism and hopitality

Trades and maintenance

Transport

{% endblock %}


text:
<?xml version="1.0" encoding="UTF-8"?>
<diff>
<paths>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\imagemap\DynamicDriveToolTipTagFragmentGenerator.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\imagemap\OverLIBToolTipTagFragmentGenerator.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\imagemap\ImageMapUtilities.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\title\LegendTitle.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\title\PaintScaleLegend.java</path>
<path
   kind="file"
   item="modified"
   props="none">jfreechart-1.0.x-branch\source\org\jfree\chart\title\TextTitle.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\demo\TimeSeriesChartDemo1.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\demo\BarChartDemo1.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\StandardChartTheme.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\MouseWheelHandler.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\annotations\XYTextAnnotation.java</path>
<path
   props="none"
   kind="file"
   item="added">jfreechart-1.0.x-branch\source\org\jfree\chart\annotations\XYAnnotationBoundsInfo.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\annotations\XYDataImageAnnotation.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\annotations\XYPointerAnnotation.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\panel\CrosshairOverlay.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\panel\Overlay.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\panel\AbstractOverlay.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\panel\package.html</path>
<path
   item="added"
   props="none"
   kind="dir">jfreechart-1.0.x-branch\source\org\jfree\chart\panel</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\RendererUtilities.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\GrayPaintScale.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\LookupPaintScale.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\xy\XYErrorRenderer.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\xy\YIntervalRenderer.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\xy\DeviationRenderer.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\xy\CandlestickRenderer.java</path>
<path
   kind="file"
   item="modified"
   props="none">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\xy\XYBoxAndWhiskerRenderer.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\xy\XYStepRenderer.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\xy\GradientXYBarPainter.java</path>
<path
   kind="file"
   item="added"
   props="none">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\xy\SamplingXYLineRenderer.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\xy\XYBarRenderer.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\xy\AbstractXYItemRenderer.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\AbstractRenderer.java</path>
<path
   kind="file"
   item="modified"
   props="none">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\category\BoxAndWhiskerRenderer.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\category\StatisticalBarRenderer.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\category\IntervalBarRenderer.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\category\AbstractCategoryItemRenderer.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\category\StackedBarRenderer3D.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\category\BarRenderer3D.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\category\LineAndShapeRenderer.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\category\CategoryItemRendererState.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\category\StatisticalLineAndShapeRenderer.java</path>
<path
   kind="file"
   item="modified"
   props="none">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\category\StackedBarRenderer.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\category\BarRenderer.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\category\ScatterRenderer.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\category\WaterfallBarRenderer.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\category\LevelRenderer.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\renderer\category\StackedAreaRenderer.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\plot\XYPlot.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\plot\CategoryPlot.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\plot\Plot.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\plot\Pannable.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\plot\FastScatterPlot.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\plot\MultiplePiePlot.java</path>
<path
   kind="file"
   item="modified"
   props="none">jfreechart-1.0.x-branch\source\org\jfree\chart\plot\dial\StandardDialScale.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\plot\Crosshair.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\event\RendererChangeEvent.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\event\OverlayChangeEvent.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\event\OverlayChangeListener.java</path>
<path
   kind="file"
   item="modified"
   props="none">jfreechart-1.0.x-branch\source\org\jfree\chart\editor\DefaultNumberAxisEditor.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\editor\DefaultPlotEditor.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\block\LabelBlock.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\JFreeChart.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\ChartPanel.java</path>
<path
   kind="file"
   item="added"
   props="none">jfreechart-1.0.x-branch\source\org\jfree\chart\labels\StandardCrosshairLabelGenerator.java</path>
<path
   kind="file"
   item="added"
   props="none">jfreechart-1.0.x-branch\source\org\jfree\chart\labels\CrosshairLabelGenerator.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\axis\CategoryAxis.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\axis\DateAxis.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\axis\NumberAxis3D.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\axis\Axis.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\axis\LogAxis.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\axis\NumberAxis.java</path>
<path
   kind="file"
   item="added"
   props="none">jfreechart-1.0.x-branch\source\org\jfree\chart\axis\DateTickUnitType.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\axis\ValueAxis.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\axis\PeriodAxis.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\axis\PeriodAxisLabelInfo.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\axis\DateTickUnit.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\axis\CategoryAxis3D.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\chart\ChartFactory.java</path>
<path
   props="none"
   kind="file"
   item="added">jfreechart-1.0.x-branch\source\org\jfree\chart\ChartTransferable.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\resources\JFreeChartResources.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\entity\AxisEntity.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\entity\JFreeChartEntity.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\entity\PlotEntity.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\entity\TitleEntity.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\chart\util\LogFormat.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\function\NormalDistributionFunction2D.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\RangeInfo.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\statistics\StatisticalCategoryDataset.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\data\time\Minute.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\time\Millisecond.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\time\TimeSeries.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\time\Second.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\time\Day.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\data\time\Hour.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\time\Month.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\time\TimeSeriesCollection.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\data\time\MovingAverage.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\data\DomainInfo.java</path>
<path
   props="none"
   kind="file"
   item="added">jfreechart-1.0.x-branch\source\org\jfree\data\category\CategoryRangeInfo.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\data\category\SlidingCategoryDataset.java</path>
<path
   kind="file"
   item="modified"
   props="none">jfreechart-1.0.x-branch\source\org\jfree\data\DataUtilities.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\xy\XYSeriesCollection.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\data\xy\IntervalXYDelegate.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\xy\XYDomainInfo.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\xy\XYSeries.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\xy\XYRangeInfo.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\general\CombinationDataset.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\source\org\jfree\data\general\SubSeriesDataset.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\general\HeatMapUtilities.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\general\DatasetUtilities.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\general\HeatMapDataset.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\source\org\jfree\data\general\CombinedDataset.java</path>
<path
   kind="file"
   item="added"
   props="none">jfreechart-1.0.x-branch\source\org\jfree\data\general\DefaultHeatMapDataset.java</path>
<path
   kind="file"
   item="modified"
   props="none">jfreechart-1.0.x-branch\ant\build-swt.xml</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\ant\build.xml</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\chart\panel\junit\CrosshairOverlayTests.java</path>
<path
   kind="dir"
   item="added"
   props="none">jfreechart-1.0.x-branch\tests\org\jfree\chart\panel\junit</path>
<path
   kind="dir"
   item="added"
   props="none">jfreechart-1.0.x-branch\tests\org\jfree\chart\panel</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\chart\imagemap\junit\ImageMapPackageTests.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\chart\imagemap\junit\ImageMapUtilitiesTests.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\chart\imagemap\junit\DynamicDriveToolTipTagFragmentGeneratorTests.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\chart\imagemap\junit\OverLIBToolTipTagFragmentGeneratorTests.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\tests\org\jfree\chart\labels\junit\StandardCategoryItemLabelGeneratorTests.java</path>
<path
   kind="file"
   item="modified"
   props="none">jfreechart-1.0.x-branch\tests\org\jfree\chart\axis\junit\AxisTests.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\tests\org\jfree\chart\axis\junit\PeriodAxisTests.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\tests\org\jfree\chart\renderer\xy\junit\XYErrorRendererTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\chart\renderer\junit\RendererUtilitiesTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\chart\renderer\junit\GrayPaintScaleTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\chart\renderer\junit\AbstractRendererTests.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\tests\org\jfree\chart\renderer\category\junit\StackedBarRenderer3DTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\chart\renderer\category\junit\WaterfallBarRendererTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\chart\renderer\category\junit\StackedAreaRendererTests.java</path>
<path
   kind="file"
   item="modified"
   props="none">jfreechart-1.0.x-branch\tests\org\jfree\chart\renderer\category\junit\BoxAndWhiskerRendererTests.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\tests\org\jfree\chart\junit\ChartPanelTests.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\tests\org\jfree\chart\junit\JFreeChartTestSuite.java</path>
<path
   kind="file"
   item="modified"
   props="none">jfreechart-1.0.x-branch\tests\org\jfree\chart\block\junit\LabelBlockTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\chart\annotations\junit\CategoryLineAnnotationTests.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\tests\org\jfree\chart\annotations\junit\XYTextAnnotationTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\chart\util\junit\LogFormatTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\chart\plot\junit\CombinedDomainXYPlotTests.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\tests\org\jfree\chart\plot\junit\PlotPackageTests.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\chart\plot\junit\CrosshairTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\chart\plot\junit\XYPlotTests.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\tests\org\jfree\chart\plot\junit\CategoryPlotTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\chart\plot\junit\FastScatterPlotTests.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\tests\org\jfree\data\xy\junit\XYSeriesCollectionTests.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\tests\org\jfree\data\xy\junit\XYSeriesTests.java</path>
<path
   kind="file"
   item="modified"
   props="none">jfreechart-1.0.x-branch\tests\org\jfree\data\junit\DataUtilitiesTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\data\category\junit\DefaultIntervalCategoryDatasetTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\data\category\junit\SlidingCategoryDatasetTests.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\tests\org\jfree\data\general\junit\DatasetUtilitiesTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\data\general\junit\DataGeneralPackageTests.java</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\data\general\junit\DefaultHeatMapDatasetTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\data\time\junit\DayTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\data\time\junit\HourTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\data\time\junit\MinuteTests.java</path>
<path
   kind="file"
   item="modified"
   props="none">jfreechart-1.0.x-branch\tests\org\jfree\data\time\junit\MillisecondTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\data\time\junit\TimeSeriesTests.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\tests\org\jfree\data\time\junit\SecondTests.java</path>
<path
   item="deleted"
   props="none"
   kind="file">jfreechart-1.0.x-branch\lib\iText-2.1.3.jar</path>
<path
   item="deleted"
   props="none"
   kind="file">jfreechart-1.0.x-branch\lib\jcommon-1.0.15.jar</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\lib\iText-2.1.5.jar</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\lib\jcommon-1.0.16.jar</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\nbproject\project.properties</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\nbproject\project.xml</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\nbproject\genfiles.properties</path>
<path
   item="added"
   props="none"
   kind="file">jfreechart-1.0.x-branch\nbproject\build-impl.xml</path>
<path
   item="added"
   props="none"
   kind="dir">jfreechart-1.0.x-branch\nbproject</path>
<path
   kind="file"
   item="modified"
   props="none">jfreechart-1.0.x-branch\ChangeLog</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\README.txt</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\NEWS</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\experimental\org\jfree\experimental\chart\demo\CombinedXYPlotDemo1.java</path>
<path
   props="none"
   kind="file"
   item="modified">jfreechart-1.0.x-branch\swt\org\jfree\experimental\chart\swt\demo\SWTMultipleAxisDemo1.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\swt\org\jfree\experimental\chart\swt\demo\SWTTimeSeriesDemo.java</path>
<path
   item="modified"
   props="none"
   kind="file">jfreechart-1.0.x-branch\swt\org\jfree\experimental\swt\SWTGraphics2D.java</path>
<path
   props="none"
   kind="file"
   item="added">jfreechart-1.0.x-branch\nbbuild.xml</path>
</paths>
</diff>


text:
// Copyright (C) 2014 dot42
//
// Original filename: Android.Nfc.Cardemulation.cs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma warning disable 1717
namespace Android.Nfc.Cardemulation
{
		/// <java-name>
		/// android/nfc/cardemulation/CardEmulation
		/// </java-name>
		[Dot42.DexImport("android/nfc/cardemulation/CardEmulation", AccessFlags = 49)]
		public sealed partial class CardEmulation
 /* scope: __dot42__ */
		{
				/// <java-name>
				/// ACTION_CHANGE_DEFAULT
				/// </java-name>
				[Dot42.DexImport("ACTION_CHANGE_DEFAULT", "Ljava/lang/String;", AccessFlags = 25)]
				public const string ACTION_CHANGE_DEFAULT = "android.nfc.cardemulation.action.ACTION_CHANGE_DEFAULT";
				/// <java-name>
				/// EXTRA_CATEGORY
				/// </java-name>
				[Dot42.DexImport("EXTRA_CATEGORY", "Ljava/lang/String;", AccessFlags = 25)]
				public const string EXTRA_CATEGORY = "category";
				/// <java-name>
				/// EXTRA_SERVICE_COMPONENT
				/// </java-name>
				[Dot42.DexImport("EXTRA_SERVICE_COMPONENT", "Ljava/lang/String;", AccessFlags = 25)]
				public const string EXTRA_SERVICE_COMPONENT = "component";
				/// <java-name>
				/// CATEGORY_PAYMENT
				/// </java-name>
				[Dot42.DexImport("CATEGORY_PAYMENT", "Ljava/lang/String;", AccessFlags = 25)]
				public const string CATEGORY_PAYMENT = "payment";
				/// <java-name>
				/// CATEGORY_OTHER
				/// </java-name>
				[Dot42.DexImport("CATEGORY_OTHER", "Ljava/lang/String;", AccessFlags = 25)]
				public const string CATEGORY_OTHER = "other";
				/// <java-name>
				/// SELECTION_MODE_PREFER_DEFAULT
				/// </java-name>
				[Dot42.DexImport("SELECTION_MODE_PREFER_DEFAULT", "I", AccessFlags = 25)]
				public const int SELECTION_MODE_PREFER_DEFAULT = 0;
				/// <java-name>
				/// SELECTION_MODE_ALWAYS_ASK
				/// </java-name>
				[Dot42.DexImport("SELECTION_MODE_ALWAYS_ASK", "I", AccessFlags = 25)]
				public const int SELECTION_MODE_ALWAYS_ASK = 1;
				/// <java-name>
				/// SELECTION_MODE_ASK_IF_CONFLICT
				/// </java-name>
				[Dot42.DexImport("SELECTION_MODE_ASK_IF_CONFLICT", "I", AccessFlags = 25)]
				public const int SELECTION_MODE_ASK_IF_CONFLICT = 2;
				[Dot42.DexImport("<init>", "()V", AccessFlags = 0)]
				internal CardEmulation() /* MethodBuilder.Create */
				{
				}

				/// <java-name>
				/// getInstance
				/// </java-name>
				[Dot42.DexImport("getInstance", "(Landroid/nfc/NfcAdapter;)Landroid/nfc/cardemulation/CardEmulation;", AccessFlags = 41)]
				public static global::Android.Nfc.Cardemulation.CardEmulation GetInstance(global::Android.Nfc.NfcAdapter nfcAdapter) /* MethodBuilder.Create */
				{
						return default(global::Android.Nfc.Cardemulation.CardEmulation);
				}

				/// <java-name>
				/// isDefaultServiceForCategory
				/// </java-name>
				[Dot42.DexImport("isDefaultServiceForCategory", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", AccessFlags = 1)]
				public bool IsDefaultServiceForCategory(global::Android.Content.ComponentName componentName, string @string) /* MethodBuilder.Create */
				{
						return default(bool);
				}

				/// <java-name>
				/// isDefaultServiceForAid
				/// </java-name>
				[Dot42.DexImport("isDefaultServiceForAid", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", AccessFlags = 1)]
				public bool IsDefaultServiceForAid(global::Android.Content.ComponentName componentName, string @string) /* MethodBuilder.Create */
				{
						return default(bool);
				}

				/// <java-name>
				/// getSelectionModeForCategory
				/// </java-name>
				[Dot42.DexImport("getSelectionModeForCategory", "(Ljava/lang/String;)I", AccessFlags = 1)]
				public int GetSelectionModeForCategory(string @string) /* MethodBuilder.Create */
				{
						return default(int);
				}

		}

		/// <java-name>
		/// android/nfc/cardemulation/HostApduService
		/// </java-name>
		[Dot42.DexImport("android/nfc/cardemulation/HostApduService", AccessFlags = 1057)]
		public abstract partial class HostApduService : global::Android.App.Service
 /* scope: __dot42__ */
		{
				/// <java-name>
				/// SERVICE_INTERFACE
				/// </java-name>
				[Dot42.DexImport("SERVICE_INTERFACE", "Ljava/lang/String;", AccessFlags = 25)]
				public const string SERVICE_INTERFACE = "android.nfc.cardemulation.action.HOST_APDU_SERVICE";
				/// <java-name>
				/// SERVICE_META_DATA
				/// </java-name>
				[Dot42.DexImport("SERVICE_META_DATA", "Ljava/lang/String;", AccessFlags = 25)]
				public const string SERVICE_META_DATA = "android.nfc.cardemulation.host_apdu_service";
				/// <java-name>
				/// DEACTIVATION_LINK_LOSS
				/// </java-name>
				[Dot42.DexImport("DEACTIVATION_LINK_LOSS", "I", AccessFlags = 25)]
				public const int DEACTIVATION_LINK_LOSS = 0;
				/// <java-name>
				/// DEACTIVATION_DESELECTED
				/// </java-name>
				[Dot42.DexImport("DEACTIVATION_DESELECTED", "I", AccessFlags = 25)]
				public const int DEACTIVATION_DESELECTED = 1;
				[Dot42.DexImport("<init>", "()V", AccessFlags = 1)]
				public HostApduService() /* MethodBuilder.Create */
				{
				}

				/// <java-name>
				/// onBind
				/// </java-name>
				[Dot42.DexImport("onBind", "(Landroid/content/Intent;)Landroid/os/IBinder;", AccessFlags = 17)]
				public override global::Android.Os.IBinder OnBind(global::Android.Content.Intent intent) /* MethodBuilder.Create */
				{
						return default(global::Android.Os.IBinder);
				}

				/// <java-name>
				/// sendResponseApdu
				/// </java-name>
				[Dot42.DexImport("sendResponseApdu", "([B)V", AccessFlags = 17)]
				public void SendResponseApdu(sbyte[] sByte) /* MethodBuilder.Create */
				{
				}

				/// <java-name>
				/// sendResponseApdu
				/// </java-name>
				[Dot42.DexImport("sendResponseApdu", "([B)V", AccessFlags = 17, IgnoreFromJava = true)]
				public void SendResponseApdu(byte[] @byte) /* MethodBuilder.Create */
				{
				}

				/// <java-name>
				/// notifyUnhandled
				/// </java-name>
				[Dot42.DexImport("notifyUnhandled", "()V", AccessFlags = 17)]
				public void NotifyUnhandled() /* MethodBuilder.Create */
				{
				}

				/// <java-name>
				/// processCommandApdu
				/// </java-name>
				[Dot42.DexImport("processCommandApdu", "([BLandroid/os/Bundle;)[B", AccessFlags = 1025)]
				public abstract sbyte[] ProcessCommandApdu(sbyte[] sByte, global::Android.Os.Bundle bundle) /* MethodBuilder.Create */ ;

				/// <java-name>
				/// processCommandApdu
				/// </java-name>
				[Dot42.DexImport("processCommandApdu", "([BLandroid/os/Bundle;)[B", AccessFlags = 1025, IgnoreFromJava = true)]
				public abstract byte[] ProcessCommandApdu(byte[] @byte, global::Android.Os.Bundle bundle) /* MethodBuilder.Create */ ;

				/// <java-name>
				/// onDeactivated
				/// </java-name>
				[Dot42.DexImport("onDeactivated", "(I)V", AccessFlags = 1025)]
				public abstract void OnDeactivated(int int32) /* MethodBuilder.Create */ ;

		}

		/// <java-name>
		/// android/nfc/cardemulation/OffHostApduService
		/// </java-name>
		[Dot42.DexImport("android/nfc/cardemulation/OffHostApduService", AccessFlags = 1057)]
		public abstract partial class OffHostApduService : global::Android.App.Service
 /* scope: __dot42__ */
		{
				/// <java-name>
				/// SERVICE_INTERFACE
				/// </java-name>
				[Dot42.DexImport("SERVICE_INTERFACE", "Ljava/lang/String;", AccessFlags = 25)]
				public const string SERVICE_INTERFACE = "android.nfc.cardemulation.action.OFF_HOST_APDU_SERVICE";
				/// <java-name>
				/// SERVICE_META_DATA
				/// </java-name>
				[Dot42.DexImport("SERVICE_META_DATA", "Ljava/lang/String;", AccessFlags = 25)]
				public const string SERVICE_META_DATA = "android.nfc.cardemulation.off_host_apdu_service";
				[Dot42.DexImport("<init>", "()V", AccessFlags = 1)]
				public OffHostApduService() /* MethodBuilder.Create */
				{
				}

				/// <java-name>
				/// onBind
				/// </java-name>
				[Dot42.DexImport("onBind", "(Landroid/content/Intent;)Landroid/os/IBinder;", AccessFlags = 1025)]
				public override global::Android.Os.IBinder OnBind(global::Android.Content.Intent intent) /* MethodBuilder.Create */
				{
						return default(global::Android.Os.IBinder);
				}

		}

}


text:
import Rectangle = Phaser.Rectangle;
class DrawRectangle {
    private game:Phaser.Game;
    private input:Input;
    private callback:(rects:MyDrawRectangles)=>void;
    private rects:MyDrawRectangles;

    constructor(game: Phaser.Game, input:Input, callback:(rects:MyDrawRectangles)=>void, rects?:MyDrawRectangles){
        this.game = game;
        this.input = input;
        this.callback = callback;
        if (rects) this.rects = rects;
        else this.rects = new MyDrawRectangles(game);
    }

    private mousePos():Phaser.Point{return new Phaser.Point((this.game.camera.position.x - this.game.width / 2) + this.game.input.x, (this.game.camera.position.y - this.game.height / 2) + this.game.input.y)}

    update(){
        if (this.input.isJustDown(InputType.ACTION)) this.rects.startNewRect(this.mousePos());
        else if (this.input.isJustUp(InputType.ACTION)) this.rects.addRect();
        else if (this.input.isJustDown(InputType.DELETE)) this.rects.removeLastRect();
        else if (this.input.isJustDown(InputType.ARROW_LEFT)) this.rects.moveLastRect(-1, 0);
        else if (this.input.isJustDown(InputType.ARROW_RIGHT)) this.rects.moveLastRect(1, 0);
        else if (this.input.isJustDown(InputType.ARROW_UP)) this.rects.moveLastRect(0, -1);
        else if (this.input.isJustDown(InputType.ARROW_DOWN)) this.rects.moveLastRect(0, 1);
        else if (this.input.isJustDown(InputType.ESCAPE) && this.callback) {
            this.rects.clearCurrentRect();
            this.callback(this.rects);
        }

        this.rects.draw(this.mousePos());
    }
}

class MyDrawRectangles{
    rects:Phaser.Rectangle[];
    currentRect:Phaser.Rectangle;
    graphics:Phaser.Graphics;
    inverseGraphics:Phaser.Graphics;
    color:number;
    inverseColor:number;
    private down:Phaser.Point;
    constructor(game:Phaser.Game, color:number = 0xAA0044){
        this.graphics = game.add.graphics(0, 0);
        this.inverseGraphics = game.add.graphics(0, 0);
        this.setColor(color);
        this.rects = [];
        this.currentRect = null;
    }

    private updateCurrentRect(mousePosition:Phaser.Point){
        this.currentRect.width = Math.abs(this.down.x - mousePosition.x);
        this.currentRect.height = Math.abs(this.down.y - mousePosition.y);

        if (mousePosition.x < this.down.x) this.currentRect.x = mousePosition.x;
        else this.currentRect.x = mousePosition.x - this.currentRect.width;

        if (mousePosition.y < this.down.y) this.currentRect.y = mousePosition.y;
        else this.currentRect.y = mousePosition.y - this.currentRect.height;
    }

    draw(mousePosition?:Phaser.Point){
        this.graphics.clear();
        this.graphics.lineStyle(2, this.color);
        this.rects.forEach((rect)=>{
            this.graphics.drawRect(rect.x, rect.y, rect.width, rect.height);
        });
        if(this.currentRect && mousePosition) {
            this.updateCurrentRect(mousePosition);
            this.inverseGraphics.clear();
            this.inverseGraphics.lineStyle(2, this.inverseColor);
            this.inverseGraphics.drawRect(this.currentRect.x, this.currentRect.y, this.currentRect.width, this.currentRect.height);
        }
    }

    setColor(color:number){
        this.color = color;
        this.inverseColor = Phaser.Color.getColor(
            255 - Phaser.Color.getRed(this.color),
            255 - Phaser.Color.getGreen(this.color),
            255 - Phaser.Color.getBlue(this.color)
        );
    }

    startNewRect(down:Phaser.Point){
        if (!this.currentRect) {
            this.down = down;
            this.currentRect = new Rectangle(0, 0, 0, 0);
        }
    }

    addRect(){
        if (this.currentRect){
            this.rects.push(this.currentRect);
            this.clearCurrentRect();
        }
    }

    removeLastRect(){
        if (this.rects.length > 0) this.rects.splice(this.rects.length - 1, 1);
    }

    clearCurrentRect(){
        this.currentRect = null;
        this.down = null;
        this.inverseGraphics.clear();
    }

    moveLastRect(x:number, y:number){
        if (this.rects.length > 0){
            var r = this.rects[this.rects.length - 1];
            r.x += x;
            r.y += y;
        }
    }

    rotate(degrees:number, rotationPoint:Phaser.Point){
        var steps = Math.round(degrees / 90);
        if (steps === 0 || steps % 4 === 0) return; // noop
        var shouldStretchRect = steps % 2 !== 0;
        var shouldReflectRect = steps / 2 === 0;
        this.rects.forEach((rect:Phaser.Rectangle) => {
            var p = new Phaser.Point(rect.x, rect.y);
            p.rotate(rotationPoint.x, rotationPoint.y, degrees, true);
            rect.x = p.x;
            rect.y = p.y;
            if (shouldStretchRect){
                var w = rect.width;
                var h = rect.height;
                rect.width = h;
                rect.height = w;
            }
            if (shouldReflectRect){
                rect.x -= rect.width;
                rect.y -= rect.height;
            } else if (steps < 0) rect.y -= rect.height;
            else rect.x -= rect.width;
        });
        this.draw();
    }
}


text:
.video {
  background: rgb(27, 32, 34) !important;
  border-color: transparent !important;
  display: block !important;
}

.heroContainer {
  height: 30vh;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  background-size: cover;
  background-position: center;
  margin-bottom: 10px;
}
.iframe {
  width: 100%;
  height: 30vh;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  margin-bottom: 10px;
  background-color: #000;
}
:global(.ion-play) {
  width: 100px;
  height: 100px;
  border-radius: 50px;
  background-color: #1b1ddf;
  color: #fff;
  font-size: 55px;
  text-indent: 10px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  cursor: pointer;
  opacity: 0.9;
}
:global(.ion-play):hover {
  opacity: 0.7;
}
:global(.ion-play):active {
  opacity: 0.5;
}
.infoContainer {
  z-index: 1;
  position: relative;
  padding: 10px 15px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  border-top: 1px solid rgba(50, 50, 60, 1);
  background: rgb(35, 40, 42);
}
.videoTitle {
  color: #c8c8c8;
  font-family: Montserrat;
  font-size: 22px;
  text-shadow: 1px 1px 1px #000;
}
.infoRow {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
      -ms-flex-direction: row;
          flex-direction: row;
  -webkit-box-align: baseline;
      -ms-flex-align: baseline;
          align-items: baseline;
}
.category {
  background-color: #1b1ddf;
  opacity: 0.75;
  width: 190px;
  height: 24px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  margin-top: 15px;
}
.category span {
  color: #fff;
  font-family: Montserrat;
  font-size: 17px;
  text-shadow: 1px 1px 1px #000;
}
.byText {
  color: #afafaf;
  font-family: sans-serif;
  font-size: 14px;
  margin-left: 15px;
}
.separator {
  margin: 15px 0;
  height: 1px;
  background: #323232;
}
.tipTitle {
  font-size: 22px;
  font-weight: normal;
  font-family: Montserrat;
  color: #fff;
  text-shadow: 1px 1px 1px rgba(4,10,40,0.6);
  margin-bottom: 15px;
}
.tip {
  font-size: 14px;
  font-weight: normal;
  font-family: sans-serif;
  color: #dcdcdc;
  margin-bottom: 7px;
}

a {
  text-decoration: none;
}


text:
<?php

namespace Aisel\ResourceBundle\Utility;

/**
 * Password generator
 *
 * @author Ivan Proskuryakov <volgodark@gmail.com>
 */
class PasswordUtility
{

    /**
     * Generate password string
     *
     * @param int $length
     *
     * @return string $password
     */
    public function generatePassword($length = 8)
    {
        $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?";
        $password = substr(str_shuffle($chars), 0, $length);

        return $password;
    }

}


text:
source ./MemBashed.bash

    # connection + version
    echo -en "[+] Checking version of MemCached on ${HOST}:${PORT}... "
    VERSION=$(m_version|cut -d' ' -f2)
    echo "done"
    echo -e "[+] Server has version ${VERSION}."

    echo -en "[+] Let's raise an error... "
    m_touch NOVAR 1

    # send raw commands
    echo "[+] Send raw command: TEST with TTL of 3 with DATA ABCD."
    m_custom_cmd "set TEST 0 3 4\r\nABCD"

    # wait for TEST to expire
    echo "[+] Get TEST the following 4 seconds."
    for t in $(seq 0 3);
    do
        echo -n "  RETRIEVED: "
        m_get TEST
        sleep 1
    done

    # Try to add to non existing key
    RES=$(m_set var6 abcd)
    printf "\n[+] Add var6 abcd : %s\n" $RES

    # Let's play with prepend and append
    echo "[+] Set key EXPANDABLE with value 456."
    m_set EXPENDABLE 456
    echo "[+] Prepend 123 to EXPANDABLE."
    m_prepend EXPENDABLE 123
    echo "[+] Append 7890 to EXPANDABLE."
    m_append EXPENDABLE 7890
    # and show the result
    m_get EXPENDABLE

    m_set COUNTER 0

    # and lets count
    for i in $(seq 1 5);
    do
        m_incr COUNTER $i;
        m_get COUNTER
    done

    for i in $(seq 1 6);
    do
        m_decr COUNTER $i;
        m_get COUNTER
    done

    m_delete COUNTER
    m_decr COUNTER 1


text:
package com.fourty_eight_dps.marclay.core.util;

import android.app.Notification;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.service.notification.StatusBarNotification;

public final class NotificationUtil {

  /**
   * List of preferred icons from top to bottom.
   *

   *
Remote View Bitmap

   *
Large Icon

   *
Application Icon

   *

   */
  public static Bitmap getLargestImage(Context context, StatusBarNotification sbn) {
    //Bitmap bigPicture = (Bitmap) notification.extras.get(Notification.EXTRA_PICTURE);
    // Example 192 x 192
    Notification notification = sbn.getNotification();
    Bitmap largeIcon = notification.largeIcon;

    if (largeIcon != null) {
      return largeIcon;
    } else {
      return getNotificationIcon(context, sbn);
    }
  }

  public static Bitmap getLauncherIcon(Context context, StatusBarNotification sbn) {
    try {
      String packageName = sbn.getPackageName();
      PackageManager packageManager = context.getPackageManager();
      Drawable iconDrawable = packageManager.getApplicationIcon(packageName);
      if (iconDrawable instanceof BitmapDrawable) {
        BitmapDrawable bitmapDrawable = (BitmapDrawable) iconDrawable;
        return bitmapDrawable.getBitmap();
      }
    } catch (Exception ignored) {}
    return null;
  }

  public static String getAppplicationName(Context context, StatusBarNotification sbn) {
    try {
      PackageManager packageManager = context.getPackageManager();
      ApplicationInfo applicationInfo = packageManager.getApplicationInfo(sbn.getPackageName(), 0);
      return packageManager.getApplicationLabel(applicationInfo).toString();
    } catch (PackageManager.NameNotFoundException ignored) {}
    return "";
  }

  private static Bitmap getNotificationIcon(Context context, StatusBarNotification sbn) {
    Resources resources;
    try {
      resources = context.getPackageManager().getResourcesForApplication(sbn.getPackageName());
      return BitmapFactory.decodeResource(resources, sbn.getNotification().icon);
    } catch (PackageManager.NameNotFoundException ignored) {}
    return null;
  }
}


text:
/* global it, describe, before, context, cy, Cypress */

import R from 'ramda';
import Faker from 'faker';
import defaults from '../../../defaults';
import {
  wrapOrderAssertations,
} from '../../../utils';
import Magento from '../../lib/operator';
import Api from '../../../pay/lib/operator';

Faker.locale = 'es';

const mock = (data) => (R.merge(
  data,
  {
    firstName: 'MESSI',
    lastName: 'LIONEL ANDRES',
    document: '23-33016244-9',
    documentType: 'CUIL',
    documentTypeId: 'ARG_CUIL',
    address: Faker.address.streetName(),
    city: Faker.address.city(),
    state: 'Catamarca',
    stateId: 'K',
    zipcode: Faker.address.zipCode(),
    phone: Faker.phone.phoneNumberFormat(2),
    email: Faker.internet.email(),
    country: 'Argentina',
    countryId: 'AR',
  }
));

let api;
let magento;

describe('Shopping', () => {
  before(() => {
    api = new Api(cy);
    magento = new Magento(cy);

    magento.setupPlugin();
  });

  context('Argentina', () => {
    context('Efectivo', () => {
      it('can buy `blue horizons bracelets` using Rapipago to personal', () => {
        magento.buyBlueHorizonsBraceletsWithEfectivoToPersonal(mock(
          {
            paymentMethod: defaults.pay.api.DEFAULT_VALUES.paymentMethods.ar.efectivo.types.rapipago,
          }
        ));
      });

      it('can buy `blue horizons bracelets` using Pagofacil to personal', () => {
        magento.buyBlueHorizonsBraceletsWithEfectivoToPersonal(mock(
          {
            paymentMethod: defaults.pay.api.DEFAULT_VALUES.paymentMethods.ar.efectivo.types.pagofacil,
          }
        ));
      });

      it('can buy `blue horizons bracelets` using OtrosCupones to personal', () => {
        magento.buyBlueHorizonsBraceletsWithEfectivoToPersonal(mock(
          {
            paymentMethod: defaults.pay.api.DEFAULT_VALUES.paymentMethods.ar.efectivo.types.otrosCupones,
          }
        ));
      });
    });

    context('Credit Card', () => {
      it('can buy `blue horizons bracelets` using credit card', () => {
        const checkoutData = mock({
          paymentMethod: defaults.pay.api.DEFAULT_VALUES.paymentMethods.ar.creditcard.id,
          card: {
            name: Faker.name.findName(),
            number: defaults._globals.cardsWhitelist.mastercard,
            expiryYear: '2028',
            expiryMonth: '12',
            cvv: '123',
          },
        });

        magento.buyBlueHorizonsBraceletsWithCreditCardToPersonal(checkoutData, (resp) => {
          api.queryPayment(resp.hash, Cypress.env('DEMO_INTEGRATION_KEY'), (payment) => {
            const checkoutPayment = Api.paymentData({
              amount_ext: (Cypress.env('DEMO_SHIPPING_RATE') + Cypress.env('BLUE_HORIZONS_BRACELETS_PRICE')).toFixed(2),
              payment_type_code: 'mastercard',
              instalments: '1',
              status: 'CO',
            });

            wrapOrderAssertations(payment, checkoutPayment, Api.customerData(checkoutData));
          });
        });
      });
      it('can buy `blue horizons bracelets` using credit card and 7-digit-DNI document', () => {
           const checkoutData = mock({
               documentType: 'DNI',
               documentTypeId: 'ARG_DNI',
               document: '1234567',
               paymentMethod: defaults.pay.api.DEFAULT_VALUES.paymentMethods.ar.creditcard.id,
               card: {
                   name: Faker.name.findName(),
                   number: defaults._globals.cardsWhitelist.mastercard,
                   expiryYear: '2028',
                   expiryMonth: '12',
                   cvv: '123',
               },
           });

           magento.buyBlueHorizonsBraceletsWithCreditCardToPersonal(checkoutData, (resp) => {
               api.queryPayment(resp.hash, Cypress.env('DEMO_INTEGRATION_KEY'), (payment) => {
                   const checkoutPayment = Api.paymentData({
                       amount_ext: (Cypress.env('DEMO_SHIPPING_RATE') + Cypress.env('BLUE_HORIZONS_BRACELETS_PRICE')).toFixed(2),
                       payment_type_code: 'mastercard',
                        instalments: '1',
                       status: 'CO',
                   });

                   wrapOrderAssertations(payment, checkoutPayment, Api.customerData(checkoutData));
               });
           });
       });
       it('can buy `blue horizons bracelets` using credit card and 8-digit-DNI document', () => {
           const checkoutData = mock({
               documentType: 'DNI',
               documentTypeId: 'ARG_DNI',
               document: '12345678',
               paymentMethod: defaults.pay.api.DEFAULT_VALUES.paymentMethods.ar.creditcard.id,
               card: {
                   name: Faker.name.findName(),
                   number: defaults._globals.cardsWhitelist.mastercard,
                   expiryYear: '2028',
                   expiryMonth: '12',
                   cvv: '123',
               },
           });

           magento.buyBlueHorizonsBraceletsWithCreditCardToPersonal(checkoutData, (resp) => {
               api.queryPayment(resp.hash, Cypress.env('DEMO_INTEGRATION_KEY'), (payment) => {
                   const checkoutPayment = Api.paymentData({
                       amount_ext: (Cypress.env('DEMO_SHIPPING_RATE') + Cypress.env('BLUE_HORIZONS_BRACELETS_PRICE')).toFixed(2),
                       payment_type_code: 'mastercard',
                       instalments: '1',
                       status: 'CO',
                   });

                   wrapOrderAssertations(payment, checkoutPayment, Api.customerData(checkoutData));
               });
           });
        });
    });
  });
});


text:
set -e

SCRIPT_DIR="$( dirname "$( readlink -f "${BASH_SOURCE[0]}" )" )"
source "$SCRIPT_DIR/build_utils.sh"

fetch_python() {
    if [ -d cpython ]; then
        ( cd cpython && update_repository )
    else
        hg clone http://hg.python.org/cpython
        (
            cd cpython
            hg checkout 2.7
        )
    fi
}

configure_python() {
    cflags=$1
    ldflags=$2

    # We create an extra build folder for python, because python's "make clean"
    # removes all object files under the build folder. This means we can't keep
    # the state folder there.
    mkdir build
    (
        cd build
        ../../cpython/configure \
            --without-pymalloc --disable-shared --disable-ipv6 \
            CC="$(which asap-clang)" \
            CXX="$(which asap-clang++)" \
            AR="$(which asap-ar)" \
            RANLIB="$(which asap-ranlib)" \
            CFLAGS="$cflags" LDFLAGS="$ldflags"
    )
}

build_python() {
    (
        cd build
        make clean
        make -j "$N_JOBS" all
    )
}

test_python() {
    ./build/python -m test.regrtest -j "$N_JOBS" -x \
    test_exceptions test_json test_marshal test_runpy test_ctypes \
    test_descr test_io test_unicode \
        || true
}

configure_and_build_python() {
    configure_python "$@"
    build_python
}

build_and_test_python() {
    build_python
    test_python
}

fetch_python

build_asap_initial "cpython" "baseline" "configure_and_build_python" "-O3" ""
build_asap_initial "cpython" "asan" "configure_and_build_python" "-O3 -fsanitize=address" "-fsanitize=address"

for tool in "asan"; do
    build_asap_coverage "cpython" "$tool" "build_and_test_python"

    build_asap_optimized "cpython" "$tool" "s0000" "-asap-sanity-level=0.000" "build_python"
    build_asap_optimized "cpython" "$tool" "c0010" "-asap-cost-level=0.010" "build_python"
    build_asap_optimized "cpython" "$tool" "c0040" "-asap-cost-level=0.040" "build_python"
    build_asap_optimized "cpython" "$tool" "c1000" "-asap-cost-level=1.000" "build_python"
done


text:
//
// Pythagoras - a collection of geometry classes
// http://github.com/samskivert/pythagoras

package pythagoras.d;

/**
 * Provides read-only access to a {@link Rectangle}.
 */
public interface IRectangle extends IRectangularShape, Cloneable
{
    /** The bitmask that indicates that a point lies to the left of this rectangle. See
     * {@link #outcode}. */
    int OUT_LEFT = 1;

    /** The bitmask that indicates that a point lies above this rectangle. See {@link #outcode}. */
    int OUT_TOP = 2;

    /** The bitmask that indicates that a point lies to the right of this rectangle. See
     * {@link #outcode}. */
    int OUT_RIGHT = 4;

    /** The bitmask that indicates that a point lies below this rectangle. See {@link #outcode}. */
    int OUT_BOTTOM = 8;

    /** Returns a copy of this rectangle's upper-left corner. */
    Point location ();

    /** Initializes the supplied point with this rectangle's upper-left corner.
     * @return the supplied point. */
    Point location (Point target);

    /** Returns a copy of this rectangle's size. */
    Dimension size ();

    /** Initializes the supplied dimension with this rectangle's size.
     * @return the supplied dimension. */
    Dimension size (Dimension target);

    /** Returns the intersection of the specified rectangle and this rectangle (i.e. the largest
     * rectangle contained in both this and the specified rectangle). */
    Rectangle intersection (double rx, double ry, double rw, double rh);

    /** Returns the intersection of the supplied rectangle and this rectangle (i.e. the largest
     * rectangle contained in both this and the supplied rectangle). */
    Rectangle intersection (IRectangle r);

    /** Returns the union of the supplied rectangle and this rectangle (i.e. the smallest rectangle
     * that contains both this and the supplied rectangle). */
    Rectangle union (IRectangle r);

    /** Returns true if the specified line segment intersects this rectangle. */
    boolean intersectsLine (double x1, double y1, double x2, double y2);

    /** Returns true if the supplied line segment intersects this rectangle. */
    boolean intersectsLine (ILine l);

    /** Returns a set of flags indicating where the specified point lies in relation to the bounds
     * of this rectangle. See {@link #OUT_LEFT}, etc. */
    int outcode (double px, double py);

    /** Returns a set of flags indicating where the supplied point lies in relation to the bounds of
     * this rectangle. See {@link #OUT_LEFT}, etc. */
    int outcode (IPoint point);

    /** Returns a mutable copy of this rectangle. */
    Rectangle clone ();
}


text:
require_relative 'base'

module Mv
  module Core
    module Validation
      module Builder
        class Inclusion < Base
          delegate :in, to: :validation

          def conditions
            [{
              statement: apply_allow_nil_and_blank(apply_in(column_reference)),
              message: message
            }]
          end

          protected

          def db_value value
            return value if value.is_a?(Integer) or value.is_a?(Float)
            return "'#{value.to_s}'" if value.is_a?(String)
            raise Mv::Core::Error.new(table_name: table_name,
                                      column_name: column_name,
                                      validation_type: :inclusion,
                                      options: { in: value },
                                      error: "#{value.class} is not supported as :in value")
          end

          def apply_in stmt
            if self.in.is_a?(Range)
              "#{stmt} BETWEEN #{db_value(self.in.min)} AND #{db_value(self.in.max)}"
            else
              prepared_in = self.in.to_a.collect{ |v| db_value(v) }

              "#{stmt} IN (#{prepared_in.join(', ')})"
            end
          end
        end
      end
    end
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
 Copyright (c) 2015 Ngewi Fet <ngewif@gmail.com>

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

        <item android:id="@android:id/background">
            <shape>
                <stroke android:width="1dp" android:color="#D0CFCC"  />
                <solid android:color="#D0CFCC" />
                <corners android:radius="3dp" />
            </shape>

        </item>

    <item android:id="@android:id/secondaryProgress">
        <clip>
            <shape>
                <gradient
                    android:startColor="#234"
                    android:centerColor="#234"
                    android:centerY="0.75"
                    android:endColor="#a24"
                    android:angle="270"
                    />
            </shape>
        </clip>
    </item>

    <item android:id="@android:id/progress">
        <clip>
            <shape>
                <gradient
                    android:startColor="#319d67"
                    android:centerColor="#ee8600"
                    android:centerY="0.75"
                    android:endColor="#e00404"
                    android:angle="0"
                    />
            </shape>
        </clip>
    </item>

</layer-list>


text:
namespace boost {
namespace BOOST_FOREACH = foreach;
}
#define foreach BOOST_FOREACH
#endif

#if !defined(HAVE_CXX11_NULLPTR)
#undef nullptr
#define nullptr NULL
#endif

#if !defined(HAVE_CXX11_STATIC_ASSERT)
#include <boost/static_assert.hpp>
#undef static_assert
#if defined(__GNUC__) || defined(__clang__)
#define static_assert(cond, msg) BOOST_STATIC_ASSERT_MSG(( \
    cond), (msg)) __attribute__((unused))
#else
#define static_assert(cond, msg) BOOST_STATIC_ASSERT_MSG((cond), (msg))
#endif
#endif  // HAVE_CXX11_STATIC_ASSERT

#if defined(_MSC_VER) && _MSC_VER < 1800
#define va_copy(dest, src) ((dest) = (src))
#endif

#endif  // BENCHMARK_INTERNAL_MACROS_H_


text:
import lib.record_rate
import lib.commonclient
import lib.getconfig
import lib.puylogger
import lib.basecheck
import json

chronos_url = lib.getconfig.getparam('Mesos-Chronos', 'stats')
check_type = 'chronos'

class Check(lib.basecheck.CheckBase):

    def precheck(self):
        try:
            chronos_stats = lib.commonclient.httpget(__name__, chronos_url)
            stats_json = json.loads(chronos_stats)
            gauges = ('jvm.memory.heap.committed', 'jvm.memory.heap.used', 'jvm.memory.non-heap.committed', 'jvm.memory.non-heap.used',
                      'jvm.threads.count', 'jvm.threads.daemon.count', 'jvm.threads.new.count', 'jvm.threads.runnable.count')

            for k in stats_json['gauges'].keys():
                if 'jvm.gc' in k:
                    gcgc = k.split('.')
                    if 'count' in k:
                        self.local_vars.append({'name': 'mesos_chronos_gc_collections', 'timestamp': self.timestamp, 'value': float(stats_json['gauges'][k]['value']), 'check_type': check_type, 'extra_tag': {'gctype': gcgc[2].lower().replace(' ', '_')}})
                    if 'time' in k:
                        self.local_vars.append({'name': 'mesos_chronos_gc_duration', 'timestamp': self.timestamp, 'value': float(stats_json['gauges'][k]['value']), 'check_type': check_type, 'extra_tag': {'gctype': gcgc[2].lower().replace(' ', '-')}})

            for gauge in gauges:
                fsto = gauge.replace('chronos.', '').\
                    replace('.gauge', '').\
                    replace('jvm.memory.heap', 'heap'). \
                    replace('jvm.memory.non-heap', 'nonheap'). \
                    replace('.bytes', ''). \
                    replace('.count', ''). \
                    replace('.', '_').replace('-', '_')
                self.local_vars.append({'name': 'mesos_chronos_' + fsto, 'timestamp': self.timestamp, 'value': stats_json['gauges'][gauge]['value'], 'check_type': check_type})
            counters = ('jobs.run.success', 'jobs.run.failure')
            for ctr in stats_json['counters'].keys():
                if 'jobs.run.success' in ctr:
                    self.local_vars.append({'name': 'mesos_chronos_jobs_success', 'timestamp': self.timestamp, 'value': float(stats_json['counters'][ctr]['count']), 'check_type': check_type, 'extra_tag': {'chronos_jobname': ctr.split('.')[3].replace(' ', '_')}})
                if 'jobs.run.failure' in ctr:
                    self.local_vars.append({'name': 'mesos_chronos_jobs_failure', 'timestamp': self.timestamp, 'value': float(stats_json['counters'][ctr]['count']), 'check_type': check_type, 'extra_tag': {'chronos_jobname': ctr.split('.')[3].replace(' ', '_')}})

        except Exception as e:
            lib.puylogger.print_message(__name__ + ' Error : ' + str(e))
            pass


text:
package org.schedoscope.dsl

/**
  * Something that can carry optional comments.
  */
trait Commentable {
  /**
    * An optional comment about the named entity.
    */
  private var _comment: Option[String] = None

  /**
    * Return the comment
    */
  def comment = _comment

  /**
    * Provide a comment describing the named entity's purpose.
    */
  def comment(aComment: String) {
    _comment = Some(aComment)
  }
}


text:
Cdx.setup do |config|

  # Path for admin panel
  #
  # config.admin_path = 'admin'

  # Add available roles to users
  #
  # Admin role should not be removed in order
  # to get access to admin panel
  #
  config.user_available_roles = %w(admin moderator)

  # Add available codes to taxonomies
  #
  config.taxonomy_available_codes = %w(pages test)

end


text:
layout: page
title: InvalidEffectiveDate
number: 901
categories: [AvaTax Error Codes]
disqus: 1
---

## Summary

The effective date for your filing request is not valid.

## Example

```json
{
  "code": "InvalidEffectiveDate",
  "target": "Unknown",
  "details": [
    {
      "code": "InvalidEffectiveDate",
      "number": 901,
      "message": "Invalid Effective Date",
      "description": "The effective date in the Filing Request is invalid.  Please call the cycle safe api to view valid effective dates.",
      "faultCode": "Client",
      "helpLink": "http://developer.avalara.com/avatax/errors/InvalidEffectiveDate",
      "severity": "Error"
    }
  ]
}
```

## Explanation

When using the automated filing request API, you may only request filing dates in the future that are permitted by the filing frequency of the form you are attempting to file.

To request a more complex filing calendar with a different filing date, please contact Avalara Support and request a custom filing service.


text:
package org.knowm.xchange.gatecoin.dto.marketdata;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * @author sumedha
 */
public class ResponseStatus {

  private final String message;
  private final String errorCode;

  @JsonCreator
  public ResponseStatus(@JsonProperty("message") String message, @JsonProperty("errorCode") String errorCode) {
    this.message = message;
    this.errorCode = errorCode;
  }

  public String getErrorCode() {
    return errorCode;
  }

  public String getMessage() {
    return this.message;
  }

  @Override
  public String toString() {
    return String.format("ResponseStatus{message='%s', errorCode='%s'}", message, errorCode);
  }
}