text:
ctrlf
=====

A tiny library for (Nodejs/Browser) searching strings. Loose implementation of suffix trees ([DEMO](http://ajainarayanan.github.io/ctrlf/)).

API
====

```javascript
var ctrlf = require("ctrlf");

var sftree = new ctrlf();
sftree.setDomain("Sample Text string to search for");

/*
  Or the above two statements could be reset as
  var sftree = new ctrlf("Sample Text string to search for");
*/

sftree.find("search");
//Should return ["search"]

sftree.reset();

sftree.setDomain("The first line contains a single number T -- " +
  "the number of test cases (no more than 10)." +
  " Each of the next T lines contains a single non-empty string of " +
  "length no more than 100000 consisting " +
  "of lowercase Latin letters a..z. or nos");

sftree.find("no");
//Should return ["no", "non-empty", "nos"]
```

ctrlf.setDomain()
-----------------
Sets the string domain to search for. The total sample space to search for.

ctrlf.reset()
-------------
Resets the current set domain for further reuse.

ctrlf.find()
-------------
Find substring in the current search domain.

redpajama_set_name: RedPajamaGithub


text:
require 'helper'

describe Twitter::Client do
  Twitter::Configuration::VALID_FORMATS.each do |format|
    context ".new(:format => '#{format}')" do
      before do
        @client = Twitter::Client.new(:format => format, :consumer_key => 'CK', :consumer_secret => 'CS', :oauth_token => 'OT', :oauth_token_secret => 'OS')
      end

      describe ".list_create" do

        before do
          stub_post("lists/create.#{format}").
            with(:body => {:name => "presidents"}).
            to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
        end

        it "should get the correct resource" do
          @client.list_create("presidents")
          a_post("lists/create.#{format}").
            with(:body => {:name => "presidents"}).
            should have_been_made
        end

        it "should return the created list" do
          list = @client.list_create("presidents")
          list.name.should == "presidents"
        end

      end

      describe ".list_update" do

        context "with screen name passed" do

          before do
            stub_post("lists/update.#{format}").
              with(:body => {:owner_screen_name => 'sferik', :slug => "presidents", :description => "Presidents of the United States of America"}).
              to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.list_update("sferik", "presidents", :description => "Presidents of the United States of America")
            a_post("lists/update.#{format}").
              with(:body => {:owner_screen_name => 'sferik', :slug => "presidents", :description => "Presidents of the United States of America"}).
              should have_been_made
          end

          it "should return the updated list" do
            list = @client.list_update("sferik", "presidents", :description => "Presidents of the United States of America")
            list.name.should == "presidents"
          end

        end

        context "without screen name passed" do
          before do
            @client.stub!(:get_screen_name).and_return('sferik')
            stub_post("lists/update.#{format}").
              with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :description => "Presidents of the United States of America"}).
              to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.list_update("sferik", "presidents", :description => "Presidents of the United States of America")
            a_post("lists/update.#{format}").
              with(:body => {:owner_screen_name => 'sferik', :slug => 'presidents', :description => "Presidents of the United States of America"}).
              should have_been_made
          end
        end

        context "with an Integer list_id passed" do

          before do
            stub_post("lists/update.#{format}").
              with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678', :description => "Presidents of the United States of America"}).
              to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.list_update("sferik", 12345678, :description => "Presidents of the United States of America")
            a_post("lists/update.#{format}").
              with(:body => {:owner_screen_name => 'sferik', :list_id => '12345678', :description => "Presidents of the United States of America"}).
              should have_been_made
          end

        end

        context "with an Integer user_id passed" do

          before do
            stub_post("lists/update.#{format}").
              with(:body => {:owner_id => '12345678', :slug => 'presidents', :description => "Presidents of the United States of America"}).
              to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.list_update(12345678, 'presidents', :description => "Presidents of the United States of America")
            a_post("lists/update.#{format}").
              with(:body => {:owner_id => '12345678', :slug => 'presidents', :description => "Presidents of the United States of America"}).
              should have_been_made
          end

        end
      end

      describe ".lists" do

        context "with a screen name passed" do

          before do
            stub_get("lists.#{format}").
              with(:query => {:screen_name => 'sferik', :cursor => "-1"}).
              to_return(:body => fixture("lists.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.lists("sferik")
            a_get("lists.#{format}").
              with(:query => {:screen_name => 'sferik', :cursor => "-1"}).
              should have_been_made
          end

          it "should return the updated list" do
            lists = @client.lists("sferik")
            lists.lists.should be_an Array
            lists.lists.first.name.should == "Rubyists"
          end

        end

        context "with an Integer user id passed" do

          before do
            stub_get("lists.#{format}").
              with(:query => {:user_id => '12345678', :cursor => "-1"}).
              to_return(:body => fixture("lists.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.lists(12345678)
            a_get("lists.#{format}").
              with(:query => {:user_id => '12345678', :cursor => "-1"}).
              should have_been_made
          end

          it "should return the updated list" do
            lists = @client.lists(12345678)
            lists.lists.should be_an Array
            lists.lists.first.name.should == "Rubyists"
          end

        end

        context "without arguments passed" do

          before do
            stub_get("lists.#{format}").
              with(:query => {:cursor => "-1"}).
              to_return(:body => fixture("lists.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.lists
            a_get("lists.#{format}").
              with(:query => {:cursor => "-1"}).
              should have_been_made
          end

          it "should return the updated list" do
            lists = @client.lists
            lists.lists.should be_an Array
            lists.lists.first.name.should == "Rubyists"
          end

        end

      end

      describe ".list" do

        context "with a screen name passed" do

          before do
            stub_get("lists/show.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
              to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.list("sferik", "presidents")
            a_get("lists/show.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
              should have_been_made
          end

          it "should return the updated list" do
            list = @client.list("sferik", "presidents")
            list.name.should == "presidents"
          end

        end

        context "without a screen name passed" do

          before do
            @client.stub!(:get_screen_name).and_return('sferik')
            stub_get("lists/show.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
              to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.list("sferik", "presidents")
            a_get("lists/show.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
              should have_been_made
          end

        end

        context "with an Integer list_id passed" do

          before do
            stub_get("lists/show.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678'}).
              to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.list("sferik", 12345678)
            a_get("lists/show.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678'}).
              should have_been_made
          end

        end

        context "with an Integer user_id passed" do

          before do
            stub_get("lists/show.#{format}").
              with(:query => {:owner_id => '12345678', :slug => 'presidents'}).
              to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.list(12345678, 'presidents')
            a_get("lists/show.#{format}").
              with(:query => {:owner_id => '12345678', :slug => 'presidents'}).
              should have_been_made
          end

        end

      end

      describe ".list_delete" do

        context "with a screen name passed" do

          before do
            stub_delete("lists/destroy.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
              to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.list_delete("sferik", "presidents")
            a_delete("lists/destroy.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
              should have_been_made
          end

          it "should return the deleted list" do
            list = @client.list_delete("sferik", "presidents")
            list.name.should == "presidents"
          end

        end

        context "without a screen name passed" do

          before do
            @client.stub!(:get_screen_name).and_return('sferik')
            stub_delete("lists/destroy.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
              to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.list_delete("sferik", "presidents")
            a_delete("lists/destroy.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
              should have_been_made
          end

        end

        context "with an Integer list_id passed" do

          before do
            stub_delete("lists/destroy.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678'}).
              to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.list_delete("sferik", 12345678)
            a_delete("lists/destroy.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678'}).
              should have_been_made
          end

        end

        context "with an Integer user_id passed" do

          before do
            stub_delete("lists/destroy.#{format}").
              with(:query => {:owner_id => '12345678', :slug => 'presidents'}).
              to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.list_delete(12345678, 'presidents')
            a_delete("lists/destroy.#{format}").
              with(:query => {:owner_id => '12345678', :slug => 'presidents'}).
              should have_been_made
          end

        end

      end

      describe ".list_timeline" do

        context "with a screen name passed" do

          before do
            stub_get("lists/statuses.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
              to_return(:body => fixture("statuses.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.list_timeline("sferik", "presidents")
            a_get("lists/statuses.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
              should have_been_made
          end

          it "should return the tweet timeline for members of the specified list" do
            statuses = @client.list_timeline("sferik", "presidents")
            statuses.should be_an Array
            statuses.first.text.should == "Ruby is the best programming language for hiding the ugly bits."
          end

        end

        context "without a screen name passed" do

          before do
            @client.stub!(:get_screen_name).and_return('sferik')
            stub_get("lists/statuses.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
              to_return(:body => fixture("statuses.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.list_timeline("sferik", "presidents")
            a_get("lists/statuses.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :slug => 'presidents'}).
              should have_been_made
          end

          it "should return the tweet timeline for members of the specified list" do
            statuses = @client.list_timeline("sferik", "presidents")
            statuses.should be_an Array
            statuses.first.text.should == "Ruby is the best programming language for hiding the ugly bits."
          end

        end

        context "with an Integer list_id passed" do

          before do
            stub_get("lists/statuses.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678'}).
              to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.list_timeline("sferik", 12345678)
            a_get("lists/statuses.#{format}").
              with(:query => {:owner_screen_name => 'sferik', :list_id => '12345678'}).
              should have_been_made
          end

        end

        context "with an Integer user_id passed" do

          before do
            stub_get("lists/statuses.#{format}").
              with(:query => {:owner_id => '12345678', :slug => 'presidents'}).
              to_return(:body => fixture("list.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.list_timeline(12345678, 'presidents')
            a_get("lists/statuses.#{format}").
              with(:query => {:owner_id => '12345678', :slug => 'presidents'}).
              should have_been_made
          end

        end

      end

      describe ".memberships" do

        context "with a screen name passed" do

          before do
            stub_get("lists/memberships.#{format}").
              with(:query => {:screen_name => 'pengwynn', :cursor => "-1"}).
              to_return(:body => fixture("lists.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.memberships("pengwynn")
            a_get("lists/memberships.#{format}").
              with(:query => {:screen_name => 'pengwynn', :cursor => "-1"}).
              should have_been_made
          end

          it "should return the lists the specified user has been added to" do
            lists = @client.memberships("pengwynn")
            lists.lists.should be_an Array
            lists.lists.first.name.should == "Rubyists"
          end

        end

        context "without a screen name passed" do

          before do
            @client.stub!(:get_screen_name).and_return('pengwynn')
            stub_get("lists/memberships.#{format}").
              with(:query => {:screen_name => 'pengwynn', :cursor => "-1"}).
              to_return(:body => fixture("lists.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.memberships("pengwynn")
            a_get("lists/memberships.#{format}").
              with(:query => {:screen_name => 'pengwynn', :cursor => "-1"}).
              should have_been_made
          end

          it "should return the lists the specified user has been added to" do
            lists = @client.memberships("pengwynn")
            lists.lists.should be_an Array
            lists.lists.first.name.should == "Rubyists"
          end

        end

        context "with an Integer user_id passed" do

          before do
            stub_get("lists/memberships.#{format}").
              with(:query => {:user_id => '12345678', :cursor => "-1"}).
              to_return(:body => fixture("lists.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.memberships(12345678)
            a_get("lists/memberships.#{format}").
              with(:query => {:user_id => '12345678', :cursor => "-1"}).
              should have_been_made
          end

        end

      end

      describe ".subscriptions" do

        context "with a screen name passed" do

          before do
            stub_get("lists/subscriptions.#{format}").
              with(:query => {:screen_name => 'pengwynn', :cursor => "-1"}).
              to_return(:body => fixture("lists.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.subscriptions("pengwynn")
            a_get("lists/subscriptions.#{format}").
              with(:query => {:screen_name => 'pengwynn', :cursor => "-1"}).
              should have_been_made
          end

          it "should return the lists the specified user follows" do
            lists = @client.subscriptions("pengwynn")
            lists.lists.should be_an Array
            lists.lists.first.name.should == "Rubyists"
          end

        end

        context "without a screen name passed" do

          before do
            @client.stub!(:get_screen_name).and_return('pengwynn')
            stub_get("lists/subscriptions.#{format}").
              with(:query => {:screen_name => 'pengwynn', :cursor => "-1"}).
              to_return(:body => fixture("lists.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.subscriptions("pengwynn")
            a_get("lists/subscriptions.#{format}").
              with(:query => {:screen_name => 'pengwynn', :cursor => "-1"}).
              should have_been_made
          end

          it "should return the lists the specified user follows" do
            lists = @client.subscriptions("pengwynn")
            lists.lists.should be_an Array
            lists.lists.first.name.should == "Rubyists"
          end

        end

        context "with an Integer user_id passed" do

          before do
            stub_get("lists/subscriptions.#{format}").
              with(:query => {:user_id => '12345678', :cursor => "-1"}).
              to_return(:body => fixture("lists.#{format}"), :headers => {:content_type => "application/#{format}; charset=utf-8"})
          end

          it "should get the correct resource" do
            @client.subscriptions(12345678)
            a_get("lists/subscriptions.#{format}").
              with(:query => {:user_id => '12345678', :cursor => "-1"}).
              should have_been_made
          end

        end

      end

    end
  end
end


text:
namespace peloton {
namespace codegen {

// Configure/setup the aggregation class to handle the provided aggregate types
void Aggregation::Setup(
    CodeGen &codegen,
    const std::vector<planner::AggregatePlan::AggTerm> &aggregates,
    bool is_global, std::vector<type::Type> &grouping_ai_types) {
  is_global_ = is_global;

  for (uint32_t source_idx = 0; source_idx < aggregates.size(); source_idx++) {
    const auto &agg_term = aggregates[source_idx];
    switch (agg_term.aggtype) {
      case ExpressionType::AGGREGATE_COUNT:
      case ExpressionType::AGGREGATE_COUNT_STAR: {
        // Add the count to the storage layout. COUNTs are never NULL-able.
        const type::Type count_type{type::BigInt::Instance()};
        uint32_t storage_pos = storage_.AddType(count_type);

        // Add metadata for the aggregate
        AggregateInfo agg_info{agg_term.aggtype,
                               source_idx,
                               {{storage_pos}},
                               agg_term.distinct,
                               0};
        aggregate_infos_.push_back(agg_info);
        break;
      }
      case ExpressionType::AGGREGATE_SUM: {
        // Add the element to the storage layout
        auto value_type = agg_term.expression->ResultType();

        // If we're doing a global aggregation, the aggregate can potentially be
        // NULL (i.e., if there are no rows in the source table).
        if (IsGlobal()) {
          value_type = value_type.AsNullable();
        }
        uint32_t storage_pos = storage_.AddType(value_type);

        // Add metadata for the aggregate
        AggregateInfo agg_info{agg_term.aggtype,
                               source_idx,
                               {{storage_pos}},
                               agg_term.distinct,
                               0};
        aggregate_infos_.push_back(agg_info);
        break;
      }
      case ExpressionType::AGGREGATE_MIN:
      case ExpressionType::AGGREGATE_MAX: {
        // Add the element to the storage layout
        auto value_type = agg_term.expression->ResultType();

        // If we're doing a global aggregation, the aggregate can potentially be
        // NULL (i.e., if there are no rows in the source table).
        if (IsGlobal()) {
          value_type = value_type.AsNullable();
        }
        uint32_t storage_pos = storage_.AddType(value_type);

        // Add metadata for the aggregate
        AggregateInfo agg_info{agg_term.aggtype,
                               source_idx,
                               {{storage_pos}},
                               agg_term.distinct,
                               0};
        aggregate_infos_.push_back(agg_info);
        break;
      }
      case ExpressionType::AGGREGATE_AVG: {
        // We decompose averages into separate SUM() and COUNT() components

        // SUM() - the type must match the type of the expression
        PELOTON_ASSERT(agg_term.expression != nullptr);
        auto sum_type = agg_term.expression->ResultType();
        if (IsGlobal()) {
          sum_type = sum_type.AsNullable();
        }
        uint32_t sum_storage_pos = storage_.AddType(sum_type);

        // COUNT() - can use big integer since we're counting instances
        uint32_t count_storage_pos = storage_.AddType(type::BigInt::Instance());

        // Add metadata for the aggregate
        AggregateInfo agg_info{agg_term.aggtype,
                               source_idx,
                               {{sum_storage_pos, count_storage_pos}},
                               agg_term.distinct,
                               0};
        aggregate_infos_.push_back(agg_info);
        break;
      }
      default: {
        std::string message = StringUtil::Format(
            "Unexpected aggregate type [%s] when preparing aggregator",
            ExpressionTypeToString(agg_term.aggtype).c_str());
        LOG_ERROR("%s", message.c_str());
        throw Exception{ExceptionType::UNKNOWN_TYPE, message};
      }
    }
  }

  // Create hash tables for distinct aggregates
  for (auto &agg_info : aggregate_infos_) {
    if (agg_info.aggregate_type == ExpressionType::AGGREGATE_MIN ||
        agg_info.aggregate_type == ExpressionType::AGGREGATE_MAX) {
      // It doesn't pay off for MIN/MAX to use a hash table for distinct values,
      // since applying the MIM/MAX instruction every time is cheaper - so skip
      // the distinct part
      agg_info.is_distinct = false;
      continue;
    }

    if (!agg_info.is_distinct) {
      // No hash tables needed for non-distinct aggregates
      continue;
    }

    // Register the hash-table instance in the runtime state
    auto hash_table_id = query_state_.RegisterState(
        "agg_hash" + std::to_string(agg_info.source_index),
        OAHashTableProxy::GetType(codegen));

    // Prepare the hash keys
    // if not global, start with grouping keys, then add aggregation key
    std::vector<type::Type> key_type;
    if (!IsGlobal()) {
      key_type = grouping_ai_types;
    }
    key_type.push_back(
        aggregates[agg_info.source_index].expression->ResultType());

    // Create the hash table. We don't need to save any values, hence the zero
    // payload value size.
    auto hash_table = OAHashTable{codegen, key_type, 0};

    hash_table_infos_.emplace_back(std::move(hash_table), hash_table_id);

    // Add index to the aggregation_info struct
    agg_info.hast_table_index =
        static_cast<uint32_t>(hash_table_infos_.size() - 1);
  }

  // Finalize the storage format
  storage_.Finalize(codegen);
}

// Setup the aggregation to handle the provided aggregates
void Aggregation::Setup(
    CodeGen &codegen,
    const std::vector<planner::AggregatePlan::AggTerm> &agg_terms,
    bool is_global) {
  PELOTON_ASSERT(is_global);
  // Create empty vector and hand the reference to the actual implementation
  // makes it easier to call this function without providing grouping keys
  std::vector<type::Type> empty;
  Setup(codegen, agg_terms, is_global, empty);
}

// Codegen any initialization work for the hash tables
void Aggregation::InitializeQueryState(CodeGen &codegen) {
  for (auto hash_table_info : hash_table_infos_) {
    auto &hash_table = hash_table_info.first;
    auto hash_table_id = hash_table_info.second;
    hash_table.Init(codegen, query_state_.LoadStatePtr(codegen, hash_table_id));
  }
}

// Cleanup by destroying the aggregation hash tables
void Aggregation::TearDownQueryState(CodeGen &codegen) {
  for (auto hash_table_info : hash_table_infos_) {
    auto &hash_table = hash_table_info.first;
    auto hash_table_id = hash_table_info.second;
    hash_table.Destroy(codegen,
                       query_state_.LoadStatePtr(codegen, hash_table_id));
  }
}

void Aggregation::CreateInitialGlobalValues(CodeGen &codegen,
                                            llvm::Value *space) const {
  PELOTON_ASSERT(IsGlobal());
  UpdateableStorage::NullBitmap null_bitmap{codegen, storage_, space};
  null_bitmap.InitAllNull(codegen);
  null_bitmap.WriteBack(codegen);
}

// Create the initial values of all aggregates based on the the provided values
void Aggregation::CreateInitialValues(
    CodeGen &codegen, llvm::Value *space,
    const std::vector<codegen::Value> &initial,
    const std::vector<codegen::Value> &grouping_keys) const {
  // Global aggregations should be calling CreateInitialGlobalValues(...)
  PELOTON_ASSERT(!IsGlobal());

  // The null bitmap tracker
  UpdateableStorage::NullBitmap null_bitmap{codegen, storage_, space};

  // Initialize bitmap to all NULLs
  null_bitmap.InitAllNull(codegen);

  // Iterate over the aggregations
  for (uint32_t i = 0; i < aggregate_infos_.size(); i++) {
    const auto &agg_info = aggregate_infos_[i];
    const auto &input_val = initial[agg_info.source_index];

    switch (agg_info.aggregate_type) {
      case ExpressionType::AGGREGATE_SUM:
      case ExpressionType::AGGREGATE_MIN:
      case ExpressionType::AGGREGATE_MAX:
      case ExpressionType::AGGREGATE_COUNT:
      case ExpressionType::AGGREGATE_COUNT_STAR: {
        // Those aggregations consist of only one component
        DoInitializeValue(codegen, space, agg_info.aggregate_type,
                          agg_info.storage_indices[0], input_val, null_bitmap);
        break;
      }
      case ExpressionType::AGGREGATE_AVG: {
        // AVG has to initialize both the SUM and the COUNT
        DoInitializeValue(codegen, space, ExpressionType::AGGREGATE_SUM,
                          agg_info.storage_indices[0], input_val, null_bitmap);
        DoInitializeValue(codegen, space, ExpressionType::AGGREGATE_COUNT,
                          agg_info.storage_indices[1], input_val, null_bitmap);
        break;
      }
      default: {
        std::string message = StringUtil::Format(
            "Unexpected aggregate type [%s] when creating initial values",
            ExpressionTypeToString(agg_info.aggregate_type).c_str());
        LOG_ERROR("%s", message.c_str());
        throw Exception{ExceptionType::UNKNOWN_TYPE, message};
      }
    }

    // Write the final contents of the null bitmap
    null_bitmap.WriteBack(codegen);

    // Add key to hash table if distinct
    if (agg_info.is_distinct) {
      auto &hash_table = hash_table_infos_[agg_info.hast_table_index].first;
      auto hash_table_id = hash_table_infos_[agg_info.hast_table_index].second;

      // Get the hash table for this hash table
      llvm::Value *state_pointer =
          query_state_.LoadStatePtr(codegen, hash_table_id);

      // Prepare the hash keys
      std::vector<codegen::Value> key = grouping_keys;
      key.push_back(input_val);

      // Perform the dummy lookup in the hash table that creates the entry
      llvm::Value *hash = nullptr;
      HashTable::NoOpInsertCallback insert_callback;
      hash_table.Insert(codegen, state_pointer, hash, key, insert_callback);
    }
  }
}

void Aggregation::DoInitializeValue(
    CodeGen &codegen, llvm::Value *space, ExpressionType type,
    uint32_t storage_index, const Value &initial,
    UpdateableStorage::NullBitmap &null_bitmap) const {
  switch (type) {
    case ExpressionType::AGGREGATE_SUM:
    case ExpressionType::AGGREGATE_MIN:
    case ExpressionType::AGGREGATE_MAX: {
      // For the above aggregations, the initial value is the attribute value
      storage_.SetValue(codegen, space, storage_index, initial, null_bitmap);
      break;
    }
    case ExpressionType::AGGREGATE_COUNT: {
      llvm::Value *raw_initial = nullptr;
      if (initial.IsNullable()) {
        llvm::Value *not_null = initial.IsNotNull(codegen);
        raw_initial = codegen->CreateZExt(not_null, codegen.Int64Type());
      } else {
        raw_initial = codegen.Const64(1);
      }
      codegen::Value initial_val{type::BigInt::Instance(), raw_initial};
      storage_.SetValueSkipNull(codegen, space, storage_index, initial_val);
      break;
    }
    case ExpressionType::AGGREGATE_COUNT_STAR: {
      // The initial value for COUNT(*) is 1
      codegen::Value one{type::BigInt::Instance(), codegen.Const64(1)};
      storage_.SetValueSkipNull(codegen, space, storage_index, one);
      break;
    }
    default: {
      std::string message = StringUtil::Format(
          "Unexpected aggregate type [%s] when creating initial values",
          ExpressionTypeToString(type).c_str());
      LOG_ERROR("%s", message.c_str());
      throw Exception{ExceptionType::UNKNOWN_TYPE, message};
    }
  }
}

void Aggregation::DoAdvanceValue(CodeGen &codegen, llvm::Value *space,
                                 ExpressionType type, uint32_t storage_index,
                                 const codegen::Value &update) const {
  codegen::Value next;
  switch (type) {
    case ExpressionType::AGGREGATE_SUM: {
      auto curr = storage_.GetValueSkipNull(codegen, space, storage_index);
      next = curr.Add(codegen, update);
      break;
    }
    case ExpressionType::AGGREGATE_MIN: {
      auto curr = storage_.GetValueSkipNull(codegen, space, storage_index);
      next = curr.Min(codegen, update);
      break;
    }
    case ExpressionType::AGGREGATE_MAX: {
      auto curr = storage_.GetValueSkipNull(codegen, space, storage_index);
      next = curr.Max(codegen, update);
      break;
    }
    case ExpressionType::AGGREGATE_COUNT: {
      auto curr = storage_.GetValueSkipNull(codegen, space, storage_index);

      // Convert the next update into 0 or 1 depending of if it is NULL
      codegen::Value raw_update;
      if (update.IsNullable()) {
        llvm::Value *not_null = update.IsNotNull(codegen);
        raw_update =
            codegen::Value{type::BigInt::Instance(),
                           codegen->CreateZExt(not_null, codegen.Int64Type())};
      } else {
        raw_update =
            codegen::Value{type::BigInt::Instance(), codegen.Const64(1)};
      }

      // Add to aggregate
      next = curr.Add(codegen, raw_update);
      break;
    }
    case ExpressionType::AGGREGATE_COUNT_STAR: {
      auto curr = storage_.GetValueSkipNull(codegen, space, storage_index);
      auto delta = codegen::Value{type::BigInt::Instance(), codegen.Const64(1)};
      next = curr.Add(codegen, delta);
      break;
    }
    default: {
      std::string message = StringUtil::Format(
          "Unexpected aggregate type [%s] when advancing aggregator",
          ExpressionTypeToString(type).c_str());
      LOG_ERROR("%s", message.c_str());
      throw Exception{ExceptionType::UNKNOWN_TYPE, message};
    }
  }

  // Store the updated value in the appropriate slot
  PELOTON_ASSERT(next.GetType().type_id != peloton::type::TypeId::INVALID);
  storage_.SetValueSkipNull(codegen, space, storage_index, next);
}

void Aggregation::DoNullCheck(
    CodeGen &codegen, llvm::Value *space, ExpressionType type,
    uint32_t storage_index, const codegen::Value &update,
    UpdateableStorage::NullBitmap &null_bitmap) const {
  // This aggregate is NULL-able, we need to check if the update value is
  // NULL, and whether the current value of the aggregate is NULL.

  // There are two cases we handle:
  // (1). If neither the update value or the current aggregate value are
  //      NULL, we simple do the regular aggregation without NULL checking.
  // (2). If the update value is not NULL, but the current aggregate **is**
  //      NULL, then we just store this update value as if we're creating it
  //      for the first time.
  //
  // If either the update value or the current aggregate are NULL, we have
  // nothing to do.

  llvm::Value *update_not_null = update.IsNotNull(codegen);
  llvm::Value *agg_null = null_bitmap.IsNull(codegen, storage_index);

  // Fetch null byte so we can phi-resolve it after all the branches
  llvm::Value *null_byte_snapshot = null_bitmap.ByteFor(codegen, storage_index);

  lang::If valid_update{codegen, update_not_null, "Agg.IfValidUpdate"};
  {
    lang::If agg_is_null{codegen, agg_null, "Agg.IfAggIsNull"};
    {
      // (2)
      switch (type) {
        case ExpressionType::AGGREGATE_SUM:
        case ExpressionType::AGGREGATE_MIN:
        case ExpressionType::AGGREGATE_MAX: {
          storage_.SetValue(codegen, space, storage_index, update, null_bitmap);
          break;
        }
        case ExpressionType::AGGREGATE_COUNT: {
          codegen::Value one{type::BigInt::Instance(), codegen.Const64(1)};
          storage_.SetValue(codegen, space, storage_index, one, null_bitmap);
          break;
        }
        default: { break; }
      }
    }
    agg_is_null.ElseBlock();
    {
      // (1)
      DoAdvanceValue(codegen, space, type, storage_index, update);
    }
    agg_is_null.EndIf();

    // Merge the null value
    null_bitmap.MergeValues(agg_is_null, null_byte_snapshot);
  }
  valid_update.EndIf();

  // Merge the null value
  null_bitmap.MergeValues(valid_update, null_byte_snapshot);
}

// Advance the value of a specific aggregate. Performs NULL check if necessary
// and finally calls DoAdvanceValue().
void Aggregation::AdvanceValue(
    CodeGen &codegen, llvm::Value *space,
    const std::vector<codegen::Value> &next_vals,
    const Aggregation::AggregateInfo &aggregate_info,
    UpdateableStorage::NullBitmap &null_bitmap) const {
  const Value &update = next_vals[aggregate_info.source_index];

  switch (aggregate_info.aggregate_type) {
    case ExpressionType::AGGREGATE_SUM:
    case ExpressionType::AGGREGATE_MIN:
    case ExpressionType::AGGREGATE_MAX: {
      // If the aggregate is not NULL-able, elide NULL check
      if (!null_bitmap.IsNullable(aggregate_info.storage_indices[0])) {
        DoAdvanceValue(codegen, space, aggregate_info.aggregate_type,
                       aggregate_info.storage_indices[0], update);
      } else {
        DoNullCheck(codegen, space, aggregate_info.aggregate_type,
                    aggregate_info.storage_indices[0], update, null_bitmap);
      }
      break;
    }
    case ExpressionType::AGGREGATE_COUNT:
    case ExpressionType::AGGREGATE_COUNT_STAR: {
      // COUNT can't be nullable, so skip the null check
      DoAdvanceValue(codegen, space, ExpressionType::AGGREGATE_COUNT,
                     aggregate_info.storage_indices[0], update);
      break;
    }
    case ExpressionType::AGGREGATE_AVG: {
      // If the SUM is not NULL-able, elide NULL check
      if (!null_bitmap.IsNullable(aggregate_info.storage_indices[0])) {
        DoAdvanceValue(codegen, space, ExpressionType::AGGREGATE_SUM,
                       aggregate_info.storage_indices[0], update);
      } else {
        DoNullCheck(codegen, space, ExpressionType::AGGREGATE_SUM,
                    aggregate_info.storage_indices[0], update, null_bitmap);
      }

      // COUNT can't be nullable, so skip the null check
      DoAdvanceValue(codegen, space, ExpressionType::AGGREGATE_COUNT,
                     aggregate_info.storage_indices[1], update);

      break;
    }
    default: {
      std::string message = StringUtil::Format(
          "Unexpected aggregate type [%s] when advancing aggregator",
          ExpressionTypeToString(aggregate_info.aggregate_type).c_str());
      LOG_ERROR("%s", message.c_str());
      throw Exception{ExceptionType::UNKNOWN_TYPE, message};
    }
  }
}

// Advance each of the aggregates stored in the provided storage space
void Aggregation::AdvanceValues(
    CodeGen &codegen, llvm::Value *space,
    const std::vector<codegen::Value> &next_vals,
    const std::vector<codegen::Value> &grouping_keys) const {
  // The null bitmap tracker
  UpdateableStorage::NullBitmap null_bitmap(codegen, storage_, space);

  // Loop over all aggregates, advancing each
  for (const auto &aggregate_info : aggregate_infos_) {
    const Value &update = next_vals[aggregate_info.source_index];

    if (!aggregate_info.is_distinct) {
      // Aggregation is not distinct, just advance value
      AdvanceValue(codegen, space, next_vals, aggregate_info, null_bitmap);
      continue;
    }

    // Check if aggregation is distinct, then add another hash table lookup
    // before advancing the value
    auto &hash_table = hash_table_infos_[aggregate_info.hast_table_index].first;
    auto hash_table_id =
        hash_table_infos_[aggregate_info.hast_table_index].second;

    // Get runtime state pointer for this hash table
    llvm::Value *ht_ptr = query_state_.LoadStatePtr(codegen, hash_table_id);

    // TODO(marcel): is it possible to cache the hash value for this
    // expression?
    llvm::Value *hash = nullptr;

    // Prepare the hash keys
    // if not global, start with grouping keys, then add aggregation key
    std::vector<codegen::Value> key;
    if (!IsGlobal()) {
      key = grouping_keys;
    }
    key.push_back(update);

    // Perform the lookup in the hash table
    OAHashTable::ProbeResult probe_result =
        hash_table.ProbeOrInsert(codegen, ht_ptr, hash, key);

    // Prepare condition for If
    llvm::Value *condition = codegen->CreateNot(probe_result.key_exists);

    // Grab a snapshot of the NULL indicator before the branch because it may
    // change after inside the if-clause. After the if-clause, we can use the
    // snapshot before and after to correctly resolve the final NULL indication
    // bit.
    llvm::Value *null_byte_snapshot =
        null_bitmap.ByteFor(codegen, aggregate_info.storage_indices[0]);

    // Only process aggregation if value is distinct (key didn't exist in hash
    // table)
    auto name = "agg" + std::to_string(aggregate_info.source_index) +
                ".advanceValues.ifAggValueIsDistinct";
    lang::If agg_is_distinct{codegen, condition, name};
    {
      // Advance value
      AdvanceValue(codegen, space, next_vals, aggregate_info, null_bitmap);
    }
    agg_is_distinct.EndIf();

    // Merge the NULL indicator (potentially modified in the branch) with the
    // snapshot we grabbed before the if-clause to resolve the final value.
    null_bitmap.MergeValues(agg_is_distinct, null_byte_snapshot);
  }

  // Write the final contents of the null bitmap
  null_bitmap.WriteBack(codegen);
}

// Advance all stored aggregates (stored in the provided storage space) using
// the update values provided in "next". Since global aggregations don't
// have grouping keys, this function creates an empty vector of keys in order
// to use AdvanceValues() that assumes grouping keys.
void Aggregation::AdvanceValues(CodeGen &codegen, llvm::Value *space,
                                const std::vector<codegen::Value> &next) const {
  std::vector<codegen::Value> empty;
  AdvanceValues(codegen, space, next, empty);
}

// This function will compute the final values of all aggregates stored in the
// provided storage space, populating the provided vector with these values.
void Aggregation::FinalizeValues(
    CodeGen &codegen, llvm::Value *space,
    std::vector<codegen::Value> &final_vals) const {
  // The null bitmap tracker
  UpdateableStorage::NullBitmap null_bitmap(codegen, storage_, space);

  for (const auto &agg_info : aggregate_infos_) {
    ExpressionType agg_type = agg_info.aggregate_type;
    switch (agg_type) {
      case ExpressionType::AGGREGATE_SUM:
      case ExpressionType::AGGREGATE_MIN:
      case ExpressionType::AGGREGATE_MAX: {
        codegen::Value final_val = storage_.GetValue(
            codegen, space, agg_info.storage_indices[0], null_bitmap);

        // append final value to result vector
        final_vals.push_back(final_val);
        break;
      }
      case ExpressionType::AGGREGATE_AVG: {
        // collect the final values of the SUM and the COUNT components
        codegen::Value sum = storage_.GetValue(
            codegen, space, agg_info.storage_indices[0], null_bitmap);

        PELOTON_ASSERT(!null_bitmap.IsNullable(agg_info.storage_indices[1]));
        codegen::Value count = storage_.GetValueSkipNull(
            codegen, space, agg_info.storage_indices[1]);

        // cast the values to DECIMAL
        codegen::Value sum_casted =
            sum.CastTo(codegen, type::Decimal::Instance());
        codegen::Value count_casted =
            count.CastTo(codegen, type::Decimal::Instance());

        // Compute the average
        codegen::Value final_val =
            sum_casted.Div(codegen, count_casted, OnError::ReturnNull);

        // append final value to result vector
        final_vals.push_back(final_val);
        break;
      }
      case ExpressionType::AGGREGATE_COUNT:
      case ExpressionType::AGGREGATE_COUNT_STAR: {
        // Neither COUNT(...) or COUNT(*) can ever return NULL, so no NULL-check
        codegen::Value final_val = storage_.GetValueSkipNull(
            codegen, space, agg_info.storage_indices[0]);

        // append final value to result vector
        final_vals.push_back(final_val);
        break;
      }
      default: {
        std::string message = StringUtil::Format(
            "Unexpected aggregate type [%s] when finalizing aggregator",
            ExpressionTypeToString(agg_type).c_str());
        LOG_ERROR("%s", message.c_str());
        throw Exception{ExceptionType::UNKNOWN_TYPE, message};
      }
    }
  }
}

}  // namespace codegen
}  // namespace peloton


text:
import React from 'react';
import Button from '../../components/button';
import Input from '../../components/input';
import Tooltip from '../../components/tooltip';

const TooltipButton = Tooltip(Button);
const TooltipInput = Tooltip(Input);
const TooltipStrong = Tooltip(({children, ...other}) => {children});

const TooltipTest = () => (

Tooltip

Give information on :hover

    <TooltipButton label='Bookmark' icon='bookmark' raised primary tooltip='Bookmark Tooltip' tooltipDelay={1000} />
    <TooltipButton icon='add' floating accent tooltip='Floating Tooltip' />
    <TooltipButton icon='add' floating disabled tooltip='Floating can not be shown' />
    <TooltipInput tooltip='lorem ipsum...' />

Lorem ipsum dolor sit amet, <TooltipStrong tooltip='This is a auto show tooltip'>consectetur</TooltipStrong> adipiscing elit.

);

export default TooltipTest;


text:
package com.github.lahahana.csv.util;

import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;

import com.github.lahahana.csv.base.CsvMetaInfo;
import com.github.lahahana.csv.base.CsvMetaNode;

public class Utils {

    private static final Map<Class<?>, Class<?>> primitiveWrapperMap = new HashMap<Class<?>, Class<?>>(9);

    private static final Map<Class<?>, CsvPrimitiveEnum> primitiveWrapperEnumMap = new HashMap<Class<?>, CsvPrimitiveEnum>(17);

    private enum CsvPrimitiveEnum {
    	BOOLEAN(Boolean.class), BYTE(Byte.class), CHARACTER(Character.class), SHORT(Short.class),
    	INTEGER(Integer.class), FLOAT(Float.class), DOUBLE(Double.class), LONG(Long.class), STRING(String.class);

		CsvPrimitiveEnum(Class<?> clazz) {}
    }

    static {
         primitiveWrapperMap.put(Boolean.class, Boolean.TYPE);
         primitiveWrapperMap.put(Byte.class, Byte.TYPE);
         primitiveWrapperMap.put(Character.class, Character.TYPE);
         primitiveWrapperMap.put(Short.class, Short.TYPE);
         primitiveWrapperMap.put(Integer.class, Integer.TYPE);
         primitiveWrapperMap.put(Float.class, Float.TYPE);
         primitiveWrapperMap.put(Long.class, Long.TYPE);
         primitiveWrapperMap.put(Double.class, Double.TYPE);
         primitiveWrapperMap.put(String.class, String.class);

         primitiveWrapperEnumMap.put(Boolean.TYPE, CsvPrimitiveEnum.BOOLEAN);
         primitiveWrapperEnumMap.put(Byte.TYPE, CsvPrimitiveEnum.BYTE);
         primitiveWrapperEnumMap.put(Character.TYPE, CsvPrimitiveEnum.CHARACTER);
         primitiveWrapperEnumMap.put(Short.TYPE, CsvPrimitiveEnum.SHORT);
         primitiveWrapperEnumMap.put(Integer.TYPE, CsvPrimitiveEnum.INTEGER);
         primitiveWrapperEnumMap.put(Float.TYPE, CsvPrimitiveEnum.FLOAT);
         primitiveWrapperEnumMap.put(Long.TYPE, CsvPrimitiveEnum.LONG);
         primitiveWrapperEnumMap.put(Double.TYPE, CsvPrimitiveEnum.DOUBLE);

         primitiveWrapperEnumMap.put(Boolean.class, CsvPrimitiveEnum.BOOLEAN);
         primitiveWrapperEnumMap.put(Byte.class, CsvPrimitiveEnum.BYTE);
         primitiveWrapperEnumMap.put(Character.class, CsvPrimitiveEnum.CHARACTER);
         primitiveWrapperEnumMap.put(Short.class, CsvPrimitiveEnum.SHORT);
         primitiveWrapperEnumMap.put(Integer.class, CsvPrimitiveEnum.INTEGER);
         primitiveWrapperEnumMap.put(Float.class, CsvPrimitiveEnum.FLOAT);
         primitiveWrapperEnumMap.put(Long.class, CsvPrimitiveEnum.LONG);
         primitiveWrapperEnumMap.put(Double.class, CsvPrimitiveEnum.DOUBLE);
         primitiveWrapperEnumMap.put(String.class, CsvPrimitiveEnum.STRING);
    }

    public static boolean isPrimitiveOrWrapper(Class<?> clazz) {
    	return clazz.isPrimitive() || primitiveWrapperMap.containsKey(clazz);
    }

    public static Object transform(Class<?> clazz, String value) throws IllegalArgumentException {
    	CsvPrimitiveEnum csvPrimitiveEnum = primitiveWrapperEnumMap.get(clazz);
    	if(csvPrimitiveEnum == null) {
    		throw new IllegalArgumentException("value:" + value + "," + clazz.getCanonicalName() + " not supported, please implement custom deserialization convertor for this field");
    	}
    	switch (csvPrimitiveEnum) {
			case BOOLEAN: return Boolean.parseBoolean(value);
			case BYTE: return Byte.parseByte(value);
			case CHARACTER: return value.charAt(0);
			case SHORT: return Short.parseShort(value);
			case INTEGER: return Integer.parseInt(value);
			case FLOAT: return Float.parseFloat(value);
			case LONG: return Long.parseLong(value);
			case DOUBLE: return Double.parseDouble(value);
			case STRING: return value;
			default: return value;
			}
    }

    public static String[] filterRepeatAndEmptyValue(String[] arg0) {
        String[] array = new String[arg0.length];
        int count = 0;
        for (String str : arg0) {
            if("".equals(str.trim()))
                    continue;
            array[count++] = str;
        }
        String[] array2 = new String[count];
        System.arraycopy(array, 0, array2, 0, count);
        return array2;
    }

    public static Field[] filterField(Field[] arg0, Field[] arg1) {
        Field[] result = new Field[arg0.length - arg1.length];
        for (int i = 0, index = 0; i < arg0.length; i++) {
                Field f = arg0[i];
                int j = 0;
                label:for (; j < arg1.length; j++) {
                        Field f2 = arg1[j];
                        if(f.getName().equals(f2.getName())) {
                            break label;
                        }
                      }
                if(j == arg1.length){
                    result[index ++] = f;
                }
            }
        return result;
    }

    public static <T> CsvMetaNode<?>[] convertFieldsToCsvMetaNodes(CsvMetaNode<T> csvMetaNode, Field[] fields) {
        CsvMetaNode<?>[] csvMetaNodes = new CsvMetaNode<?>[fields.length];
        int childDepth = csvMetaNode.getDepth() + 1;
        for (int i = 0; i < fields.length; i++) {
            CsvMetaInfo<Object> csvMetaInfo = new CsvMetaInfo<Object>(fields[i]);
            csvMetaNodes[i] = new CsvMetaNode<Object>(csvMetaInfo, csvMetaNode, null, childDepth);
        }
        return csvMetaNodes;
    }

    public static int convertCsvMetaTreeIntoArray(CsvMetaNode<?> csvMetaNode, CsvMetaNode<?>[] nodes, int index) {
        CsvMetaNode<?>[] csvMetaNodes = csvMetaNode.getChilds();
        if(csvMetaNodes != null) {
            for (CsvMetaNode<?> node : csvMetaNodes) {
               index = convertCsvMetaTreeIntoArray(node, nodes, index++);
            }
        }else {
            nodes[index++] = csvMetaNode;
        }
        return index;
    }

}


text:
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Company extends CI_Controller {

    protected $company;
//    protected $users;
    protected $page = 'company';
    protected $data = array();
    private $accessArr = array('1','2');

    public function __construct() {
        parent::__construct();
        // Access layer
        if (!isset($this->session->tci) || !in_array($this->session->tci->user['idrol_fk'], $this->accessArr)) {
            unset($_SESSION['tci']);
            redirect(BASE_URL);
        }
        // Build main propreties for all methods
        $this->setCompany($this->session->tci->company);
        // Start main libraries, models, helpers etc
        $this->load->library('html_builder');
        $this->load->model('comunas_m');
        $this->load->helper('form');
        $now = new DateTime('NOW');
        $date_created = $now->format('Y-m-d H:i:s');
    }

    public function index() {
        try {
            // Instanciate Classes
            if (!$comunas = $this->comunas_m->selComunas()) {
                $msg = 'SQL error Query';
                throw new Exception($msg);
            }
            $params = array(
                'id' => 'idcomuna_fk',
                'name' => 'idcomuna_fk',
                'required' => ''
            );
            // Build Select2 Dropdown box with data object
            $this->data['comunas'] = $this->html_builder->select2Select($comunas, 'idcomuna', 'nombre', $params);
            $this->data['title'] = $this->company['name'];
            // Load Views
            $this->load->view('common/header', $this->data);
            $this->load->view('pages/' . $this->page . '/header');
            $this->load->view('common/menu');
            $this->load->view('pages/' . $this->page . '/content');
            $this->load->view('common/footer');
            $this->load->view('pages/' . $this->page . '/footer');
           // $this->output->enable_profiler();
        } catch (Exception $ex) {
            echo 'Caught exception: ', $ex->getMessage(), "\n";
            exit();
        }
    }

    public function ajxEditCompany() {
        // Create a new empty object for Ajax response
        $objResponse = new stdClass();
        try {
            // Do not allow direct access
            if (!$this->input->is_ajax_request()) {
                redirect(BASE_URL, 'auto', 301);
            }
            // Build an array of characters to cleanup phone POST (came from inputmask)
            $cleanPhone = array('_');
            // Caught GET/POST variables and clean them
            $rol = trim($this->input->post('rol', TRUE));
            $nickname = trim($this->input->post('nickname', TRUE));
            $addr = trim($this->input->post('addr', TRUE));
            $idcomuna_fk = trim($this->input->post('idcomuna_fk', TRUE));
            $comuna = trim($this->input->post('comuna', TRUE));
            $idprovincia_fk = trim($this->input->post('idprovincia_fk', TRUE));
            $provincia = trim($this->input->post('provincia', TRUE));
            $idregion_fk = trim($this->input->post('idregion_fk', TRUE));
            $region = trim($this->input->post('region', TRUE));
            $tel1 = str_replace($cleanPhone, '', trim($this->input->post('tel1', TRUE)));
            $tel2 = trim($this->input->post('tel2', TRUE));
            $email1 = trim($this->input->post('email1', TRUE));
            $email2 = trim($this->input->post('email2', TRUE));
            $www = trim($this->input->post('www', TRUE));
            // Set array for DB update (NOT NULL fields)
            $dataArr = array(
                'rol' => $rol,
                'addr' => $addr,
                'idcomuna_fk' => $idcomuna_fk,
                'idprovincia_fk' => $idprovincia_fk,
                'idregion_fk' => $idregion_fk,
                'tel1' => $tel1,
                'email1' => $email1
            );
            if ($nickname) {
                $dataArr['nickname'] = $nickname;
            } else {
                $dataArr['nickname'] = NULL;
            }
            if ($tel2) {
                $tel2 = str_replace($cleanPhone, '', $tel2);
                $dataArr['tel2'] = $tel2;
            } else {
                $dataArr['tel2'] = NULL;
            }
            if ($email2) {
                $dataArr['email2'] = $email2;
            } else {
                $dataArr['email2'] = NULL;
            }
            if ($www) {
                $dataArr['www'] = $www;
            } else {
                $dataArr['www'] = NULL;
            }
            // Perform DB query
            $this->load->model('companies_m');
            $updCompany = $this->companies_m->updCompany($this->company['idcompany'], $dataArr);
            if ($updCompany !== TRUE) {
                $msg = '
' . json_encode($updCompany);
                throw new Exception($msg);
            }
            // Update company session
            foreach ($dataArr as $key => $value) {
                $this->session->tci->company[$key] = $value;
            }
            $this->session->tci->company['comuna'] = $comuna;
            $this->session->tci->company['provincia'] = $provincia;
            $this->session->tci->company['region'] = $region;
            // Build Output
            $alertArr = array('success', 'Éxito', 'Empresa actualizada');
            $this->load->library('alerts', $alertArr);
            $response = $this->alerts->makeAlert();
            $objResponse->success = $response;
            $output = json_encode($objResponse);
            $this->output->set_output($output);
        } catch (Exception $ex) {
            if (isset($msg)) {
                $alertArr = array('danger', 'Error', $ex);
            } else {
                $alertArr = array('danger', 'Error', $ex->getMessage());
            }
            $this->load->library('alerts', $alertArr);
            $response = $this->alerts->makeAlert();
            $objResponse->error = $response;
            $output = json_encode($objResponse);
            $this->output->set_output($output);
        }
    }

    public function ajxUploadLogo() {
        $objResponse = new stdClass();
        try {
            // Do not allow direct access
            if (!$this->input->is_ajax_request()) {
                redirect(BASE_URL, 'auto', 301);
            }

            if (!is_dir(dirname('./assets/layouts/layout/img/logos/'))) {
                $msg = "System folder does'n exist";
                throw new Exception($msg);
            }

            $objPost = new stdClass();
            $objPost = json_decode($this->input->post('userfile'));
            $image = explode(',', trim($objPost->output->image));
            $image = base64_decode($image[1]);

            $path = dirname($_SERVER['SCRIPT_FILENAME']) . '/assets/layouts/layout/img/logos/';
            $filename = 'logo-' . $this->tci->unFormatRut($this->company['rut']) . '.jpg';
            file_put_contents($path . $filename, $image);
            $this->session->tci->company['logo'] = $filename;

            $alertArr = array('success', 'Éxito', 'Logo actualizado');
            $this->load->library('alerts', $alertArr);
            $response = $this->alerts->makeAlert();
            $objResponse->success = $response;
            $time = new DateTime();
            $objResponse->img = 'company['logo'] . '?' . $time->getTimestamp() . '" alt="' . $this->company['name'] . '">';
            $output = json_encode($objResponse);
            $this->output->set_output($output);
        } catch (Exception $ex) {
            if (isset($msg)) {
                $alertArr = array('danger', 'Error', $msg);
            } else {
                $alertArr = array('danger', 'Error', $ex->getMessage());
            }
            $this->load->library('alerts', $alertArr);
            $response = $this->alerts->makeAlert();
            $objResponse->error = $response;
            $output = json_encode($objResponse);
            $this->output->set_output($output);
        }
    }

    public function ajxHandleComunas() {
        // Create a new empty object for Ajax response
        $objResponse = new stdClass();
        try {
            // Do not allow direct access
            if (!$this->input->is_ajax_request()) {
                redirect(BASE_URL, 'auto', 301);
            }
            // Caught GET/POST variables and clean them
            $idcomuna_fk = trim($this->input->post('idcomuna_fk', TRUE));
            // Perform DB query
            $query = $this->comunas_m->selComunasJoin($idcomuna_fk);
            if ($query === FALSE) {
                $msg = 'SQL Error';
                throw new Exception($msg);
            }
            // Build Output
            $objResponse->response = $query;
            $output = json_encode($objResponse);
            $this->output->set_output($output);
        } catch (Exception $ex) {
            if (isset($msg)) {
                $ex = $msg;
                $alertArr = array('danger', 'Error', $ex);
                $this->load->library('alerts', $alertArr);
                $response = $this->alerts->makeAlert();
                $objResponse->response = $response;
                $output = json_encode($objResponse);
                $this->output->set_output($output);
            } else {
                echo 'Caught exception: ', $ex->getMessage(), "\n";
            }
        }
    }

    public function handleEmailCfg() {
        // Create a new empty object for Ajax response
        $objResponse = new stdClass();
        try {
            // Do not allow direct access
            if (!$this->input->is_ajax_request()) {
                redirect(BASE_URL, 'auto', 301);
            }
            // Caught GET/POST variables and clean them
            $idcomuna_fk = trim($this->input->post('idcomuna_fk', TRUE));
            // Perform DB query
            $this->load->model('companies_m');
            if(!$emailCfg = $this->companies_m->selEmailCfg()) {
                $e = 'SQL Error';
                throw new Exception($e);
            }
            // Unset sensitive obj properties
            $unsetArr = array('apikey', 'password','id');
            foreach ($emailCfg as $key => $value) {
                if(in_array($key, $unsetArr)) {
                    unset($emailCfg->$key);
                    continue;
                }
            }
            // Build Output
            $objResponse->success = $emailCfg;
            $output = json_encode($objResponse);
            $this->output->set_output($output);
        } catch (Exception $ex) {
            $alertArr = array('danger', 'Error', $ex);
            $this->load->library('alerts', $alertArr);
            $response = $this->alerts->makeAlert();
            $objResponse->error = $response;
            $output = json_encode($objResponse);
            $this->output->set_output($output);
        }
    }

    public function ajxEditEmailCfg() {
        // Create a new empty object for Ajax response
        $objResponse = new stdClass();
        try {
            // Do not allow direct access
            if (!$this->input->is_ajax_request()) {
                redirect(BASE_URL, 'auto', 301);
            }
            // Build an array of characters to cleanup phone POST (came from inputmask)
            // Caught GET/POST variables and clean them
            $method = trim($this->input->post('method', TRUE));
            $host = trim($this->input->post('host', TRUE));
            $username = trim($this->input->post('username', TRUE));
            $password = trim($this->input->post('password', TRUE));
            $this->load->library('encryption');
            $enc_password = $this->encryption->encrypt($password);
            $port = trim($this->input->post('port', TRUE));
            $secure = trim($this->input->post('secure', TRUE));
            // Set array for DB update (NOT NULL fields)
            $dataArr = array(
                'method' => $method,
                'host' => $host,
                'username' => $username,
                'password' => $enc_password,
                'port' => $port,
                'secure' => $secure
            );
            // Perform DB query
            $this->load->model('companies_m');
            $updEmailCfg = $this->companies_m->updEmailCfg($dataArr);
            if ($updEmailCfg !== TRUE) {
                $e = json_encode($updEmailCfg);
                throw new Exception($e);
            }
            // Build Output
            $alertArr = array('success', 'Éxito', 'Configuración de cuenta E-mail actualizada');
            $this->load->library('alerts', $alertArr);
            $response = $this->alerts->makeAlert();
            $objResponse->response = $response;
            $output = json_encode($objResponse);
            $this->output->set_output($output);
        } catch (Exception $ex) {
            $alertArr = array('danger', 'Error', $ex);
            $this->load->library('alerts', $alertArr);
            $response = $this->alerts->makeAlert();
            $objResponse->response = $response;
            $output = json_encode($objResponse);
            $this->output->set_output($output);
        }
    }

    function setCompany($company) {
        $this->company = $company;
        return $this;
    }

    protected function setData($data) {
        $this->data = $data;
        return $this;
    }

    protected function getData() {
        return $this->data;
    }

    function setPage($page) {
        $this->page = $page;
        return $this;
    }

}


text:
package test

import (
	"testing"

	"github.com/openshift/origin/pkg/build/buildscheme"
	corev1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apiserver/pkg/admission"
	"k8s.io/client-go/scale/scheme"

	buildv1 "github.com/openshift/api/build/v1"
	buildutil "github.com/openshift/origin/pkg/build/util"
)

type TestPod corev1.Pod

func Pod() *TestPod {
	return (*TestPod)(&corev1.Pod{})
}

func (p *TestPod) WithAnnotation(name, value string) *TestPod {
	if p.Annotations == nil {
		p.Annotations = map[string]string{}
	}
	p.Annotations[name] = value
	return p
}

func (p *TestPod) WithEnvVar(name, value string) *TestPod {
	if len(p.Spec.InitContainers) == 0 {
		p.Spec.InitContainers = append(p.Spec.InitContainers, corev1.Container{})
	}
	if len(p.Spec.Containers) == 0 {
		p.Spec.Containers = append(p.Spec.Containers, corev1.Container{})
	}
	p.Spec.InitContainers[0].Env = append(p.Spec.InitContainers[0].Env, corev1.EnvVar{Name: name, Value: value})
	p.Spec.Containers[0].Env = append(p.Spec.Containers[0].Env, corev1.EnvVar{Name: name, Value: value})
	return p
}

func (p *TestPod) WithBuild(t *testing.T, build *buildv1.Build) *TestPod {
	encodedBuild, err := runtime.Encode(buildscheme.Encoder, build)
	if err != nil {
		t.Fatalf("%v", err)
	}
	return p.WithAnnotation(buildutil.BuildAnnotation, build.Name).WithEnvVar("BUILD", string(encodedBuild))
}

func (p *TestPod) InitEnvValue(name string) string {
	if len(p.Spec.InitContainers) == 0 {
		return ""
	}
	for _, ev := range p.Spec.InitContainers[0].Env {
		if ev.Name == name {
			return ev.Value
		}
	}
	return ""
}

func (p *TestPod) EnvValue(name string) string {
	if len(p.Spec.Containers) == 0 {
		return ""
	}
	for _, ev := range p.Spec.Containers[0].Env {
		if ev.Name == name {
			return ev.Value
		}
	}
	return ""
}

func (p *TestPod) GetBuild(t *testing.T) *buildv1.Build {
	obj, err := runtime.Decode(buildscheme.Decoder, []byte(p.EnvValue("BUILD")))
	if err != nil {
		t.Fatalf("Could not decode build: %v", err)
	}
	build, ok := obj.(*buildv1.Build)
	if !ok {
		t.Fatalf("Not a build object: %#v", obj)
	}
	return build
}

func (p *TestPod) ToAttributes() admission.Attributes {
	return admission.NewAttributesRecord((*corev1.Pod)(p),
		nil,
		scheme.Kind("Pod").WithVersion("version"),
		"default",
		"TestPod",
		corev1.Resource("pods").WithVersion("version"),
		"",
		admission.Create,
		nil)
}

func (p *TestPod) AsPod() *corev1.Pod {
	return (*corev1.Pod)(p)
}


text:
namespace Cot
{
	ComponentExt(CircleCollider, ICollider, COT_API)
	{
		COT_COMPONENT(CircleCollider);
	private:
		float	_radius;
		Vec2	_offset;

	public:
		CircleCollider* Init(float radius = 0.0f);

		void Reset() override;
		void Update(Time& time) override;

		void SetOffset(const Vec2& offset);
		Vec2 GetOffset() { return _offset; }

		void SetRadius(float radius);
		Circle GetCircle();

	};
}


text:
package uk.ac.ic.wlgitbridge.application.config;

import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import uk.ac.ic.wlgitbridge.application.exception.ConfigFileException;
import uk.ac.ic.wlgitbridge.bridge.repo.RepoStoreConfig;
import uk.ac.ic.wlgitbridge.bridge.swap.job.SwapJobConfig;
import uk.ac.ic.wlgitbridge.bridge.swap.store.SwapStoreConfig;
import uk.ac.ic.wlgitbridge.snapshot.base.JSONSource;
import uk.ac.ic.wlgitbridge.util.Instance;

import javax.annotation.Nullable;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.util.Optional;

/**
 * Created by Winston on 05/12/14.
 */
public class Config implements JSONSource {

    static Config asSanitised(Config config) {
        return new Config(
                config.port,
                config.rootGitDirectory,
                config.username,
                "<password>",
                config.apiBaseURL,
                config.postbackURL,
                config.serviceName,
                Oauth2.asSanitised(config.oauth2),
                config.repoStore,
                SwapStoreConfig.sanitisedCopy(config.swapStore),
                config.swapJob
        );
    }

    private int port;
    private String rootGitDirectory;
    private String username;
    private String password;
    private String apiBaseURL;
    private String postbackURL;
    private String serviceName;
    @Nullable
    private Oauth2 oauth2;
    @Nullable
    private RepoStoreConfig repoStore;
    @Nullable
    private SwapStoreConfig swapStore;
    @Nullable
    private SwapJobConfig swapJob;

    public Config(
            String configFilePath
    ) throws ConfigFileException,
             IOException {
        this(new FileReader(configFilePath));
    }

    Config(Reader reader) {
        fromJSON(new Gson().fromJson(reader, JsonElement.class));
    }

    public Config(
            int port,
            String rootGitDirectory,
            String username,
            String password,
            String apiBaseURL,
            String postbackURL,
            String serviceName,
            Oauth2 oauth2,
            RepoStoreConfig repoStore,
            SwapStoreConfig swapStore,
            SwapJobConfig swapJob
    ) {
        this.port = port;
        this.rootGitDirectory = rootGitDirectory;
        this.username = username;
        this.password = password;
        this.apiBaseURL = apiBaseURL;
        this.postbackURL = postbackURL;
        this.serviceName = serviceName;
        this.oauth2 = oauth2;
        this.repoStore = repoStore;
        this.swapStore = swapStore;
        this.swapJob = swapJob;
    }

    @Override
    public void fromJSON(JsonElement json) {
        JsonObject configObject = json.getAsJsonObject();
        port = getElement(configObject, "port").getAsInt();
        rootGitDirectory = getElement(
                configObject,
                "rootGitDirectory"
        ).getAsString();
        username = getOptionalString(configObject, "username");
        password = getOptionalString(configObject, "password");
        String apiBaseURL = getElement(
                configObject,
                "apiBaseUrl"
        ).getAsString();
        if (!apiBaseURL.endsWith("/")) {
            apiBaseURL += "/";
        }
        this.apiBaseURL = apiBaseURL;
        serviceName = getElement(configObject, "serviceName").getAsString();
        postbackURL = getElement(configObject, "postbackBaseUrl").getAsString();
        if (!postbackURL.endsWith("/")) {
            postbackURL += "/";
        }
        oauth2 = new Gson().fromJson(configObject.get("oauth2"), Oauth2.class);
        repoStore = new Gson().fromJson(
                configObject.get("repoStore"), RepoStoreConfig.class);
        swapStore = new Gson().fromJson(
                configObject.get("swapStore"),
                SwapStoreConfig.class
        );
        swapJob = new Gson().fromJson(
                configObject.get("swapJob"),
                SwapJobConfig.class
        );
    }

    public String getSanitisedString() {
        return Instance.prettyGson.toJson(Config.asSanitised(this));
    }

    public int getPort() {
        return port;
    }

    public String getRootGitDirectory() {
        return rootGitDirectory;
    }

    public String getUsername() {
        return username;
    }

    public String getPassword() {
        return password;
    }

    public String getAPIBaseURL() {
        return apiBaseURL;
    }

    public String getServiceName() {
        return serviceName;
    }

    public String getPostbackURL() {
        return postbackURL;
    }

    public boolean isUsingOauth2() {
        return oauth2 != null;
    }

    public Oauth2 getOauth2() {
        if (!isUsingOauth2()) {
            throw new AssertionError("Getting oauth2 when not using it");
        }
        return oauth2;
    }

    public Optional<RepoStoreConfig> getRepoStore() {
        return Optional.ofNullable(repoStore);
    }

    public Optional<SwapStoreConfig> getSwapStore() {
        return Optional.ofNullable(swapStore);
    }

    public Optional<SwapJobConfig> getSwapJob() {
        return Optional.ofNullable(swapJob);
    }

    private JsonElement getElement(JsonObject configObject, String name) {
        JsonElement element = configObject.get(name);
        if (element == null) {
            throw new RuntimeException(new ConfigFileException(name));
        }
        return element;
    }

    private String getOptionalString(JsonObject configObject, String name) {
        JsonElement element = configObject.get(name);
        if (element == null || !element.isJsonPrimitive()) {
            return "";
        }
        return element.getAsString();
    }

}


text:
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
  case $${target_option-} in \
      ?) ;; \
      *) echo "am__make_running_with_option: internal error: invalid" \
              "target option '$${target_option-}' specified" >&2; \
         exit 1;; \
  esac; \
  has_opt=no; \
  sane_makeflags=$$MAKEFLAGS; \
  if $(am__is_gnu_make); then \
    sane_makeflags=$$MFLAGS; \
  else \
    case $$MAKEFLAGS in \
      *\\[\ \	]*) \
        bs=\\; \
        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
    esac; \
  fi; \
  skip_next=no; \
  strip_trailopt () \
  { \
    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
  }; \
  for flg in $$sane_makeflags; do \
    test $$skip_next = yes && { skip_next=no; continue; }; \
    case $$flg in \
      *=*|--*) continue;; \
        -*I) strip_trailopt 'I'; skip_next=yes;; \
      -*I?*) strip_trailopt 'I';; \
        -*O) strip_trailopt 'O'; skip_next=yes;; \
      -*O?*) strip_trailopt 'O';; \
        -*l) strip_trailopt 'l'; skip_next=yes;; \
      -*l?*) strip_trailopt 'l';; \
      -[dEDm]) skip_next=yes;; \
      -[JT]) skip_next=yes;; \
    esac; \
    case $$flg in \
      *$$target_option*) has_opt=yes; break;; \
    esac; \
  done; \
  test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/blackbox
pkgincludedir = $(includedir)/blackbox
pkglibdir = $(libdir)/blackbox
pkglibexecdir = $(libexecdir)/blackbox
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = i686-pc-cygwin
host_triplet = i686-pc-cygwin
subdir = doc/ja_JP
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/intltool.m4 \
	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/lib/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_$(V))
am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_$(V))
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
am__v_GEN_0 = @echo "  GEN     " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_$(V))
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
  case $$AM_UPDATE_INFO_DIR in \
    n|no|NO) false;; \
    *) (install-info --version) >/dev/null 2>&1;; \
  esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} "/home/Antonio Cao/Descargas/blackbox/missing" aclocal-1.14
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
ALL_LINGUAS =
AMTAR = $${TAR-tar}
AM_DEFAULT_VERBOSITY = 0
AR = ar
AUTOCONF = ${SHELL} "/home/Antonio Cao/Descargas/blackbox/missing" autoconf
AUTOHEADER = ${SHELL} "/home/Antonio Cao/Descargas/blackbox/missing" autoheader
AUTOMAKE = ${SHELL} "/home/Antonio Cao/Descargas/blackbox/missing" automake-1.14
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2
CPP = gcc -E
CPPFLAGS =  -I/usr/include
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16
CYGPATH_W = cygpath -w
DEBUG =
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DLLTOOL = dlltool
DSYMUTIL =
DUMPBIN =
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = /usr/bin/grep -E
EXEEXT = .exe
FGREP = /usr/bin/grep -F
GETTEXT_MACRO_VERSION = 0.19
GETTEXT_PACKAGE = blackbox
GMSGFMT = /usr/bin/msgfmt
GMSGFMT_015 = /usr/bin/msgfmt
GREP = /usr/bin/grep
ICONV = -liconv
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
INTLLIBS = /usr/lib/libintl.dll.a /usr/lib/libiconv.dll.a
INTLTOOL_EXTRACT = /usr/bin/intltool-extract
INTLTOOL_MERGE = /usr/bin/intltool-merge
INTLTOOL_PERL = /usr/bin/perl
INTLTOOL_UPDATE = /usr/bin/intltool-update
INTLTOOL_V_MERGE = $(INTLTOOL__v_MERGE_$(V))
INTLTOOL_V_MERGE_OPTIONS = $(intltool__v_merge_options_$(V))
INTLTOOL__v_MERGE_ = $(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))
INTLTOOL__v_MERGE_0 = @echo "  ITMRG " $@;
INTL_MACOSX_LIBS =
LD = /usr/i686-pc-cygwin/bin/ld.exe
LDFLAGS =  -L/usr/lib
LEX = flex
LEXLIB = -lfl
LEX_OUTPUT_ROOT = lex.yy
LIBICONV = /usr/lib/libiconv.dll.a
LIBINTL = /usr/lib/libintl.dll.a /usr/lib/libiconv.dll.a
LIBOBJS =
LIBS =  -lXext -lX11 -lXft
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIBTOOL_DEPS = ./ltmain.sh
LIPO =
LN_S = ln -s
LOCALE =
LTLIBICONV = -L/usr/lib -liconv
LTLIBINTL = -L/usr/lib -lintl -L/usr/lib -liconv
LTLIBOBJS =
LT_SYS_LIBRARY_PATH =
MAINT = #
MAKEINFO = ${SHELL} "/home/Antonio Cao/Descargas/blackbox/missing" makeinfo
MANIFEST_TOOL = :
MITSHM = -DMITSHM
MKDIR_P = /usr/bin/mkdir -p
MSGFMT = /usr/bin/msgfmt
MSGFMT_015 = /usr/bin/msgfmt
MSGMERGE = /usr/bin/msgmerge
NLS = -DNLS
NM = /usr/bin/nm -B
NMEDIT =
OBJDUMP = objdump
OBJEXT = o
OTOOL =
OTOOL64 =
PACKAGE = blackbox
PACKAGE_BUGREPORT = http://blackboxwm.sourceforge.net
PACKAGE_NAME = blackbox
PACKAGE_STRING = blackbox 0.70.2
PACKAGE_TARNAME = blackbox
PACKAGE_URL =
PACKAGE_VERSION = 0.70.2
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR =
PKG_CONFIG_PATH =
POSUB = po
RANLIB = ranlib
SED = /usr/bin/sed
SET_MAKE =
SHAPE = -DSHAPE
SHELL = /bin/sh
STRIP = strip
USE_NLS = yes
VERSION = 0.70.2
XFT = -DXFT
XFT_PKGCONFIG = xft >= 2.0.0
XGETTEXT = /usr/bin/xgettext
XGETTEXT_015 = /usr/bin/xgettext
XGETTEXT_EXTRA_OPTIONS =
XMKMF =
abs_builddir = /home/Antonio Cao/Descargas/blackbox/doc/ja_JP
abs_srcdir = /home/Antonio Cao/Descargas/blackbox/doc/ja_JP
abs_top_builddir = /home/Antonio Cao/Descargas/blackbox
abs_top_srcdir = /home/Antonio Cao/Descargas/blackbox
ac_ct_AR = ar
ac_ct_CC = gcc
ac_ct_CXX = g++
ac_ct_DUMPBIN =
am__include = include
am__leading_dot = .
am__quote =
am__tar = tar --format=ustar -chf - "$$tardir"
am__untar = tar -xf -
bindir = ${exec_prefix}/bin
build = i686-pc-cygwin
build_alias =
build_cpu = i686
build_os = cygwin
build_vendor = pc
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
dvidir = ${docdir}
exec_prefix = ${prefix}
gencat_cmd = gencat
host = i686-pc-cygwin
host_alias =
host_cpu = i686
host_os = cygwin
host_vendor = pc
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} '/home/Antonio Cao/Descargas/blackbox/install-sh'
intltool__v_merge_options_ = $(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))
intltool__v_merge_options_0 = -q
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = /var
mandir = ${datarootdir}/man
mkdir_p = $(MKDIR_P)
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /usr
program_transform_name = s,x,x,
psdir = ${docdir}
regex_cmd = sed
sbindir = ${exec_prefix}/sbin
sharedstatedir = /var
srcdir = .
sysconfdir = /etc
target_alias =
top_build_prefix = ../../
top_builddir = ../..
top_srcdir = ../..
xft_CFLAGS = -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16
xft_LIBS = -lXft

# what locale is this
locale = ja_JP

# where to install
locale_mandir = $(DESTDIR)$(mandir)/$(locale)/man1

# what to install
manfiles = blackbox.1 ./bsetroot.1
CLEANFILES = blackbox.1
MAINTAINERCLEANFILES = Makefile.in
NLSTEST = -DNLS
DEFAULT_MENU = $(pkgdatadir)/menu
all: all-am

.SUFFIXES:
$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am  $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
	        && { if test -f $@; then exit 0; else break; fi; }; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/ja_JP/Makefile'; \
	$(am__cd) $(top_srcdir) && \
	  $(AUTOMAKE) --gnu doc/ja_JP/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure: # $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs
tags TAGS:

ctags CTAGS:

cscope cscopelist:

distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d "$(distdir)/$$file"; then \
	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
	    fi; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
	    fi; \
	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
	  else \
	    test -f "$(distdir)/$$file" \
	    || cp -p $$d/$$file "$(distdir)/$$file" \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-am: Makefile all-local
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	if test -z '$(STRIP)'; then \
	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	      install; \
	else \
	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
	fi
mostlyclean-generic:

clean-generic:
	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am

clean-am: clean-generic clean-libtool mostlyclean-am

distclean: distclean-am
	-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-local

dvi: dvi-am

dvi-am:

html: html-am

html-am:

info: info-am

info-am:

install-data-am: install-data-local

install-dvi: install-dvi-am

install-dvi-am:

install-exec-am:

install-html: install-html-am

install-html-am:

install-info: install-info-am

install-info-am:

install-man:

install-pdf: install-pdf-am

install-pdf-am:

install-ps: install-ps-am

install-ps-am:

installcheck-am:

maintainer-clean: maintainer-clean-am
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-generic mostlyclean-libtool

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am: uninstall-local

.MAKE: install-am install-strip

.PHONY: all all-am all-local check check-am clean clean-generic \
	clean-libtool cscopelist-am ctags-am distclean \
	distclean-generic distclean-libtool distclean-local distdir \
	dvi dvi-am html html-am info info-am install install-am \
	install-data install-data-am install-data-local install-dvi \
	install-dvi-am install-exec install-exec-am install-html \
	install-html-am install-info install-info-am install-man \
	install-pdf install-pdf-am install-ps install-ps-am \
	install-strip installcheck installcheck-am installdirs \
	maintainer-clean maintainer-clean-generic mostlyclean \
	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
	tags-am uninstall uninstall-am uninstall-local

# which files need processing during 'make'
all-local: blackbox.1

distclean-local:
	rm -f *\~ .\#*

blackbox.1: blackbox.1.in
	sed -e "s,@defaultmenu@,$(DEFAULT_MENU)," \
		-e "s,@pkgdatadir@,$(pkgdatadir)," \
		-e "s,@version@,$(VERSION)," \
		./blackbox.1.in > blackbox.1

install-data-local: all-local
	@if test x$(NLSTEST) = "x-DNLS"; then \
		echo "Installing manual pages for $(locale)"; \
		$(mkinstalldirs) $(locale_mandir); \
		$(INSTALL_DATA) $(manfiles) $(locale_mandir); \
	fi

uninstall-local:
	@if test x$(NLSTEST) = "x-DNLS"; then \
		for i in $(manfiles); do \
		rm -f $(locale_mandir)/`basename $$i`; \
		done; \
	fi

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:


text:
package gtk

// #include <gtk/gtk.h>
// #include "gtk.go.h"
import "C"
import (
	"unsafe"

	"github.com/gotk3/gotk3/gdk"
	"github.com/gotk3/gotk3/glib"
)

func init() {
	tm := []glib.TypeMarshaler{
		{glib.Type(C.gtk_about_dialog_get_type()), marshalAboutDialog},
	}

	glib.RegisterGValueMarshalers(tm)

	WrapMap["GtkAboutDialog"] = wrapAboutDialog
}

/*
 * GtkAboutDialog
 */

// AboutDialog is a representation of GTK's GtkAboutDialog.
type AboutDialog struct {
	Dialog
}

// native returns a pointer to the underlying GtkAboutDialog.
func (v *AboutDialog) native() *C.GtkAboutDialog {
	if v == nil || v.GObject == nil {
		return nil
	}
	p := unsafe.Pointer(v.GObject)
	return C.toGtkAboutDialog(p)
}

func marshalAboutDialog(p uintptr) (interface{}, error) {
	c := C.g_value_get_object((*C.GValue)(unsafe.Pointer(p)))
	obj := wrapObject(unsafe.Pointer(c))
	return wrapAboutDialog(obj), nil
}

func wrapAboutDialog(obj *glib.Object) *AboutDialog {
	return &AboutDialog{Dialog{Window{Bin{Container{Widget{glib.InitiallyUnowned{obj}}}}}}}
}

// AboutDialogNew is a wrapper around gtk_about_dialog_new().
func AboutDialogNew() (*AboutDialog, error) {
	c := C.gtk_about_dialog_new()
	if c == nil {
		return nil, nilPtrErr
	}
	obj := wrapObject(unsafe.Pointer(c))
	return wrapAboutDialog(obj), nil
}

// GetComments is a wrapper around gtk_about_dialog_get_comments().
func (v *AboutDialog) GetComments() string {
	c := C.gtk_about_dialog_get_comments(v.native())
	return C.GoString((*C.char)(c))
}

// SetComments is a wrapper around gtk_about_dialog_set_comments().
func (v *AboutDialog) SetComments(comments string) {
	cstr := C.CString(comments)
	defer C.free(unsafe.Pointer(cstr))
	C.gtk_about_dialog_set_comments(v.native(), (*C.gchar)(cstr))
}

// GetCopyright is a wrapper around gtk_about_dialog_get_copyright().
func (v *AboutDialog) GetCopyright() string {
	c := C.gtk_about_dialog_get_copyright(v.native())
	return C.GoString((*C.char)(c))
}

// SetCopyright is a wrapper around gtk_about_dialog_set_copyright().
func (v *AboutDialog) SetCopyright(copyright string) {
	cstr := C.CString(copyright)
	defer C.free(unsafe.Pointer(cstr))
	C.gtk_about_dialog_set_copyright(v.native(), (*C.gchar)(cstr))
}

// GetLicense is a wrapper around gtk_about_dialog_get_license().
func (v *AboutDialog) GetLicense() string {
	c := C.gtk_about_dialog_get_license(v.native())
	return C.GoString((*C.char)(c))
}

// SetLicense is a wrapper around gtk_about_dialog_set_license().
func (v *AboutDialog) SetLicense(license string) {
	cstr := C.CString(license)
	defer C.free(unsafe.Pointer(cstr))
	C.gtk_about_dialog_set_license(v.native(), (*C.gchar)(cstr))
}

// GetLicenseType is a wrapper around gtk_about_dialog_get_license_type().
func (v *AboutDialog) GetLicenseType() License {
	c := C.gtk_about_dialog_get_license_type(v.native())
	return License(c)
}

// SetLicenseType is a wrapper around gtk_about_dialog_set_license_type().
func (v *AboutDialog) SetLicenseType(license License) {
	C.gtk_about_dialog_set_license_type(v.native(), C.GtkLicense(license))
}

// GetLogo is a wrapper around gtk_about_dialog_get_logo().
func (v *AboutDialog) GetLogo() (*gdk.Pixbuf, error) {
	c := C.gtk_about_dialog_get_logo(v.native())
        if c == nil {
		return nil, nilPtrErr
	}

	p := &gdk.Pixbuf{wrapObject(unsafe.Pointer(c))}
	return p, nil
}

// SetLogo is a wrapper around gtk_about_dialog_set_logo().
func (v *AboutDialog) SetLogo(logo *gdk.Pixbuf) {
	logoPtr := (*C.GdkPixbuf)(unsafe.Pointer(logo.Native()))
	C.gtk_about_dialog_set_logo(v.native(), logoPtr)
}

// GetLogoIconName is a wrapper around gtk_about_dialog_get_logo_icon_name().
func (v *AboutDialog) GetLogoIconName() string {
	c := C.gtk_about_dialog_get_logo_icon_name(v.native())
	return C.GoString((*C.char)(c))
}

// SetLogoIconName is a wrapper around gtk_about_dialog_set_logo_icon_name().
func (v *AboutDialog) SetLogoIconName(name string) {
	cstr := C.CString(name)
	defer C.free(unsafe.Pointer(cstr))
	C.gtk_about_dialog_set_logo_icon_name(v.native(), (*C.gchar)(cstr))
}

// GetProgramName is a wrapper around gtk_about_dialog_get_program_name().
func (v *AboutDialog) GetProgramName() string {
	c := C.gtk_about_dialog_get_program_name(v.native())
	return C.GoString((*C.char)(c))
}

// SetProgramName is a wrapper around gtk_about_dialog_set_program_name().
func (v *AboutDialog) SetProgramName(name string) {
	cstr := C.CString(name)
	defer C.free(unsafe.Pointer(cstr))
	C.gtk_about_dialog_set_program_name(v.native(), (*C.gchar)(cstr))
}

// GetAuthors is a wrapper around gtk_about_dialog_get_authors().
func (v *AboutDialog) GetAuthors() []string {
	var authors []string
	cauthors := C.gtk_about_dialog_get_authors(v.native())
	if cauthors == nil {
		return nil
	}
	for {
		if *cauthors == nil {
			break
		}
		authors = append(authors, C.GoString((*C.char)(*cauthors)))
		cauthors = C.next_gcharptr(cauthors)
	}
	return authors
}

// SetAuthors is a wrapper around gtk_about_dialog_set_authors().
func (v *AboutDialog) SetAuthors(authors []string) {
	cauthors := C.make_strings(C.int(len(authors) + 1))
	for i, author := range authors {
		cstr := C.CString(author)
		defer C.free(unsafe.Pointer(cstr))
		C.set_string(cauthors, C.int(i), (*C.gchar)(cstr))
	}

	C.set_string(cauthors, C.int(len(authors)), nil)
	C.gtk_about_dialog_set_authors(v.native(), cauthors)
	C.destroy_strings(cauthors)
}

// GetArtists is a wrapper around gtk_about_dialog_get_artists().
func (v *AboutDialog) GetArtists() []string {
	var artists []string
	cartists := C.gtk_about_dialog_get_artists(v.native())
	if cartists == nil {
		return nil
	}
	for {
		if *cartists == nil {
			break
		}
		artists = append(artists, C.GoString((*C.char)(*cartists)))
		cartists = C.next_gcharptr(cartists)
	}
	return artists
}

// SetArtists is a wrapper around gtk_about_dialog_set_artists().
func (v *AboutDialog) SetArtists(artists []string) {
	cartists := C.make_strings(C.int(len(artists) + 1))
	for i, artist := range artists {
		cstr := C.CString(artist)
		defer C.free(unsafe.Pointer(cstr))
		C.set_string(cartists, C.int(i), (*C.gchar)(cstr))
	}

	C.set_string(cartists, C.int(len(artists)), nil)
	C.gtk_about_dialog_set_artists(v.native(), cartists)
	C.destroy_strings(cartists)
}

// GetDocumenters is a wrapper around gtk_about_dialog_get_documenters().
func (v *AboutDialog) GetDocumenters() []string {
	var documenters []string
	cdocumenters := C.gtk_about_dialog_get_documenters(v.native())
	if cdocumenters == nil {
		return nil
	}
	for {
		if *cdocumenters == nil {
			break
		}
		documenters = append(documenters, C.GoString((*C.char)(*cdocumenters)))
		cdocumenters = C.next_gcharptr(cdocumenters)
	}
	return documenters
}

// SetDocumenters is a wrapper around gtk_about_dialog_set_documenters().
func (v *AboutDialog) SetDocumenters(documenters []string) {
	cdocumenters := C.make_strings(C.int(len(documenters) + 1))
	for i, doc := range documenters {
		cstr := C.CString(doc)
		defer C.free(unsafe.Pointer(cstr))
		C.set_string(cdocumenters, C.int(i), (*C.gchar)(cstr))
	}

	C.set_string(cdocumenters, C.int(len(documenters)), nil)
	C.gtk_about_dialog_set_documenters(v.native(), cdocumenters)
	C.destroy_strings(cdocumenters)
}

// GetTranslatorCredits is a wrapper around gtk_about_dialog_get_translator_credits().
func (v *AboutDialog) GetTranslatorCredits() string {
	c := C.gtk_about_dialog_get_translator_credits(v.native())
	return C.GoString((*C.char)(c))
}

// SetTranslatorCredits is a wrapper around gtk_about_dialog_set_translator_credits().
func (v *AboutDialog) SetTranslatorCredits(translatorCredits string) {
	cstr := C.CString(translatorCredits)
	defer C.free(unsafe.Pointer(cstr))
	C.gtk_about_dialog_set_translator_credits(v.native(), (*C.gchar)(cstr))
}

// GetVersion is a wrapper around gtk_about_dialog_get_version().
func (v *AboutDialog) GetVersion() string {
	c := C.gtk_about_dialog_get_version(v.native())
	return C.GoString((*C.char)(c))
}

// SetVersion is a wrapper around gtk_about_dialog_set_version().
func (v *AboutDialog) SetVersion(version string) {
	cstr := C.CString(version)
	defer C.free(unsafe.Pointer(cstr))
	C.gtk_about_dialog_set_version(v.native(), (*C.gchar)(cstr))
}

// GetWebsite is a wrapper around gtk_about_dialog_get_website().
func (v *AboutDialog) GetWebsite() string {
	c := C.gtk_about_dialog_get_website(v.native())
	return C.GoString((*C.char)(c))
}

// SetWebsite is a wrapper around gtk_about_dialog_set_website().
func (v *AboutDialog) SetWebsite(website string) {
	cstr := C.CString(website)
	defer C.free(unsafe.Pointer(cstr))
	C.gtk_about_dialog_set_website(v.native(), (*C.gchar)(cstr))
}

// GetWebsiteLabel is a wrapper around gtk_about_dialog_get_website_label().
func (v *AboutDialog) GetWebsiteLabel() string {
	c := C.gtk_about_dialog_get_website_label(v.native())
	return C.GoString((*C.char)(c))
}

// SetWebsiteLabel is a wrapper around gtk_about_dialog_set_website_label().
func (v *AboutDialog) SetWebsiteLabel(websiteLabel string) {
	cstr := C.CString(websiteLabel)
	defer C.free(unsafe.Pointer(cstr))
	C.gtk_about_dialog_set_website_label(v.native(), (*C.gchar)(cstr))
}

// GetWrapLicense is a wrapper around gtk_about_dialog_get_wrap_license().
func (v *AboutDialog) GetWrapLicense() bool {
	return gobool(C.gtk_about_dialog_get_wrap_license(v.native()))
}

// SetWrapLicense is a wrapper around gtk_about_dialog_set_wrap_license().
func (v *AboutDialog) SetWrapLicense(wrapLicense bool) {
	C.gtk_about_dialog_set_wrap_license(v.native(), gbool(wrapLicense))
}

// AddCreditSection is a wrapper around gtk_about_dialog_add_credit_section().
func (v *AboutDialog) AddCreditSection(sectionName string, people []string) {
	cname := (*C.gchar)(C.CString(sectionName))
	defer C.free(unsafe.Pointer(cname))

	cpeople := C.make_strings(C.int(len(people)) + 1)
	defer C.destroy_strings(cpeople)
	for i, p := range people {
		cp := (*C.gchar)(C.CString(p))
		defer C.free(unsafe.Pointer(cp))
		C.set_string(cpeople, C.int(i), cp)
	}
	C.set_string(cpeople, C.int(len(people)), nil)

	C.gtk_about_dialog_add_credit_section(v.native(), cname, cpeople)
}