text:
module Gena

  class Application < Thor

    desc 'reconfigure [PLUGIN]', 'Restores default parameters for plugin inside gena.plist'
    def reconfigure(command)

      $config = Gena::Config.new
      $config.load_plist_config

      data = $config.data[GENA_PLUGINS_CONFIG_KEY] || Hash.new

      Application.plugin_classes.each do |klass|

        plugin_config_name = klass.plugin_config_name
        if plugin_config_name == command
          say "Setting defaults for '#{command}'..", Color::GREEN
          data[plugin_config_name] = klass.plugin_config_defaults
          $config.data[GENA_PLUGINS_CONFIG_KEY] = data
          $config.save!
          return
        end
      end
      say "Can't find plugin with name '#{command}'", Color::RED
    end

    desc 'init', 'Initialize gena.plist with default parameters'
    def init

      xcode_project_name = `find . -name *.xcodeproj`
      xcode_project_name.strip!

      xcode_project_name = ask_with_default("Enter path for #{set_color('project', Color::YELLOW)} or ENTER to continue (#{xcode_project_name}):", xcode_project_name)

      xcode_project = Xcodeproj::Project.open(xcode_project_name)

      main_target = nil
      test_target = nil
      xcode_project.native_targets.each do |target|
        if target.product_type == 'com.apple.product-type.application'
          main_target = target
        elsif target.product_type == 'com.apple.product-type.bundle.unit-test'
          test_target = target
        end
      end

      hash = Hash.new
      hash[:plugins_url] = [
          'https://github.com/alexgarbarev/gena-plugins.git'
      ]

      unless main_target
        say "Can't find application target in your Xcode project. Please create application target and try again", Color::RED
        abort
      end

      default_build_configuration = main_target.build_configuration_list.default_configuration_name || 'Debug'
      info_plist_value = main_target.build_configuration_list.get_setting('INFOPLIST_FILE')[default_build_configuration]
      if info_plist_value['$(SRCROOT)/']
        info_plist_value['$(SRCROOT)/'] = ''
      end

      hash['company'] = xcode_project.root_object.attributes['ORGANIZATIONNAME'].to_s
      hash['prefix'] = xcode_project.root_object.attributes['CLASSPREFIX'].to_s
      hash['project_name'] = xcode_project.root_object.name
      hash['info_plist'] = info_plist_value

      if main_target
        sources_path = common_path_in_target(main_target, 'main.m')
        sources_path = relative_to_current_dir(sources_path)

        hash['project_target'] = main_target.name
        hash['sources_dir'] = ask_with_default("Enter path for #{set_color('sources', Color::YELLOW)} or ENTER to continue (#{sources_path}):", sources_path)
     end

      if test_target
        tests_path = common_path_in_target(test_target, "#{sources_path}/")
        tests_path = relative_to_current_dir(tests_path)

        hash['test_target'] = test_target.name
        hash['tests_dir'] = ask_with_default("Enter path for #{set_color('tests', Color::YELLOW)} or ENTER to continue (#{tests_path}):", tests_path)
      else
        say "Can't find target for UnitTests. You setup it later using 'test_target' and 'tests_dir' key (similar to sources)", Color::YELLOW
        hash['test_target'] = ''
        hash['tests_dir'] = ''
      end

      language = file_exists_in_target?(main_target, 'main.m') ? "objc" : "swift"
      hash['language'] = ask_with_default("Enter main #{set_color('language', Color::YELLOW)} or ENTER to continue (#{language}):", language)

      say '===============================================================', Color::YELLOW
      print_table(hash)
      say '===============================================================', Color::YELLOW

      File.open('gena.plist', 'w') { |f| f.write hash.to_plist }

      say "'gena.plist' created..", Color::GREEN
    end

    no_tasks do

      @downloaded_urls = Hash.new

      def check

        $verbose = (ARGV.include? '-v')
        if $verbose
          ARGV.reject! { |n| n == '-v' || n == '--verbose' }
        end

        unless Config.exists?
          if ARGV == ['init']
            init
            ARGV.replace([])
          else
            unless no? "'gena.plist' is not exists. Do you want to create new one? (Y/n)", Color::YELLOW
              init
            end
          end
        end

        $config = Gena::Config.new
        $config.load_plist_config

        unless $config.data
          say '\'gena.plist\' is corrupted! Try recreating', Color::RED
          abort
        end

        if !$config.data['plugins_url'] || $config.data['plugins_url'].count == 0
          say "'plugins_url' key is missing inside 'gena.plist'", Color::RED
          abort
        end
        download_plugins
        load_plugins
        save_plugin_configs
      end

      def download_plugins
        load_downloaded_urls
        $config.data['plugins_url'].each do |plugin_url|
          if remote_url? plugin_url
            is_old = old_url?(plugin_url)
            if !downloaded_url?(plugin_url) || is_old
              message = is_old ? 'not up to date' : 'not downloaded yet'
              say "Plugin at '#{plugin_url}' #{message}", Color::YELLOW
              download_plugin_at plugin_url
            end
          end
        end
        save_downloaded_urls
      end

      def remote_url?(url)
        url =~ /(.+@)*([\w\d\.]+):(.*)/
      end

      def downloaded_url?(url)
        File.exists? File.expand_path(download_path_for(url))
      end

      def old_url?(url)
        entity = @downloaded_urls[key_for_url(url)]
        return true unless entity
        elapsed_seconds = DateTime.now.to_time.to_i - entity['timestamp'].to_i
        if elapsed_seconds > GENA_UPDATE_CHECK_INTERVAL
          current_hash = `git ls-remote #{url} refs/heads/master | cut -f 1`.strip
          entity['timestamp'] = DateTime.now.to_time.to_i
          return current_hash != entity['hash']
        end
        false
      end

      def load_downloaded_urls
        plist_path = File.expand_path "#{GENA_HOME}/plugins.plist"
        if File.exists? plist_path
          @downloaded_urls = Plist::parse_xml(plist_path)
        else
          @downloaded_urls = Hash.new
        end
      end

      def save_downloaded_urls
        File.open(File.expand_path("#{GENA_HOME}/plugins.plist"), 'w') { |f| f.write @downloaded_urls.to_plist }
      end

      def key_for_url(url)
        Digest::MD5.hexdigest url
      end

      def download_path_for(url)
        hash = Digest::MD5.hexdigest url
        File.expand_path "#{GENA_HOME}/plugins/#{hash}"
      end

      def download_plugin_at(url)
        say "Downloading plugin from '#{url}'..", Color::GREEN, ' '
        output_path = File.expand_path(download_path_for(url))
        FileUtils.rmtree output_path
        FileUtils.mkdir_p output_path
        result = gena_system "git clone --depth 1 #{url} #{output_path}"
        if result
          say 'success!', Color::GREEN
          @downloaded_urls[key_for_url(url)] = {
              'hash' => `git ls-remote #{url} refs/heads/master | cut -f 1`.strip,
              'timestamp' => DateTime.now.to_time.to_i
          }

        else
          say 'Failed! Run with \'-v\' to debug', Color::RED
        end
      end

      def load_plugins
        registered = []
        $config.data['plugins_url'].each do |plugin_url|
          path = remote_url?(plugin_url) ? download_path_for(plugin_url) : plugin_url
          Dir["#{File.expand_path(path)}/**/*.rb"].each do |file|
            template_name = file.split(File::SEPARATOR)[-2]
            unless registered.include? template_name
              registered << template_name
              say "Loading '#{file}'..", Color::YELLOW if $verbose
              require file
            end
          end
        end
        Gena::Plugin.descendants.each do |clazz|
          clazz.setup_thor_commands
        end
      end

      def save_plugin_configs

        data = $config.data[GENA_PLUGINS_CONFIG_KEY] || Hash.new

        Application.plugin_classes.each do |klass|

          defaults = klass.plugin_config_defaults

          if defaults.count > 0
            plugin_config_name = klass.plugin_config_name

            if !data[plugin_config_name] || data[plugin_config_name].count == 0
              say "Writing config defaults for plugin '#{plugin_config_name}'..", Color::GREEN
              data[plugin_config_name] = defaults
            elsif !data[plugin_config_name].keys.to_set.eql? defaults.keys.to_set
              missing_keys = defaults.keys - data[plugin_config_name].keys
              if missing_keys.count > 0
                say "Adding missing config keys #{missing_keys} for plugin '#{plugin_config_name}.'", Color::GREEN
                missing_keys.each { |key| data[plugin_config_name][key] = defaults[key] }
              end
            end
          end

        end

        $config.data[GENA_PLUGINS_CONFIG_KEY] = data
        $config.save!

      end

      private

      def ask_with_default(message, default)
        value = ask(message)
        if value.empty?
          value = default
        end
        value
      end

      def relative_to_current_dir(path)

        if path.empty? || !path["#{Dir.pwd}/"]
          path
        else
          result = path.dup
          result["#{Dir.pwd}/"] = ''
          result
        end
      end

      def common_path_in_target(target, except_match)
        common = ''
        target.source_build_phase.files.each do |file|
          unless file.file_ref.real_path.to_s[except_match]
            path_components = file.file_ref.real_path.to_s #.split('/')
            if common.empty?
              common = path_components
            else
              common = common.path_intersection path_components
            end
          end
        end

        if File.file? common
          common = common.delete_last_path_component
        end
        if common[-1] == '/'
          common = common[0..-2]
        end
        common
      end

      def file_exists_in_target?(target, file_name)
        target.source_build_phase.files.each do |file|
          if File.basename(file.file_ref.real_path.to_s) == file_name
            return true
          end
        end
        false
      end

    end

  end

end


text:
.class public Lcom/android/internal/telephony/UiccPhoneBookController;
.super Lcom/android/internal/telephony/IIccPhoneBook$Stub;
.source "UiccPhoneBookController.java"

# static fields
.field private static final TAG:Ljava/lang/String; = "UiccPhoneBookController"

# instance fields
.field private mPhone:[Lcom/android/internal/telephony/Phone;

# direct methods
.method public constructor <init>([Lcom/android/internal/telephony/Phone;)V
    .locals 1
    .param p1, "phone"    # [Lcom/android/internal/telephony/Phone;

    .prologue
    .line 39
    invoke-direct {p0}, Lcom/android/internal/telephony/IIccPhoneBook$Stub;-><init>()V

    .line 40
    const-string/jumbo v0, "simphonebook"

    invoke-static {v0}, Landroid/os/ServiceManager;->getService(Ljava/lang/String;)Landroid/os/IBinder;

    move-result-object v0

    if-nez v0, :cond_0

    .line 41
    const-string/jumbo v0, "simphonebook"

    invoke-static {v0, p0}, Landroid/os/ServiceManager;->addService(Ljava/lang/String;Landroid/os/IBinder;)V

    .line 43
    :cond_0
    iput-object p1, p0, Lcom/android/internal/telephony/UiccPhoneBookController;->mPhone:[Lcom/android/internal/telephony/Phone;

    .line 39
    return-void
.end method

.method private getDefaultSubscription()I
    .locals 1

    .prologue
    .line 154
    invoke-static {}, Lcom/android/internal/telephony/PhoneFactory;->getDefaultSubscription()I

    move-result v0

    return v0
.end method

.method private getIccPhoneBookInterfaceManagerProxy(I)Lcom/android/internal/telephony/IccPhoneBookInterfaceManagerProxy;
    .locals 7
    .param p1, "subId"    # I

    .prologue
    const/4 v6, 0x0

    .line 139
    invoke-static {}, Lcom/android/internal/telephony/SubscriptionController;->getInstance()Lcom/android/internal/telephony/SubscriptionController;

    move-result-object v3

    invoke-virtual {v3, p1}, Lcom/android/internal/telephony/SubscriptionController;->getPhoneId(I)I

    move-result v2

    .line 141
    .local v2, "phoneId":I
    :try_start_0
    iget-object v3, p0, Lcom/android/internal/telephony/UiccPhoneBookController;->mPhone:[Lcom/android/internal/telephony/Phone;

    aget-object v3, v3, v2

    check-cast v3, Lcom/android/internal/telephony/PhoneProxy;

    invoke-virtual {v3}, Lcom/android/internal/telephony/PhoneProxy;->getIccPhoneBookInterfaceManagerProxy()Lcom/android/internal/telephony/IccPhoneBookInterfaceManagerProxy;
    :try_end_0
    .catch Ljava/lang/NullPointerException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/ArrayIndexOutOfBoundsException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v3

    return-object v3

    .line 146
    :catch_0
    move-exception v0

    .line 147
    .local v0, "e":Ljava/lang/ArrayIndexOutOfBoundsException;
    const-string/jumbo v3, "UiccPhoneBookController"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v5, "Exception is :"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v0}, Ljava/lang/ArrayIndexOutOfBoundsException;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string/jumbo v5, " For subscription :"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/telephony/Rlog;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 148
    invoke-virtual {v0}, Ljava/lang/ArrayIndexOutOfBoundsException;->printStackTrace()V

    .line 149
    return-object v6

    .line 142
    .end local v0    # "e":Ljava/lang/ArrayIndexOutOfBoundsException;
    :catch_1
    move-exception v1

    .line 143
    .local v1, "e":Ljava/lang/NullPointerException;
    const-string/jumbo v3, "UiccPhoneBookController"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v5, "Exception is :"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v1}, Ljava/lang/NullPointerException;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string/jumbo v5, " For subscription :"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/telephony/Rlog;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 144
    invoke-virtual {v1}, Ljava/lang/NullPointerException;->printStackTrace()V

    .line 145
    return-object v6
.end method

# virtual methods
.method public getAdnRecordsInEf(I)Ljava/util/List;
    .locals 1
    .param p1, "efid"    # I
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I)",
            "Ljava/util/List",
            "<",
            "Lcom/android/internal/telephony/uicc/AdnRecord;",
            ">;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 116
    invoke-direct {p0}, Lcom/android/internal/telephony/UiccPhoneBookController;->getDefaultSubscription()I

    move-result v0

    invoke-virtual {p0, v0, p1}, Lcom/android/internal/telephony/UiccPhoneBookController;->getAdnRecordsInEfForSubscriber(II)Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method public getAdnRecordsInEfForSubscriber(II)Ljava/util/List;
    .locals 5
    .param p1, "subId"    # I
    .param p2, "efid"    # I
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(II)",
            "Ljava/util/List",
            "<",
            "Lcom/android/internal/telephony/uicc/AdnRecord;",
            ">;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    const/4 v4, 0x0

    .line 123
    invoke-direct {p0, p1}, Lcom/android/internal/telephony/UiccPhoneBookController;->getIccPhoneBookInterfaceManagerProxy(I)Lcom/android/internal/telephony/IccPhoneBookInterfaceManagerProxy;

    move-result-object v0

    .line 124
    .local v0, "iccPbkIntMgrProxy":Lcom/android/internal/telephony/IccPhoneBookInterfaceManagerProxy;
    if-eqz v0, :cond_0

    .line 125
    invoke-virtual {v0, p2}, Lcom/android/internal/telephony/IccPhoneBookInterfaceManagerProxy;->getAdnRecordsInEf(I)Ljava/util/List;

    move-result-object v1

    return-object v1

    .line 127
    :cond_0
    const-string/jumbo v1, "UiccPhoneBookController"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "getAdnRecordsInEf iccPbkIntMgrProxy isnull for Subscription:"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/telephony/Rlog;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 129
    return-object v4
.end method

.method public getAdnRecordsSize(I)[I
    .locals 1
    .param p1, "efid"    # I
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 97
    invoke-direct {p0}, Lcom/android/internal/telephony/UiccPhoneBookController;->getDefaultSubscription()I

    move-result v0

    invoke-virtual {p0, v0, p1}, Lcom/android/internal/telephony/UiccPhoneBookController;->getAdnRecordsSizeForSubscriber(II)[I

    move-result-object v0

    return-object v0
.end method

.method public getAdnRecordsSizeForSubscriber(II)[I
    .locals 5
    .param p1, "subId"    # I
    .param p2, "efid"    # I
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    const/4 v4, 0x0

    .line 104
    invoke-direct {p0, p1}, Lcom/android/internal/telephony/UiccPhoneBookController;->getIccPhoneBookInterfaceManagerProxy(I)Lcom/android/internal/telephony/IccPhoneBookInterfaceManagerProxy;

    move-result-object v0

    .line 105
    .local v0, "iccPbkIntMgrProxy":Lcom/android/internal/telephony/IccPhoneBookInterfaceManagerProxy;
    if-eqz v0, :cond_0

    .line 106
    invoke-virtual {v0, p2}, Lcom/android/internal/telephony/IccPhoneBookInterfaceManagerProxy;->getAdnRecordsSize(I)[I

    move-result-object v1

    return-object v1

    .line 108
    :cond_0
    const-string/jumbo v1, "UiccPhoneBookController"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "getAdnRecordsSize iccPbkIntMgrProxy is null for Subscription:"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/telephony/Rlog;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 110
    return-object v4
.end method

.method public updateAdnRecordsInEfByIndex(ILjava/lang/String;Ljava/lang/String;ILjava/lang/String;)Z
    .locals 7
    .param p1, "efid"    # I
    .param p2, "newTag"    # Ljava/lang/String;
    .param p3, "newPhoneNumber"    # Ljava/lang/String;
    .param p4, "index"    # I
    .param p5, "pin2"    # Ljava/lang/String;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 75
    invoke-direct {p0}, Lcom/android/internal/telephony/UiccPhoneBookController;->getDefaultSubscription()I

    move-result v1

    move-object v0, p0

    move v2, p1

    move-object v3, p2

    move-object v4, p3

    move v5, p4

    move-object v6, p5

    invoke-virtual/range {v0 .. v6}, Lcom/android/internal/telephony/UiccPhoneBookController;->updateAdnRecordsInEfByIndexForSubscriber(IILjava/lang/String;Ljava/lang/String;ILjava/lang/String;)Z

    move-result v0

    return v0
.end method

.method public updateAdnRecordsInEfByIndexForSubscriber(IILjava/lang/String;Ljava/lang/String;ILjava/lang/String;)Z
    .locals 6
    .param p1, "subId"    # I
    .param p2, "efid"    # I
    .param p3, "newTag"    # Ljava/lang/String;
    .param p4, "newPhoneNumber"    # Ljava/lang/String;
    .param p5, "index"    # I
    .param p6, "pin2"    # Ljava/lang/String;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 84
    invoke-direct {p0, p1}, Lcom/android/internal/telephony/UiccPhoneBookController;->getIccPhoneBookInterfaceManagerProxy(I)Lcom/android/internal/telephony/IccPhoneBookInterfaceManagerProxy;

    move-result-object v0

    .line 85
    .local v0, "iccPbkIntMgrProxy":Lcom/android/internal/telephony/IccPhoneBookInterfaceManagerProxy;
    if-eqz v0, :cond_0

    move v1, p2

    move-object v2, p3

    move-object v3, p4

    move v4, p5

    move-object v5, p6

    .line 86
    invoke-virtual/range {v0 .. v5}, Lcom/android/internal/telephony/IccPhoneBookInterfaceManagerProxy;->updateAdnRecordsInEfByIndex(ILjava/lang/String;Ljava/lang/String;ILjava/lang/String;)Z

    move-result v1

    return v1

    .line 89
    :cond_0
    const-string/jumbo v1, "UiccPhoneBookController"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "updateAdnRecordsInEfByIndex iccPbkIntMgrProxy is null for Subscription:"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/telephony/Rlog;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 91
    const/4 v1, 0x0

    return v1
.end method

.method public updateAdnRecordsInEfBySearch(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z
    .locals 8
    .param p1, "efid"    # I
    .param p2, "oldTag"    # Ljava/lang/String;
    .param p3, "oldPhoneNumber"    # Ljava/lang/String;
    .param p4, "newTag"    # Ljava/lang/String;
    .param p5, "newPhoneNumber"    # Ljava/lang/String;
    .param p6, "pin2"    # Ljava/lang/String;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 50
    invoke-direct {p0}, Lcom/android/internal/telephony/UiccPhoneBookController;->getDefaultSubscription()I

    move-result v1

    move-object v0, p0

    move v2, p1

    move-object v3, p2

    move-object v4, p3

    move-object v5, p4

    move-object v6, p5

    move-object v7, p6

    invoke-virtual/range {v0 .. v7}, Lcom/android/internal/telephony/UiccPhoneBookController;->updateAdnRecordsInEfBySearchForSubscriber(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method public updateAdnRecordsInEfBySearchForSubscriber(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z
    .locals 7
    .param p1, "subId"    # I
    .param p2, "efid"    # I
    .param p3, "oldTag"    # Ljava/lang/String;
    .param p4, "oldPhoneNumber"    # Ljava/lang/String;
    .param p5, "newTag"    # Ljava/lang/String;
    .param p6, "newPhoneNumber"    # Ljava/lang/String;
    .param p7, "pin2"    # Ljava/lang/String;
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 60
    invoke-direct {p0, p1}, Lcom/android/internal/telephony/UiccPhoneBookController;->getIccPhoneBookInterfaceManagerProxy(I)Lcom/android/internal/telephony/IccPhoneBookInterfaceManagerProxy;

    move-result-object v0

    .line 61
    .local v0, "iccPbkIntMgrProxy":Lcom/android/internal/telephony/IccPhoneBookInterfaceManagerProxy;
    if-eqz v0, :cond_0

    move v1, p2

    move-object v2, p3

    move-object v3, p4

    move-object v4, p5

    move-object v5, p6

    move-object v6, p7

    .line 62
    invoke-virtual/range {v0 .. v6}, Lcom/android/internal/telephony/IccPhoneBookInterfaceManagerProxy;->updateAdnRecordsInEfBySearch(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z

    move-result v1

    return v1

    .line 65
    :cond_0
    const-string/jumbo v1, "UiccPhoneBookController"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "updateAdnRecordsInEfBySearch iccPbkIntMgrProxy is null for Subscription:"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/telephony/Rlog;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 67
    const/4 v1, 0x0

    return v1
.end method

redpajama_set_name: RedPajamaGithub


text:
package com.github.vooolll.domain.friends

import com.github.vooolll.domain.FacebookPaging
import com.github.vooolll.domain.profile.FacebookUser

final case class FacebookFriends(
  friends: List[FacebookUser],
  paging: Option[FacebookPaging],
  summary: Option[FacebookFriendsSummary]
)

final case class FacebookFriendsSummary(totalCount: Int)


text:
'use strict';

eventsApp.controller("EditEventController",
    function EditEventController($scope) {
        $scope.saveEvent = function(event, newEventForm){
        if (newEventForm.$valid) {
                window.alert('event ' + event.name + ' saved!');
            }
        };

        $scope.cancelEdit = function(){
            window.location = "/EventDetails.html";
        }
    }

);


text:
package org.apache.qpid.protonj2.engine.exceptions;

/**
 * Exception indicating that the engine is not currently accepting input of data
 */
public final class EngineNotWritableException extends EngineStateException {

    private static final long serialVersionUID = 4395349183049727897L;

    public EngineNotWritableException() {
        super();
    }

    public EngineNotWritableException(String message, Throwable cause) {
        super(message, cause);
    }

    public EngineNotWritableException(String message) {
        super(message);
    }

    public EngineNotWritableException(Throwable cause) {
        super(cause);
    }
}


text:
package com.github.jengo.java.program.design10;

import javax.swing.JApplet;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;

public class TestTableModel extends JApplet {
    // Create table column names
    private String[] columnNames =
            {"Country", "Capital", "Population in Millions", "Democracy"};

    // Create table data
    private Object[][] data = {
            {"USA", "Washington DC", 280, true},
            {"Canada", "Ottawa", 32, true}
    };

    // Create a model
    private DefaultTableModel tableModel =
            new DefaultTableModel(data, columnNames);

    // Create a table
    private JTable jTable1 = new JTable(tableModel);

    public TestTableModel() {
        add(new JScrollPane(jTable1));

        tableModel.addRow(new Object[]{"France", "Paris", 60, true});
        tableModel.insertRow(0, new Object[]
                {"India", "New Delhi", 1046, true});
        tableModel.removeRow(1);
        tableModel.addColumn("Area");
        tableModel.setValueAt(10, 0, 4);
        tableModel.setValueAt(20, 1, 4);
        tableModel.setValueAt(30, 2, 4);
    }

    //Main method
    public static void main(String[] args) {
        TestTableModel applet = new TestTableModel();
        JFrame frame = new JFrame();
        //EXIT_ON_CLOSE == 3
        frame.setDefaultCloseOperation(3);
        frame.setTitle("TestTableModel");
        frame.getContentPane().add(applet, java.awt.BorderLayout.CENTER);
        applet.init();
        applet.start();
        frame.setSize(400, 320);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Andrelton Invents "Blog"</title>
    <link rel="stylesheet" href="../stylesheets/default.css">
    <link rel="stylesheet" href="../stylesheets/blog-stylesheet.css">

      back to blog index

      back to blog index


text:
body {
    border: 1px solid green;
}


text:
layout: page
title: Contact
---

If you are having any problems, any questions or suggestions, feel free to [tweet at me](https://twitter.com/seriousswann). If there's any topics you'd like me to write about in the future, let me know.


text:
/*****************************************************************************/
/**
*
* @file xl2cc_counter.c
*
* This file contains APIs for configuring and controlling the event counters
* in PL310 L2 cache controller. For more information about the event counters,
* see xl2cc_counter.h.
*
* <pre>
* MODIFICATION HISTORY:
*
* Ver   Who  Date     Changes
* ----- ---- -------- -----------------------------------------------
* 1.00a sdm  07/11/11 First release
* 3.07a asa  08/30/12 Updated for CR 675636 to provide the L2 Base Address
*		      inside the APIs
* </pre>
*
******************************************************************************/

/***************************** Include Files *********************************/

#include <stdint.h>
#include "xparameters_ps.h"
#include "xl2cc_counter.h"
#include "xl2cc.h"

/************************** Constant Definitions ****************************/

/**************************** Type Definitions ******************************/

/***************** Macros (Inline Functions) Definitions ********************/

/************************** Variable Definitions *****************************/

/************************** Function Prototypes ******************************/

void XL2cc_EventCtrReset(void);

/******************************************************************************/

/****************************************************************************/
/**
*
* This function initializes the event counters in L2 Cache controller with a
* set of event codes specified by the user.
*
* @param	Event0 is the event code for counter 0.
* @param	Event1 is the event code for counter 1.
*		Use the event codes defined by XL2CC_* in xl2cc_counter.h.
*
* @return	None.
*
* @note		None.
*
*****************************************************************************/
void XL2cc_EventCtrInit(int Event0, int Event1)
{

	/* Write event code into cnt1 cfg reg */
	*((volatile u32*)(XPS_L2CC_BASEADDR + XPS_L2CC_EVNT_CNT1_CTRL_OFFSET)) = (Event1 << 2);

	/* Write event code into cnt0 cfg reg */
	*((volatile u32*)(XPS_L2CC_BASEADDR + XPS_L2CC_EVNT_CNT0_CTRL_OFFSET)) = (Event0 << 2);

	/* Reset counters */
	XL2cc_EventCtrReset();
}

/****************************************************************************/
/**
*
* This function starts the event counters in L2 Cache controller.
*
* @param	None.
*
* @return	None.
*
* @note		None.
*
*****************************************************************************/
void XL2cc_EventCtrStart(void)
{
	XL2cc_EventCtrReset();

	/* Enable counter */
	*((volatile u32*)(XPS_L2CC_BASEADDR + XPS_L2CC_EVNT_CNTRL_OFFSET)) = 1;
}

/****************************************************************************/
/**
*
* This function disables the event counters in L2 Cache controller, saves the
* counter values and resets the counters.
*
* @param	EveCtr0 is an output parameter which is used to return the value
*		in event counter 0.
*		EveCtr1 is an output parameter which is used to return the value
*		in event counter 1.
*
* @return	None.
*
* @note		None.
*
*****************************************************************************/
void XL2cc_EventCtrStop(u32 *EveCtr0, u32 *EveCtr1)
{
	/* Disable counter */
	*((volatile u32*) (XPS_L2CC_BASEADDR + XPS_L2CC_EVNT_CNTRL_OFFSET)) = 0;

	/* Save counter values */
	*EveCtr1 = *((volatile u32*)(XPS_L2CC_BASEADDR + XPS_L2CC_EVNT_CNT1_VAL_OFFSET));
	*EveCtr0 = *((volatile u32*)(XPS_L2CC_BASEADDR + XPS_L2CC_EVNT_CNT0_VAL_OFFSET));

	XL2cc_EventCtrReset();
}

/****************************************************************************/
/**
*
* This function resets the event counters in L2 Cache controller.
*
* @param	None.
*
* @return	None.
*
* @note		None.
*
*****************************************************************************/
void XL2cc_EventCtrReset(void)
{
	*((volatile u32*)(XPS_L2CC_BASEADDR + XPS_L2CC_EVNT_CNTRL_OFFSET)) = 0x6;
}


text:
@import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic);

html,
body {
  min-height: 100%;
}
.layout-boxed html,
.layout-boxed body {
  height: 100%;
}
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  overflow-x: hidden;
  overflow-y: auto;
}
/* Layout */
.wrapper {                           /* haha */
  /* min-height: 100%; */
  position: static;
  overflow: hidden;
}
.main-content,
.right-side,
.main-footer {
  -webkit-transition: -webkit-transform 0.3s ease-in-out, margin 0.3s ease-in-out;
  -moz-transition: -moz-transform 0.3s ease-in-out, margin 0.3s ease-in-out;
  -o-transition: -o-transform 0.3s ease-in-out, margin 0.3s ease-in-out;
  transition: transform 0.3s ease-in-out, margin 0.3s ease-in-out;
  margin-left: 200px;
  z-index: 820;
}
.layout-top-nav .main-content,
.layout-top-nav .right-side,
.layout-top-nav .main-footer {
  margin-left: 0;
}
@media (max-width: 767px) {
  .main-content,
  .right-side,
  .main-footer {
    margin-left: 0;
  }
}
@media (min-width: 768px) {
  .sidebar-collapse .main-content,
  .sidebar-collapse .right-side,
  .sidebar-collapse .main-footer {
    margin-left: 0;
  }
}
@media (max-width: 767px) {
  .sidebar-open .main-content,
  .sidebar-open .right-side,
  .sidebar-open .main-footer {
    -webkit-transform: translate(200px, 0);
    -ms-transform: translate(200px, 0);
    -o-transform: translate(200px, 0);
    transform: translate(200px, 0);
  }
}
.main-content,
.right-side {
  /* min-height: 100%; */
  background-color: #ecf0f5;
  z-index: 800;
}

/* H1 - H6 font */
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  font-family: 'Source Sans Pro', sans-serif;
}
/* General Links */
a {
  color: #3c8dbc;
}
a:hover,
a:active,
a:focus {
  outline: none;
  text-decoration: none;
  color: #72afd2;
}
/* Page Header */
.page-header {
  margin: 10px 0 20px 0;
  font-size: 22px;
}
.page-header > small {
  color: #666;
  display: block;
  margin-top: 5px;
}
/*
 * Component: Main Header    						   haha
 * ----------------------
 */
.main-header {
  position: relative;
  max-height: 100px;
  z-index: 1030;
}
.main-header > .navbar {
  -webkit-transition: margin-left 0.3s ease-in-out;
  -o-transition: margin-left 0.3s ease-in-out;
  transition: margin-left 0.3s ease-in-out;
  margin-bottom: 0;
  margin-left: 200px;
  border: none;
  min-height: 50px;
  border-radius: 0;
}
.layout-top-nav .main-header > .navbar {
  margin-left: 0;
}
.main-header #navbar-search-input.form-control {
  background: rgba(255, 255, 255, 0.2);
  border-color: transparent;
}
.main-header #navbar-search-input.form-control:focus,
.main-header #navbar-search-input.form-control:active {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.9);
}
.main-header #navbar-search-input.form-control::-moz-placeholder {
  color: #ccc;
  opacity: 1;
}
.main-header #navbar-search-input.form-control:-ms-input-placeholder {
  color: #ccc;
}
.main-header #navbar-search-input.form-control::-webkit-input-placeholder {
  color: #ccc;
}
.main-header .navbar-custom-menu,
.main-header .navbar-right {
  float: right;
}
@media (max-width: 991px) {
  .main-header .navbar-custom-menu a,
  .main-header .navbar-right a {
    color: inherit;
    background: transparent;
  }
}
@media (max-width: 767px) {
  .main-header .navbar-right {
    float: none;
  }
  .navbar-collapse .main-header .navbar-right {
    margin: 7.5px -15px;
  }
  .main-header .navbar-right > li {
    color: inherit;
    border: 0;
  }
}
.main-header .sidebar-toggle {
  float: left;
  background-color: transparent;
  background-image: none;
  padding: 15px 15px;
  font-family: fontAwesome;
}
.main-header .sidebar-toggle:before {
  content: "\f0c9";
}
.main-header .sidebar-toggle:hover {
  color: #fff;
}
.main-header .sidebar-toggle:focus,
.main-header .sidebar-toggle:active {
  background: transparent;
}
.main-header .sidebar-toggle .icon-bar {
  display: none;
}
.main-header .navbar .nav > li.user > a > .fa,
.main-header .navbar .nav > li.user > a > .glyphicon,
.main-header .navbar .nav > li.user > a > .ion {
  margin-right: 5px;
}
.main-header .navbar .nav > li > a > .label {
  position: absolute;
  top: 9px;
  right: 7px;
  text-align: center;
  font-size: 9px;
  padding: 2px 3px;
  line-height: .9;
}
.main-header .logo {
  -webkit-transition: width 0.3s ease-in-out;
  -o-transition: width 0.3s ease-in-out;
  transition: width 0.3s ease-in-out;
  display: block;
  float: left;
  height: 50px;
  font-size: 20px;
  line-height: 50px;
  text-align: center;
  width: 200px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  padding: 0 15px;
  font-weight: 300;
  overflow: hidden;
}
.main-header .logo .logo-lg {
  display: block;
}
.main-header .logo .logo-mini {
  display: none;
}
.main-header .navbar-brand {
  color: #fff;
}
.content-header {
  position: relative;
  padding: 15px 15px 0 15px;
}
.content-header > h1 {
    display: inline;
    font-size: 24px;
    margin: 0;
    position: relative;
}
.content-header > h1 > small {
  font-size: 15px;
  display: inline-block;
  padding-left: 4px;
  font-weight: 300;
}
.content-header > .breadcrumb {
  float: right;
  background: transparent;
  margin-top: 0;
  margin-bottom: 0;
  font-size: 12px;
  padding: 7px 5px;
  position: absolute;
  top: 15px;
  right: 10px;
  border-radius: 2px;
}
.content-header > .breadcrumb > li > a {
  color: #444;
  text-decoration: none;
  display: inline-block;
}
.content-header > .breadcrumb > li > a > .fa,
.content-header > .breadcrumb > li > a > .glyphicon,
.content-header > .breadcrumb > li > a > .ion {
  margin-right: 5px;
}
.content-header > .breadcrumb > li + li:before {
  content: '>\00a0';
}
@media (max-width: 991px) {
  .content-header > .breadcrumb {
    position: relative;
    margin-top: 5px;
    top: 0;
    right: 0;
    float: none;
    background: #d2d6de;
    padding-left: 10px;
  }
  .content-header > .breadcrumb li:before {
    color: #97a0b3;
  }
}
.navbar-toggle {
  color: #fff;
  border: 0;
  margin: 0;
  padding: 15px 15px;
}
@media (max-width: 991px) {
  .navbar-custom-menu .navbar-nav > li {
    float: left;
  }
  .navbar-custom-menu .navbar-nav {
    margin: 0;
    float: left;
  }
  .navbar-custom-menu .navbar-nav > li > a {
    padding-top: 15px;
    padding-bottom: 15px;
    line-height: 20px;
  }
}
@media (max-width: 767px) {
  .main-header {
    position: relative;
  }
  .main-header .logo,
  .main-header .navbar {
    width: 100%;
    float: none;
  }
  .main-header .navbar {
    margin: 0;
  }
  .main-header .navbar-custom-menu {
    float: right;
  }
}
@media (max-width: 991px) {
  .navbar-collapse.pull-left {
    float: none!important;
  }
  .navbar-collapse.pull-left + .navbar-custom-menu {
    display: block;
    position: absolute;
    top: 0;
    right: 40px;
  }
}
/*
 * Component: Sidebar							haha
 * ------------------
 */
.main-sidebar,
.left-side {
  position: absolute;
  top: 0;
  left: 0;
  padding-top: 50px;
 /*  min-height: 100%; */
  width: 200px;
  z-index: 810;
  -webkit-transition: -webkit-transform 0.3s ease-in-out, width 0.3s ease-in-out;
  -moz-transition: -moz-transform 0.3s ease-in-out, width 0.3s ease-in-out;
  -o-transition: -o-transform 0.3s ease-in-out, width 0.3s ease-in-out;
  transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
  background-color: #222d32;
}
@media (max-width: 767px) {
  .main-sidebar,
  .left-side {
    padding-top: 100px;
  }
}
@media (max-width: 767px) {
  .main-sidebar,
  .left-side {
    -webkit-transform: translate(-230px, 0);
    -ms-transform: translate(-230px, 0);
    -o-transform: translate(-230px, 0);
    transform: translate(-230px, 0);
  }
}
@media (min-width: 768px) {
  .sidebar-collapse .main-sidebar,
  .sidebar-collapse .left-side {
    -webkit-transform: translate(-230px, 0);
    -ms-transform: translate(-230px, 0);
    -o-transform: translate(-230px, 0);
    transform: translate(-230px, 0);
  }
}
@media (max-width: 767px) {
  .sidebar-open .main-sidebar,
  .sidebar-open .left-side {
    -webkit-transform: translate(0, 0);
    -ms-transform: translate(0, 0);
    -o-transform: translate(0, 0);
    transform: translate(0, 0);
  }
}
.sidebar {
  padding-bottom: 10px;
}
.sidebar-form input:focus {
  border-color: transparent;
}
.user-panel {
  position: relative;
  width: 100%;
  padding: 10px;
  overflow: hidden;
}
.user-panel:before,
.user-panel:after {
  content: " ";
  display: table;
}
.user-panel:after {
  clear: both;
}
.user-panel > .image > img {
  width: 100%;
  max-width: 45px;
  height: auto;
}
.user-panel > .info {
  padding: 5px 5px 5px 15px;
  line-height: 1;
  position: absolute;
  left: 55px;
}
.user-panel > .info > p {
  font-weight: 600;
  margin-bottom: 9px;
}
.user-panel > .info > a {
  text-decoration: none;
  padding-right: 5px;
  margin-top: 3px;
  font-size: 11px;
}
.user-panel > .info > a > .fa,
.user-panel > .info > a > .ion,
.user-panel > .info > a > .glyphicon {
  margin-right: 3px;
}
.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-menu > li {
  position: relative;
  margin: 0;
  padding: 0;
}
.sidebar-menu > li > a {
  padding: 12px 5px 12px 15px;
  display: block;
}
.sidebar-menu > li > a > .fa,
.sidebar-menu > li > a > .glyphicon,
.sidebar-menu > li > a > .ion {
  width: 20px;
}
.sidebar-menu > li .label,
.sidebar-menu > li .badge {
  margin-top: 3px;
  margin-right: 5px;
}
.sidebar-menu li.header {
  padding: 10px 25px 10px 15px;
  font-size: 12px;
}
.sidebar-menu li > a > .fa-angle-left {
  width: auto;
  height: auto;
  padding: 0;
  margin-right: 10px;
  margin-top: 3px;
}
.sidebar-menu li.active > a > .fa-angle-left {
  -webkit-transform: rotate(-90deg);
  -ms-transform: rotate(-90deg);
  -o-transform: rotate(-90deg);
  transform: rotate(-90deg);
}
.sidebar-menu li.active > .treeview-menu {
  display: block;
}
.sidebar-menu .treeview-menu {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
  padding-left: 5px;
}
.sidebar-menu .treeview-menu .treeview-menu {
  padding-left: 20px;
}
.sidebar-menu .treeview-menu > li {
  margin: 0;
}
.sidebar-menu .treeview-menu > li > a {
  padding: 5px 5px 5px 15px;
  display: block;
  font-size: 14px;
}
.sidebar-menu .treeview-menu > li > a > .fa,
.sidebar-menu .treeview-menu > li > a > .glyphicon,
.sidebar-menu .treeview-menu > li > a > .ion {
  width: 20px;
}
.sidebar-menu .treeview-menu > li > a > .fa-angle-left,
.sidebar-menu .treeview-menu > li > a > .fa-angle-down {
  width: auto;
}

/* Slquadi updation */

li.activate-menu{
	border-left:3px solid #a40000;
	background: #1e282c none repeat scroll 0 0;
    color: #ffffff;
    font-size: 15px;
    margin-left: 1px;
   /*  overflow: hidden; */
}

li.activate-menu:HOVER {
	border-left:3px solid transparent;

}
li.hello:hover{
	border-left: 1px solid transparent;
}

li.compose-button{
	 background: #1a2226 none repeat scroll 0 0;
    color: white;
   /*  overflow: hidden;
    text-overflow: clip;
    margin:0;
    padding-left:25px;
    padding-right:25px;
    padding-bottom: 15px;
    padding-top: 15px; */
    position: relative;
   margin-top: 20px;
   margin-bottom: 20px;
     margin-left: 20px;
    margin-right: 20px;

 /*    width: 150px;
    height: 40px; */
}
li.comp-button{
	 margin-top: 20px;
   margin-bottom: 10px;
     margin-left: 40px;
    margin-right: 20px;
}

li.compose-button .btn{

	/* width: 90%; */
	color: white;
	/* height: 80%; */
}
.sidebar .sidebar-menu .compose-button > a{

	/*  font-size: 11px; */
	color: white;
	/* height: 80%; */
}

	/* following is done to make the compose button visible in mini sidebar */
.sidebar-mini.sidebar-collapse .sidebar-menu .compose-button {
    padding: 0;
    margin: 0;
  }

 .sidebar-mini.sidebar-collapse .sidebar-menu .compose-button .btn-primary {

   background-color: #222d32;
   /*  border-color: #2e6da4; */
    color: #fff;
    border-bottom-color: #222d32;
    padding: 12px 5px 12px 15px;
    margin: 0;
    text-align: left;

  }
  .comp-button .btn{
  font-size: 12px;
  }

 /*  .nano{
  max-height: 300px;
  overflow:auto;
   overflow-y:scroll;
   list-style-type:none;
   padding-left: 20px;
   overflow: auto;
	position: relative;
	padding: 20px;
	background: #333;
	margin: 10px;
	width: 100px;
	max-width: 97%;
	height: 400px;
	-webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;
  } */

  .nano {min-height: 100%; width: 200px; height: 250px;}
.nano > .nano-content { padding-left: 20px;  list-style-type:none; right: 0px;}
.nano > .nano-pane   { background: #888; margin-right: 5px; }
.nano > .nano-pane > .nano-slider { background: #222d32; margin-top:  5px; margin-bottom: 40px; margin-right: 1px; }

  .mc > li {
  	color: white;
  	list-style: none;
  	padding-left: 0px;
  	margin-left: 0px;
  	margin-top: 3px;
  	padding-bottom: 3px;
  }
  .mc{
  	border-top: 1px solid;
  	border-bottom: 1px solid;
  	margin-top: 10px;
  	margin-bottom: 5px;
  	margin-left: 10px;
  	margin-right: 10px;
  }

/* .nav{
    max-height: 300px;
    overflow-y:scroll;
} */

.user-image {
  float: left;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-right: 10px;
  margin-top: -2px;
}
.list-con{
	margin-top: 5px;
	margin-bottom: 3px;
	padding-top: 6px;
	padding-bottom: 10px;
	padding-left: 2px;
	list-style-type:none;
	z-index: 12;
	white-space: nowrap;
	overflow: hidden;

}
.nano > .nano-content > .list-con:HOVER {
	background-color: #1e282c;
}
#popover-content{
	padding: 0;
}
.popover-content{
	padding: 0;
	border-style: none;

}

.contact-popover-box {

     border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top-width: 0;
    padding: 1px 1px 1px 1px;
    width: auto;
    border-style: none;
}

.user-img-name{
	height: 175px;
    text-align: center;
    background-color: #3c8dbc;
    padding: 10px;
    list-style-type:none;
     border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.contact-popover-box > .user-img-name > img {
    border: 3px solid rgba(255, 255, 255, 0.2);
    height: 90px;
    width: 90px;
    z-index: 5;
}
.contact-popover-box > .user-img-name > p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 17px;
    margin-top: 10px;
    z-index: 5;
}
.contact-popover-box > .user-footer {
    background-color: #f9f9f9;
    padding: 10px;
    list-style-type:none;
    height: 40px;
    width: 100%;
}

/*
 * Component: Sidebar Mini
 */
@media (min-width: 768px) {
  .sidebar-mini.sidebar-collapse .main-content,
  .sidebar-mini.sidebar-collapse .right-side,
  .sidebar-mini.sidebar-collapse .main-footer {
    margin-left: 50px!important;
    z-index: 840;
  }
  .sidebar-mini.sidebar-collapse .main-sidebar {
    -webkit-transform: translate(0, 0);
    -ms-transform: translate(0, 0);
    -o-transform: translate(0, 0);
    transform: translate(0, 0);
    width: 50px!important;
    z-index: 850;
  }

    /*  to make compose button invisible on mini sidebar */
  .sidebar-mini.sidebar-collapse .sidebar-menu>.comp-button {
    visibility: hidden;
  }
  	/*  to make small compose button icon visible on mini sidebar */
  .sidebar-mini.sidebar-collapse .sidebar-menu.c-button {
    visibility: visible;
  }

  .sidebar-mini.sidebar-collapse .sidebar-menu > li {
    position: relative;
  }
  .sidebar-mini.sidebar-collapse .sidebar-menu > li > a {
    margin-right: 0;
  }
  .sidebar-mini.sidebar-collapse .sidebar-menu > li > a > span {
    border-top-right-radius: 4px;
  }
  .sidebar-mini.sidebar-collapse .sidebar-menu > li:not(.treeview) > a > span {
    border-bottom-right-radius: 4px;
  }
  .sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu {
    padding-top: 5px;
    padding-bottom: 5px;
    border-bottom-right-radius: 4px;
  }
  .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > span:not(.pull-right),
  .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu {
    display: block!important;
    position: absolute;
    width: 180px;
    left: 50px;
  }
  .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > span {
    top: 0;
    margin-left: -3px;
    padding: 12px 5px 12px 20px;
    background-color: inherit;
  }
  .sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu {
    top: 44px;
    margin-left: 0;
  }
  .sidebar-mini.sidebar-collapse .main-sidebar .user-panel > .info,
  .sidebar-mini.sidebar-collapse .sidebar-form,
  .sidebar-mini.sidebar-collapse .sidebar-menu > li > a > span,
  .sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu,
  .sidebar-mini.sidebar-collapse .sidebar-menu > li > a > .pull-right,
  .sidebar-mini.sidebar-collapse .sidebar-menu li.header {
    display: none!important;
    -webkit-transform: translateZ(0);
  }
  .sidebar-mini.sidebar-collapse .main-header .logo {
    width: 50px;
  }
  .sidebar-mini.sidebar-collapse .main-header .logo > .logo-mini {
    display: block;
    margin-left: -15px;
    margin-right: -15px;
    font-size: 18px;
  }
  .sidebar-mini.sidebar-collapse .main-header .logo > .logo-lg {
    display: none;
  }
  .sidebar-mini.sidebar-collapse .main-header .navbar {
    margin-left: 50px;
  }
}
.sidebar-menu,
.main-sidebar .user-panel,
.sidebar-menu > li.header {
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-menu:hover {
  overflow: visible;
}
.sidebar-form,
.sidebar-menu > li.header {
  overflow: hidden;
  text-overflow: clip;
}
.sidebar-menu li > a {
  position: relative;
}
.sidebar-menu li > a > .pull-right {
  position: absolute;
  top: 50%;
  right: 10px;
  margin-top: -7px;
}

/*Dropdowns in general*/
.dropdown-menu {
  box-shadow: none;
  border-color: #eee;
}
.dropdown-menu > li > a {
  color: #777;
}
.dropdown-menu > li > a > .glyphicon,
.dropdown-menu > li > a > .fa,
.dropdown-menu > li > a > .ion {
  margin-right: 10px;
}
.dropdown-menu > li > a:hover {
  background-color: #e1e3e9;
  color: #333;
}
.dropdown-menu > .divider {
  background-color: #eee;
}

.navbar-nav > .user-menu > .dropdown-menu {
  border-top-right-radius: 0;
  border-top-left-radius: 0;
  padding: 1px 0 0 0;
  border-top-width: 0;
  width: 280px;
}
.navbar-nav > .user-menu > .dropdown-menu,
.navbar-nav > .user-menu > .dropdown-menu > .user-body {
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 4px;
}
.navbar-nav > .user-menu > .dropdown-menu > li.user-header {
  height: 175px;
  padding: 10px;
  text-align: center;
}
.navbar-nav > .user-menu > .dropdown-menu > li.user-header > img {
  z-index: 5;
  height: 90px;
  width: 90px;
  border: 3px solid;
  border-color: transparent;
  border-color: rgba(255, 255, 255, 0.2);
}
.navbar-nav > .user-menu > .dropdown-menu > li.user-header > p {
  z-index: 5;
  color: #fff;
  color: rgba(255, 255, 255, 0.8);
  font-size: 17px;
  margin-top: 10px;
}
.navbar-nav > .user-menu > .dropdown-menu > li.user-header > p > small {
  display: block;
  font-size: 12px;
}
.navbar-nav > .user-menu > .dropdown-menu > .user-body {
  padding: 15px;
  border-bottom: 1px solid #f4f4f4;
  border-top: 1px solid #dddddd;
}
.navbar-nav > .user-menu > .dropdown-menu > .user-body:before,
.navbar-nav > .user-menu > .dropdown-menu > .user-body:after {
  content: " ";
  display: table;
}
.navbar-nav > .user-menu > .dropdown-menu > .user-body:after {
  clear: both;
}
.navbar-nav > .user-menu > .dropdown-menu > .user-body a {
  color: #444 !important;
}
@media (max-width: 991px) {
  .navbar-nav > .user-menu > .dropdown-menu > .user-body a {
    background: #fff !important;
    color: #444 !important;
  }
}
.navbar-nav > .user-menu > .dropdown-menu > .user-footer {
  background-color: #f9f9f9;
  padding: 10px;
}
.navbar-nav > .user-menu > .dropdown-menu > .user-footer:before,
.navbar-nav > .user-menu > .dropdown-menu > .user-footer:after {
  content: " ";
  display: table;
}
.navbar-nav > .user-menu > .dropdown-menu > .user-footer:after {
  clear: both;
}
.navbar-nav > .user-menu > .dropdown-menu > .user-footer .btn-default {
  color: #666666;
}
@media (max-width: 991px) {
  .navbar-nav > .user-menu > .dropdown-menu > .user-footer .btn-default:hover {
    background-color: #f9f9f9;
  }
}
.navbar-nav > .user-menu .user-image {
  float: left;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  margin-right: 10px;
  margin-top: -2px;
}
@media (max-width: 767px) {
  .navbar-nav > .user-menu .user-image {
    float: none;
    margin-right: 0;
    margin-top: -8px;
    line-height: 10px;
  }
}

/* Fix dropdown menu in navbars */
.navbar-custom-menu > .navbar-nav > li {
  position: relative;
}
.navbar-custom-menu > .navbar-nav > li > .dropdown-menu {
  position: absolute;
  right: 0;
  left: auto;
}
@media (max-width: 991px) {
  .navbar-custom-menu > .navbar-nav {
    float: right;
  }
  .navbar-custom-menu > .navbar-nav > li {
    position: static;
  }
  .navbar-custom-menu > .navbar-nav > li > .dropdown-menu {
    position: absolute;
    right: 5%;
    left: auto;
    border: 1px solid #ddd;
    background: #fff;
  }
}

/*
 * Page: Mailbox
 * -------------
 */
.mailbox-messages > .table {
  margin: 0;
}
.mailbox-controls {
  padding: 5px;
  border-bottom: 1px solid #3c8dbc;
}

.mailbox-controls.with-border {
  border-bottom: 1px solid #f4f4f4;
}
.mailbox-read-info {
  border-bottom: 1px solid #f4f4f4;
  padding: 10px;
}
.mailbox-read-info h3 {
  font-size: 20px;
  margin: 0;
}
.mailbox-read-info h5 {
  margin: 0;
  padding: 5px 0 0 0;
}
.mailbox-read-time {
  color: #999;
  font-size: 13px;
}
.mailbox-read-message {
  padding: 10px;
}
.mailbox-attachments li {
  float: left;
  width: 200px;
  border: 1px solid #eee;
  margin-bottom: 10px;
  margin-right: 10px;
}
.mailbox-attachment-name {
  font-weight: bold;
  color: #666;
}
.mailbox-attachment-icon,
.mailbox-attachment-info,
.mailbox-attachment-size {
  display: block;
}
.mailbox-attachment-info {
  padding: 10px;
  background: #f4f4f4;
}
.mailbox-attachment-size {
  color: #999;
  font-size: 12px;
}
.mailbox-attachment-icon {
  text-align: center;
  font-size: 65px;
  color: #666;
  padding: 20px 10px;
}
.mailbox-attachment-icon.has-img {
  padding: 0;
}
.mailbox-attachment-icon.has-img > img {
  max-width: 100%;
  height: auto;
}

/*   main-Content

	Contains the label, email-controlls and table to show emails.
 */

 /*  ============   main-content and sidebar Animation =========== */

 /* .main-content, .right-side {
    min-height: 100%;
    background-color: #ecf0f5;
    z-index: 800;
}
@media (max-width: 767px){
.main-content, .right-side, .main-footer {
    margin-left: 0;
}
}
.main-content, .right-side, .main-footer {
    -webkit-transition: -webkit-transform 0.3s ease-in-out, margin 0.3s ease-in-out;
    -moz-transition: -moz-transform 0.3s ease-in-out, margin 0.3s ease-in-out;
    -o-transition: -o-transform 0.3s ease-in-out, margin 0.3s ease-in-out;
    transition: transform 0.3s ease-in-out, margin 0.3s ease-in-out;
    margin-left: 200px;
    z-index: 820;
}
.main-content, .right-side, .main-footer {
    margin-left: 0;
}

@media (max-width: 767px){
.sidebar-open .main-content, .sidebar-open .right-side, .sidebar-open .main-footer {
    -webkit-transform: translate(200, 0);
    -ms-transform: translate(200, 0);
    -o-transform: translate(200, 0);
    transform: translate(200, 0);
}
.sidebar-open .main-content, .sidebar-open .right-side, .sidebar-open .main-footer {
    transform: translate(200px, 0px);
}}
.main-content, .right-side {
    min-height: 100%;
    background-color: #ecf0f5;
    z-index: 800;
}
@media (max-width: 767px){
.main-content, .right-side, .main-footer {
    margin-left: 0;
}}

@media (max-width: 992px){
.main-content, .right-side, .main-footer {
    margin-left: 0;
}}
.main-content, .right-side, .main-footer {
    -webkit-transition: -webkit-transform 0.3s ease-in-out, margin 0.3s ease-in-out;
    -moz-transition: -moz-transform 0.3s ease-in-out, margin 0.3s ease-in-out;
    -o-transition: -o-transform 0.3s ease-in-out, margin 0.3s ease-in-out;
    transition: transform 0.3s ease-in-out, margin 0.3s ease-in-out;
    margin-left: 200;
    z-index: 820;
}
.main-content, .right-side, .main-footer {
    margin-left: 200px;
}

.main-content {

	background-color: #eeeeec;
	-webkit-transition: -webkit-transform 0.3s ease-in-out, margin 0.3s ease-in-out;
  -moz-transition: -moz-transform 0.3s ease-in-out, margin 0.3s ease-in-out;
  -o-transition: -o-transform 0.3s ease-in-out, margin 0.3s ease-in-out;
  transition: transform 0.3s ease-in-out, margin 0.3s ease-in-out;
  z-index: 820;

} */

 /*    // Animation and sidebar ends */

.content{
	background-color: #ffffff;
	min-height: 100%;;
  	margin-right: auto;
  	margin-left: auto;
  	margin-top: 15px;
  	margin-bottom: 20px;

    background: #ffffff none repeat scroll 0 0;
    border-radius: 3px;
    border-top: 3px solid #3c8dbc;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    position: relative;
    width: 100%;
}
.page-info{
	 border-bottom: 1px solid #c1d5dd;
	 color: #444;
    display: block;
    padding: 10px;
    position: relative;
}
.page-info > h3 {
	display: inline-block;
    font-size: 18px;
    line-height: 1;
    margin: 0;
}

.alert-on-select{
	border-bottom: 1px solid #c1d5dd;
	 color: #444;
    display: block;
    padding: 0;
    position: relative;
 }
.alert-on-select > .alert-dabba{
	margin: 0;
	padding: 3px;
	border: none;
	color: black;
	border-style: none;
	text-align: center;
	background-color: #ffdbdb;
}

.email-table{
	 padding: 0px;
	/*  height: 400px; */
	 overflow: scroll;
	 /* min-height: 100%; */
}

.email-table tbody tr{
	border-left: 3px solid transparent;
}

.email-table tbody tr:HOVER{
	border-left: 3px solid #3c8dbc;
}

.seen{
	background-color: #f3f3f3;
}
.unseen{
	background-color: #ffffff;
}

.table > tbody > tr > td.active:hover,
.table > tbody > tr > th.active:hover,
.table > tbody > tr.active:hover > td,
.table > tbody > tr:hover > .active,
.table > tbody > tr.active:hover > th {
  background-color:transparent;
}

	/* controll bottons for inbox */

.controll-buttons{

	height: 43px;

	text-align: left;
	line-height: 40px;
	border-bottom: 1px solid #c1d5dd;
	-moz-box-shadow: 0 0 30px 5px #999;
-webkit-box-shadow: 0 0 30px 5px #999;

}

.controll-buttons > .select-all{

	margin-left: 8px;
	vertical-align: middle;
}
.controll-buttons > .con-but{
	margin-left: 20px;
	background-color: #eeeeec;
	vertical-align: middle;
	width: 60px;
}

.controll-btn-group{
	display: inline;
	margin-left: 30px;
}
.controll-buttons > .controll-btn-group > .con-but{
	background-color: #eeeeec;
	vertical-align: middle;
	width: 60px;
}
.controll-btn-group-single-select{
	display: inline;
	margin-left: 30px;
}

.controll-buttons > .controll-btn-group-single-select > .con-but{
	background-color: #eeeeec;
	vertical-align: middle;
	width: 60px;
}
	/*  //  controll bottons for inbox  ends  */

	/* controll bottons for View-Mail */

.controll-buttons-vm{

	height: 40px;
	line-height:38px;

	text-align: center;

	border-bottom: 1px solid #f1f1f1;
	-moz-box-shadow: 0 0 30px 5px #999;
-webkit-box-shadow: 0 0 30px 5px #999;

}

/* .controll-buttons-vm > .btn-group > .con-but-vm{
	 color: #444;

	 font-size: 12px;
	 padding: 5px 10px;
}*/
.btn-group-sm > .btn, .btn-sm {
    border-radius: 3px;
    font-size: 12px;
    line-height: 1.5;
    padding: 5px 10px;
    width: 50px;
}
.controll-buttons-vm > .pull-left{
	margin-left: 10px;
	margin-top: 5px;
}
.controll-buttons-vm > .btn-group{

}
.controll-buttons-vm > .btn-group >.pull-right{
	margin-right: 10px;
	margin-top: 5px;
	width: auto;
}

.btn-default {
    background-color: #f4f4f4;
    border-color: #ddd;
    color: #595959;
}

.jumbotron{
	margin-top: 150px;
	width: 100%;
	text-align: center;
  border-bottom: 1px solid #e5e5e5;

}

	/* ==============  Loader ring  =========== */

.show-loader{
	 background: url("../img/ring.gif") no-repeat center center;
	 width:100%;
	 height:100%;
	 margin-top: 150px;
	 text-align: center;
}

.show-loader > label{

	 width:100%;
	 height:100%;
	 margin-top: 150px;
	 text-align: center;
}


text:
<?php

/**
 * I18NHelper.
 *
 * @package    symfony
 * @subpackage helper
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
 * @version    SVN: $Id: I18NHelper.php 31894 2011-01-24 18:12:37Z fabien $
 */

function __($text, $args = array(), $catalogue = 'messages')
{
  if (sfConfig::get('sf_i18n'))
  {
    return sfContext::getInstance()->getI18N()->__($text, $args, $catalogue);
  }
  else
  {
    if (empty($args))
    {
      $args = array();
    }

    // replace object with strings
    foreach ($args as $key => $value)
    {
      if (is_object($value) && method_exists($value, '__toString'))
      {
        $args[$key] = $value->__toString();
      }
    }

    return strtr($text, $args);
  }
}

/**
 * Format a string according to a number.
 *
 * Every segment is separated with |
 * Each segment defines an intervale and a value.
 *
 * For example :
 *
 * * [0]Nobody is logged|[1]There is 1 person logged|(1,+Inf]There are %number persons logged
 *
 * @param string $text      Text used for different number values
 * @param array  $args      Arguments to replace in the string
 * @param int    $number    Number to use to determine the string to use
 * @param string $catalogue Catalogue for translation
 *
 * @return string Result of the translation
 */
function format_number_choice($text, $args = array(), $number, $catalogue = 'messages')
{
  $translated = __($text, $args, $catalogue);

  $choice = new sfChoiceFormat();

  $retval = $choice->format($translated, $number);

  if ($retval === false)
  {
    throw new sfException(sprintf('Unable to parse your choice "%s".', $translated));
  }

  return $retval;
}

function format_country($country_iso, $culture = null)
{
  $c = sfCultureInfo::getInstance($culture === null ? sfContext::getInstance()->getUser()->getCulture() : $culture);
  $countries = $c->getCountries();

  return isset($countries[$country_iso]) ? $countries[$country_iso] : '';
}

function format_language($language_iso, $culture = null)
{
  $c = sfCultureInfo::getInstance($culture === null ? sfContext::getInstance()->getUser()->getCulture() : $culture);
  $languages = $c->getLanguages();

  return isset($languages[$language_iso]) ? $languages[$language_iso] : '';
}


text:
package ottlfuncs

import (
	"context"
	"testing"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"

	"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl"
)

func Test_convertCase(t *testing.T) {
	tests := []struct {
		name     string
		target   ottl.Getter[interface{}]
		toCase   string
		expected interface{}
	}{
		// snake case
		{
			name: "snake simple convert",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return "simpleString", nil
				},
			},
			toCase:   "snake",
			expected: "simple_string",
		},
		{
			name: "snake noop already snake case",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return "simple_string", nil
				},
			},
			toCase:   "snake",
			expected: "simple_string",
		},
		{
			name: "snake multiple uppercase",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return "CPUUtilizationMetric", nil
				},
			},
			toCase:   "snake",
			expected: "cpu_utilization_metric",
		},
		{
			name: "snake hyphens",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return "simple-string", nil
				},
			},
			toCase:   "snake",
			expected: "simple_string",
		},
		{
			name: "snake nil",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return nil, nil
				},
			},
			toCase:   "snake",
			expected: nil,
		},
		{
			name: "snake empty string",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return "", nil
				},
			},
			toCase:   "snake",
			expected: "",
		},
		// camel case
		{
			name: "camel simple convert",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return "simple_string", nil
				},
			},
			toCase:   "camel",
			expected: "SimpleString",
		},
		{
			name: "snake noop already snake case",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return "SimpleString", nil
				},
			},
			toCase:   "camel",
			expected: "SimpleString",
		},
		{
			name: "snake hyphens",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return "simple-string", nil
				},
			},
			toCase:   "camel",
			expected: "SimpleString",
		},
		{
			name: "snake nil",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return nil, nil
				},
			},
			toCase:   "camel",
			expected: nil,
		},
		{
			name: "snake empty string",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return "", nil
				},
			},
			toCase:   "camel",
			expected: "",
		},
		// upper case
		{
			name: "upper simple",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return "simple", nil
				},
			},
			toCase:   "upper",
			expected: "SIMPLE",
		},
		{
			name: "upper complex",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return "complex_SET-of.WORDS1234", nil
				},
			},
			toCase:   "upper",
			expected: "COMPLEX_SET-OF.WORDS1234",
		},
		{
			name: "upper empty string",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return "", nil
				},
			},
			toCase:   "upper",
			expected: "",
		},
		// lower case
		{
			name: "lower simple",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return "SIMPLE", nil
				},
			},
			toCase:   "lower",
			expected: "simple",
		},
		{
			name: "lower complex",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return "complex_SET-of.WORDS1234", nil
				},
			},
			toCase:   "lower",
			expected: "complex_set-of.words1234",
		},
		{
			name: "lower empty string",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return "", nil
				},
			},
			toCase:   "lower",
			expected: "",
		},
		// nil test
		{
			name: "nil",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return nil, nil
				},
			},
			toCase:   "upper",
			expected: nil,
		},
		// non-string test
		{
			name: "non-string",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return 10, nil
				},
			},
			toCase:   "upper",
			expected: nil,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			exprFunc, err := ConvertCase(tt.target, tt.toCase)
			assert.NoError(t, err)
			result, err := exprFunc(nil, nil)
			assert.NoError(t, err)
			assert.Equal(t, tt.expected, result)
		})
	}
}

func Test_convertCaseError(t *testing.T) {
	tests := []struct {
		name   string
		target ottl.Getter[interface{}]
		toCase string
	}{
		{
			name: "error bad case",
			target: &ottl.StandardGetSetter[interface{}]{
				Getter: func(ctx context.Context, tCtx interface{}) (interface{}, error) {
					return "simpleString", nil
				},
			},
			toCase: "unset",
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			_, err := ConvertCase(tt.target, tt.toCase)
			require.Error(t, err)
			assert.ErrorContains(t, err, "invalid case: unset, allowed cases are: lower, upper, snake, camel")
		})
	}
}


text:
This project is archived and no longer maintained. At the time of archiving,
open issues and pull requests were closed and tagged with `2018-05-archive`.
For pre-existing users who need an open source alternative, we recommend taking
a look at [airlift/drift](https://github.com/airlift/drift).

# Swift Service

Swift Service is a simple library annotating services to be exported with
Thrift.

# Clients and Servers

In Swift, a Thrift client is simply a Java interface annotated with `@ThriftService`, and a
Thrift server is simply a Java class annotated with `@ThriftService`.  All of the
annotations documented below apply to both clients and servers.  In addition to annotating
the class or interface directly, Swift supports annotations on a super classes or
interfaces.  This means that you can create a server by implementing the client interface
without having to annotate twice.  For example the scribe server below implements the
scribe interface:

    @ThriftService
    public interface Scribe
    {
        @ThriftMethod
        ResultCode log(List<LogEntry> messages);
    }

    public class SwiftScribe implements Scribe
    {
        private final List<LogEntry> messages = new ArrayList<>();

        public List<LogEntry> getMessages()
        {
            return messages;
        }

        @Override
        public ResultCode log(List<LogEntry> messages)
        {
            this.messages.addAll(messages);
            return ResultCode.OK;
        }
    }

# Method

Swift will export all methods annotated with `@ThiftMethod`.  Swift will assume
that the Java method and the Thrift method have the same name, so if they
don't, just add a value to the annotation like this
`@ThriftMethod("myMethodName")`.

    @ThriftService
    public interface Scribe
    {
        @ThriftMethod("Log")
        ResultCode process(List<LogEntry> messages);
    }

# Parameters

In Thrift, method parameters are encoded as a Thrift struct, so each parameter
must have a name and an id.  Swift assumes the parameters are numbered starting
with one, and assuming you have compiled with debug symbols, the Thrift
parameter names match the Java parameter names.  If you want to use a different
id or name, simply annotate the parameter as follows:

    @ThriftService
    public interface Scribe
    {
        @ThriftMethod
        ResultCode log(@ThriftField(value = 3, name = "mesg") List<LogEntry> messages);
    }

# Exceptions

As with method parameters, Thrift encodes the response as a struct with field
zero being a standard return and exceptions be stored in higher number fields.
If the Java method throws only one exception annotated with @ThriftStruct,
Swift will assume the result struct field id is `1`.  Otherwise you will need to
add the extremely verbose `@ThriftException` annotations as follows:

    @ThriftMethod(exception = {
          @ThriftException(type = MyException.class, id = 1),
          @ThriftException(type = MyOther.class, id = 2)
    })
    void doSomething() throws MyException, MyOther
    {
    }

# Thrift Client

## Client Manager

Swift client implementations can be created using the `ThriftClientManager`.  The
following code creates a Scribe client:

    ThriftClientManager clientManager = new ThriftClientManager();
    FramedClientConnector connector = new FramedClientConnector(fromParts("localhost", port));
    Scribe scribe = clientManager.createClient(connector, Scribe.class).get();

A `ClientManager` owns an executor, which typically represents a pool of threads, so it is
a heavyweight object. Generally, a single `ClientManager` can (and should) be used to create
all the clients you will need.

## Client Connectors

In the example above, a `FramedClientConnector` is used to create a client that uses a
framed transport (each message is preceded by a 4-byte frame size). Other types of
connectors exist to connect to servers that use other transports
(e.g. `HttpClientConnector`, `UnframedClientConnector`).

## Asynchronous client calls

If you want to make asynchronous thrift requests, simple change the return type of the
corresponding method to a ListenableFuture, as shown here:

    @ThriftMethod()
    ListenableFuture<List<Integer>> getValues();

and the future will be set when the server returns a value. When adding listeners that do
non-trivial work when the future is set, keep in mind that if you do not provide an
executor for listeners to run on, they will run on the NIO threads, and therefore can
potentially block other clients.

## Client Cleanup

Each client owns a connection that should be closed when the client is no longer in use.
Swift automatically implements a `close()` method to every client to allow for cleanup of
the resources.  To access this method, you will need to explicitly declare it in your
interface, or extend from `AutoCloseable`.  If your client interface extends from
`AutoCloseable`, you can use Java 7 resource management to clean up the socket.

    @ThriftService
    public interface Scribe extends AutoCloseable
    {
        @ThriftMethod
        ResultCode log(List<LogEntry> messages);
    }

    ThriftClientManager clientManager = new ThriftClientManager();
    FramedClientConnector connector = new FramedClientConnector(fromParts("localhost", port));
    try (Scribe scribe = clientManager.createClient(connector, Scribe.class).get()) {
        return scribe.log(entries);
    }

You should also `close()` the `ThriftClientManager` when it is no longer useful (e.g. when
your service is shutting down).

# Thrift Server

Swift services can be integrated into existing Thrift servers with the
`ThriftServiceProcessor` class, which implements the core Thrift service
interface `TProcessor`.  The following code creates a Scribe server `TProcessor`:

    SwiftScribe scribeService = new SwiftScribe();
    TProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), scribeService);

Additionally, Swift supports mix in style servers where multiple Thrift services can be
exported on the same port without having to use Java class inheritance.  The only
restriction is that the services must have non-overlaping method names.  For example, to
create a `TProcessor` for Scribe and some StatsService, you would write:

    new ThriftServiceProcessor(new ThriftCodecManager(),
            scribeService,
            statsService);

## Nifty Integration

Swift includes and integrates with Nifty (a Netty NIO-based thrift server)

    ThriftServer server = new ThriftServer(processor, new ThriftServerConfig().setPort(8899));
    server.start();

For testing, you can use the much simpler try with resources style on a random port:

    ThriftServiceProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), new SwiftScribe());
    try (
            ThriftServer server = new ThriftServer(processor).start();
            ThriftClientManager clientManager = new ThriftClientManager();
            FramedClientConnector connector = new FramedClientConnector(fromParts("localhost", server.getPort()));
            Scribe scribeClient = clientManager.createClient(connector, Scribe.class).get()
    ) {
        scribeClient.log(entries);
    }

# Guice Support

Swift includes optional support for binding clients and servers into Guice.

## Binding Client in Guice

To bind a client, add the `ThriftClientModule` and the `ThriftCodecModule` to the injector
and bind the clients with the fluent `ThriftClientBinder` as follows:

    Injector injector = Guice.createInjector(Stage.PRODUCTION,
            new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
            new ThriftCodecModule(),
            new ThriftClientModule(),
            new Module()
            {
                @Override
                public void configure(Binder binder)
                {
                    thriftClientBinder(binder).bindThriftClient(Scribe.class);
                }
            });

Then, simply add the `ThriftClient` type to any `@Inject` annotated field or method.  Like this:

    public MyClass(ThriftClient<Scribe> scribeClient)
    {
        FramedClientConnector connector = new FramedClientConnector(fromParts("localhost", 8899));
        try (Scribe scribe = scribeClient.open(connector).get()) {
            scribeClient.log(entries);
        }
    }

## Exporting a Service in Guice

Exporting a service is simmilar to binding a client.  Add the `ThriftServerModule` and the
`ThriftCodecModule` to the injector and exporting the services with the fluent
`ThriftServiceExporter` as follows:

    Injector injector = Guice.createInjector(Stage.PRODUCTION,
            new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
            new ThriftCodecModule(),
            new ThriftServerModule(),
            new Module()
            {
                @Override
                public void configure(Binder binder)
                {
                    // bind scribe service implementation
                    binder.bind(SwiftScribe.class).in(Scopes.SINGLETON);

                    // export scribe service implementation
                    thriftServerBinder(binder).exportThriftService(SwiftScribe.class);
                }
            });

Then simply, start the `ThriftServer` with:

    injector.getInstance(ThriftServer.class).start()

You can export as many services as you like as long as the services have unique method
names.  If you have overlaping method names, you will need to run two servers (Thrift does
not support method namspacing).


text:
package com.cbooy.mmpa.test;

import java.util.List;

import android.test.AndroidTestCase;
import android.util.Log;

import com.cbooy.mmpa.db.NumBlackListDBHelper;
import com.cbooy.mmpa.db.dao.NumBlackListDao;
import com.cbooy.mmpa.db.dao.impl.NumBlackListDaoImpl;
import com.cbooy.mmpa.model.NumBlackListPojo;

public class BlackNumListTestCases extends AndroidTestCase {

	private final static String TAG = "BlackNumListTestCases";

	private NumBlackListDao blackListDao;

	public void testCreateDB(){
		NumBlackListDBHelper db = new NumBlackListDBHelper(getContext());
		db.getWritableDatabase();
	}

	public void testAdd(){
		blackListDao = new NumBlackListDaoImpl(getContext());

		for (int i = 100; i < 200; i++) {
			NumBlackListPojo pojo = new NumBlackListPojo();

			pojo.setNum("18523470" + i);

			pojo.setMod(String.valueOf(i % 3));

			blackListDao.add(pojo );
		}
	}

	public void testDel(){
		blackListDao = new NumBlackListDaoImpl(getContext());

		blackListDao.delete("18523470215");
	}

	public void testUpdate(){
		blackListDao = new NumBlackListDaoImpl(getContext());

		NumBlackListPojo pojo = new NumBlackListPojo();

		pojo.setNum("18523470215");

		pojo.setMod("3");

		blackListDao.update(pojo );
	}

	public void testFindAll(){
		blackListDao = new NumBlackListDaoImpl(getContext());

		List<NumBlackListPojo> pojos = blackListDao.findAll();

		Log.i(TAG, String.valueOf(pojos.size()));
		Log.i(TAG, pojos.toString());
	}

	public void testQueryOne(){
		blackListDao = new NumBlackListDaoImpl(getContext());

		NumBlackListPojo pojo = blackListDao.findOneByNum("18523470215");

		Log.i(TAG, pojo.toString());
	}
}


text:
package moe;

import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;

@SuppressWarnings("unused")
public final class Words extends Table {
  public static Words getRootAsWords(ByteBuffer _bb) { return getRootAsWords(_bb, new Words()); }
  public static Words getRootAsWords(ByteBuffer _bb, Words obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
  public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
  public Words __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

  public int word(int j) { int o = __offset(4); return o != 0 ? bb.getShort(__vector(o) + j * 2) & 0xFFFF : 0; }
  public int wordLength() { int o = __offset(4); return o != 0 ? __vector_len(o) : 0; }
  public ByteBuffer wordAsByteBuffer() { return __vector_as_bytebuffer(4, 2); }

  public static int createWords(FlatBufferBuilder builder,
      int wordOffset) {
    builder.startObject(1);
    Words.addWord(builder, wordOffset);
    return Words.endWords(builder);
  }

  public static void startWords(FlatBufferBuilder builder) { builder.startObject(1); }
  public static void addWord(FlatBufferBuilder builder, int wordOffset) { builder.addOffset(0, wordOffset, 0); }
  public static int createWordVector(FlatBufferBuilder builder, short[] data) { builder.startVector(2, data.length, 2); for (int i = data.length - 1; i >= 0; i--) builder.addShort(data[i]); return builder.endVector(); }
  public static void startWordVector(FlatBufferBuilder builder, int numElems) { builder.startVector(2, numElems, 2); }
  public static int endWords(FlatBufferBuilder builder) {
    int o = builder.endObject();
    return o;
  }
}


text:
// Copyright (c) 2015, Rod Dong <rod.dong@gmail.com>
// All rights reserved.
//
// Use of this source code is governed by The MIT License.

// Package command is to handle the command from client.
package command

import (
	//"strconv"

	//"github.com/aegsea/rodis/resp"
	//"github.com/aegsea/rodis/storage"
)

// Implement for command list in http://redis.io/commands#list

/*
func lpush(v resp.CommandArgs, ex *CommandExtras) error {
	if len(v) <= 1 {
		return resp.NewError(ErrFmtWrongNumberArgument, "lpush").WriteTo(ex.Buffer)
	}

	ex.DB.Lock()
	defer ex.DB.Unlock()

	keyExists, tipe, expireAt := ex.DB.Has(v[0])
	if keyExists && tipe != storage.Hash {
		return resp.NewError(ErrWrongType).WriteTo(ex.Buffer)
	}

	l := ex.DB.ListPush(v[0], v[1:].ToBytes())
	return resp.Integer(l).WriteTo(ex.Buffer)
}
*/


text:
function directive (e, el, binding, v) {
  // The include element callbacks below can be expensive
  // so we should avoid calling them when we're not active.
  // Explicitly check for false to allow fallback compatibility
  // with non-toggleable components
  if (!e || v.context.isActive === false) return

  // If click was triggered programmaticaly (domEl.click()) then
  // it shouldn't be treated as click-outside
  // Chrome/Firefox support isTrusted property
  // IE/Edge support pointerType property (empty if not triggered
  // by pointing device)
  if (!e.isTrusted || ('pointerType' in e && !e.pointerType)) return

  // Get value passed to directive
  const val = binding.value || (() => true)
  // Check if callback was passed in object or as the value
  const cb = val.callback || val
  // Check if additional elements were passed to be included in check
  // (click must be outside all included elements, if any)
  const elements = (val.include || (() => []))()
  // Add the root element for the component this directive was defined on
  elements.push(el)

  // Check if it's a click outside our elements, and then if our callback returns true.
  // Non-toggleable components should take action in their callback and return falsy.
  // Toggleable can return true if it wants to deactivate.
  // Note that, because we're in the capture phase, this callback will occure before
  // the bubbling click event on any outside elements.
  if (!clickedInEls(e, elements) && cb(e)) {
    // Delay setting toggleable inactive to avoid conflicting
    // with an outside click on any activator toggling our state.
    setTimeout(() => (v.context.isActive = false), 0)
  }
}

function clickedInEls (e, elements) {
  // Get position of click
  const { clientX: x, clientY: y } = e
  // Loop over all included elements to see if click was in any of them
  for (const el of elements) {
    if (clickedInEl(el, x, y)) return true
  }

  return false
}

function clickedInEl (el, x, y) {
  // Get bounding rect for element
  // (we're in capturing event and we want to check for multiple elements,
  //  so can't use target.)
  const b = el.getBoundingClientRect()
  // Check if the click was in the element's bounding rect

  return x >= b.left && x <= b.right && y >= b.top && y <= b.bottom
}

export default {
  name: 'click-outside',

  bind (el, binding, v) {
    const onClick = e => directive(e, el, binding, v)
    // iOS does not recognize click events on document
    // or body, this is the entire purpose of the v-app
    // component and [data-app], stop removing this
    const app = document.querySelector('[data-app]') ||
      document.body // This is only for unit tests
    app.addEventListener('click', onClick, true)
    el._clickOutside = onClick
  },

  unbind (el) {
    const app = document.querySelector('[data-app]') ||
      document.body // This is only for unit tests
    app && app.removeEventListener('click', el._clickOutside, true)
  }
}


text:
namespace i18n {
namespace addressinput {
class PreloadSupplier;
class RegionData;
struct AddressData;
}
}

namespace autofill {

// Suggests address completions for a partially entered address from the user.
class InputSuggester {
 public:
  // Does not take ownership of |supplier|, which should not be NULL.
  explicit InputSuggester(::i18n::addressinput::PreloadSupplier* supplier);

  InputSuggester(const InputSuggester&) = delete;
  InputSuggester& operator=(const InputSuggester&) = delete;

  ~InputSuggester();

  // Fills in |suggestions| for the partially typed in |user_input|, assuming
  // the user is typing in the |focused_field|. If the number of |suggestions|
  // is over the |suggestion_limit|, then returns no |suggestions| at all.
  //
  // Sample user input 1:
  //   country code = "US"
  //   postal code = "90066"
  //   focused field = POSTAL_CODE
  //   suggestions limit = 1
  // Suggestion:
  //   [{administrative_area: "CA"}]
  //
  // Sample user input 2:
  //   country code = "CN"
  //   dependent locality = "Zongyang"
  //   focused field = DEPENDENT_LOCALITY
  //   suggestions limit = 10
  // Suggestion:
  //   [{dependent_locality: "Zongyang Xian",
  //     locality: "Anqing Shi",
  //     administrative_area: "Anhui Sheng"}]
  //
  // Builds the index for generating suggestions lazily.
  //
  // The |suggestions| parameter should not be NULL. The |focused_field|
  // parameter should be either POSTAL_CODE or between ADMIN_AREA and
  // DEPENDENT_LOCALITY inclusively.
  void GetSuggestions(
      const ::i18n::addressinput::AddressData& user_input,
      ::i18n::addressinput::AddressField focused_field,
      size_t suggestion_limit,
      std::vector< ::i18n::addressinput::AddressData>* suggestions);

 private:
  class SubRegionData;

  // Canonicalizes strings for case and diacritic insensitive comparison.
  class StringCanonicalizer {
   public:
    // Initializes the canonicalizer. This is slow, so avoid calling it more
    // often than necessary.
    StringCanonicalizer();

    StringCanonicalizer(const StringCanonicalizer&) = delete;
    StringCanonicalizer& operator=(const StringCanonicalizer&) = delete;

    ~StringCanonicalizer();

    // Returns a 0-terminated canonical version of the string that can be used
    // for comparing strings regardless of diacritics and capitalization.
    //    Canonicalize("Texas") == Canonicalize("T\u00E9xas");
    //    Canonicalize("Texas") == Canonicalize("teXas");
    //    Canonicalize("Texas") != Canonicalize("California");
    //
    // The output is not human-readable.
    //    Canonicalize("Texas") != "Texas";
    //
    // The |original| parameter should not be empty.
    const std::vector<uint8_t>& Canonicalize(const std::string& original) const;

   private:
    int32_t buffer_size() const;

    mutable std::vector<uint8_t> buffer_;
    std::unique_ptr<icu::Collator> collator_;
  };

  // The method to be invoked by |validated_| callback.
  void Validated(bool success,
                 const ::i18n::addressinput::AddressData&,
                 const ::i18n::addressinput::FieldProblemMap&);

  // Data source for region data.
  ::i18n::addressinput::RegionDataBuilder region_data_builder_;

  // Suggests sub-regions based on postal code.
  const ::i18n::addressinput::AddressInputHelper input_helper_;

  // Verifies that suggested sub-regions match the postal code.
  ::i18n::addressinput::AddressValidator validator_;

  // The callback for |validator_| to invoke when validation finishes.
  const std::unique_ptr<const ::i18n::addressinput::AddressValidator::Callback>
      validated_;

  // A mapping from a COUNTRY level region to a collection of all of its
  // sub-regions along with metadata used to construct suggestions.
  std::map<const ::i18n::addressinput::RegionData*, SubRegionData> sub_regions_;

  // Canonicalizes strings for case and diacritic insensitive search of
  // sub-region names.
  StringCanonicalizer canonicalizer_;
};

}  // namespace autofill

#endif  // THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_INPUT_SUGGESTER_H_


text:
extern "C"
{
rmw_ret_t
rmw_get_gid_for_publisher(const rmw_publisher_t * publisher, rmw_gid_t * gid)
{
  if (!publisher) {
    RMW_SET_ERROR_MSG("publisher is null");
    return RMW_RET_ERROR;
  }
  RMW_CHECK_TYPE_IDENTIFIERS_MATCH(
    publisher handle,
    publisher->implementation_identifier,
    opensplice_cpp_identifier,
    return RMW_RET_ERROR)
  if (!gid) {
    RMW_SET_ERROR_MSG("gid is null");
    return RMW_RET_ERROR;
  }

  const OpenSpliceStaticPublisherInfo * publisher_info =
    static_cast<const OpenSpliceStaticPublisherInfo *>(publisher->data);
  if (!publisher_info) {
    RMW_SET_ERROR_MSG("publisher info handle is null");
    return RMW_RET_ERROR;
  }

  *gid = publisher_info->publisher_gid;
  return RMW_RET_OK;
}
}  // extern "C"