text:
package gov.nih.nci.evs.restapi.bean;

import java.io.*;
import java.util.*;
import java.net.*;

import com.google.gson.*;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver;
import com.thoughtworks.xstream.io.xml.DomDriver;
import com.thoughtworks.xstream.XStream;

public class Definition
{

// Variable declaration
	private String code;
	private String label;
	private String propertyLabel;
	private String description;
	private String attribution;
	private String source;

// Default constructor
	public Definition() {
	}

// Constructor
	public Definition(
		String description,
		String source) {

		this.code = null;
		this.label = null;
		this.propertyLabel = "DEFINITION";
		this.description = description;
		this.attribution = null;
		this.source = source;
	}

	public Definition(
		String code,
		String label,
		String description,
		String attribution,
		String source) {

		this.code = code;
		this.label = label;
		this.propertyLabel = "DEFINITION";
		this.description = description;
		this.attribution = attribution;
		this.source = source;
	}

// Set methods
	public void setCode(String code) {
		this.code = code;
	}

	public void setLabel(String label) {
		this.label = label;
	}
/*
	public void setPropertyLabel(String propertyLabel) {
		this.propertyLabel = propertyLabel;
	}
*/
	public void setDescription(String description) {
		this.description = description;
	}

	public void setAttribution(String attribution) {
		this.attribution = attribution;
	}

	public void setSource(String source) {
		this.source = source;
	}

// Get methods
	public String getCode() {
		return this.code;
	}

	public String getLabel() {
		return this.label;
	}

	public String getPropertyLabel() {
		return this.propertyLabel;
	}

	public String getDescription() {
		return this.description;
	}

	public String getAttribution() {
		return this.attribution;
	}

	public String getSource() {
		return this.source;
	}

	public String toXML() {
		XStream xstream_xml = new XStream(new DomDriver());
		String xml = xstream_xml.toXML(this);
		xml = escapeDoubleQuotes(xml);
		StringBuffer buf = new StringBuffer();
		String XML_DECLARATION = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
		buf.append(XML_DECLARATION).append("\n").append(xml);
		xml = buf.toString();
		return xml;
	}

	public String toJson() {
		JsonParser parser = new JsonParser();
		Gson gson = new GsonBuilder().setPrettyPrinting().create();
        return gson.toJson(this);
	}

	public String escapeDoubleQuotes(String inputStr) {
		char doubleQ = '"';
		StringBuffer buf = new StringBuffer();
		for (int i=0;  i<inputStr.length(); i++) {
			char c = inputStr.charAt(i);
			if (c == doubleQ) {
				buf.append(doubleQ).append(doubleQ);
			}
			buf.append(c);
		}
		return buf.toString();
	}

	public String toString() {
        return this.code
        + "|" + this.label + "|"
        + "P97|"
        + this.description + "|"
        + "P381|"
        + this.attribution + "|"
        + "P378|"
        + this.source;
	}

}


text:
title: Activation Strategies
---

It is powerful to be able to turn a feature on and off instantaneously, without redeploying the application. The next level of control comes when you are able to enable a feature for specific users or enable it for a small subset of users. We achieve this level of control with the help of activation strategies. The most straightforward strategy is the standard strategy, which basically means that the feature should be enabled to everyone.

Unleash comes with a number of built-in strategies (described below) and also lets you add your own [custom activation strategies](../reference/custom-activation-strategies.md) if you need more control. However, while activation strategies are _defined_ on the server, the server does not _implement_ the strategies. Instead, activation strategy implementation is done client-side. This means that it is _the client_ that decides whether a feature should be enabled or not.

All [server-side client SDKs](../reference/sdks/index.md#server-side-sdks) and the [Unleash Proxy](../reference/unleash-proxy.md) implement the default strategies (and allow you to add your own [custom strategy implementations](../reference/custom-activation-strategies.md#implementation)). The [front-end client SDKs](../reference/sdks/index.md#front-end-sdks) do not do the evaluation themselves, instead relying on the [Unleash Proxy](../reference/unleash-proxy.md) to take care of the implementation and evaluation.

Some activation strategies require the client to provide the current [Unleash context](unleash-context.md) to the toggle evaluation function for the evaluation to be done correctly.

The following activation strategies are bundled with Unleash and always available:

- [Standard](#standard)
- [UserIDs](#userids)
- [Gradual Rollout](#gradual-rollout)
- [IPs](#ips)
- [Hostnames](#hostnames)

## Standard {#standard}

A basic strategy that means "active for everyone".

This strategy has the following modelling name in the code:

- **default**

## UserIDs {#userids}

Active for users with a `userId` defined in the `userIds` list. A typical use case is to enable a feature for a few specific devs or key persons before enabling the feature for everyone else. This strategy allows you to specify a list of user IDs that you want to expose the new feature for. (A user id may, of course, be an email if that is more appropriate in your system.)

**Parameters**

- userIds - _List of user IDs you want the feature toggle to be enabled for_

This strategy has the following modelling name in the code:

- **userWithId**

## Gradual Rollout {#gradual-rollout}

A flexible rollout strategy which combines all gradual rollout strategies in to a single strategy. This strategy allows you to customize what parameter should be sticky, and defaults to userId or sessionId.

**Parameters**

- **stickiness** is used to define how we guarantee consistency for a gradual rollout. The same userId and the same rollout percentage should give predictable results. Configuration that should be supported:
  - **default** - Unleash chooses the first value present on the context in defined order userId, sessionId, random.
  - **userId** - guaranteed to be sticky on userId. If userId not present the behavior would be false
  - **sessionId** - guaranteed to be sticky on sessionId. If sessionId not present the behavior would be false.
  - **random** - no stickiness guaranteed. For every isEnabled call it will yield a random true/false based on the selected rollout percentage.
- **groupId** is used to ensure that different toggles will **hash differently** for the same user. The groupId defaults to _feature toggle name_, but the user can override it to _correlate rollout_ of multiple feature toggles.
- **rollout** The percentage (0-100) you want to enable the feature toggle for.

This strategy has the following modelling name in the code:

- **flexibleRollout**

### Custom stickiness (beta) {#custom-stickiness}

:::note
This feature is currently in beta and is not yet supported by all our SDKs. Check out the [SDK compatibility table](../reference/sdks/index.md#server-side-sdk-compatibility-table) to see what SDKs support it at the moment.

:::

By enabling the stickiness option on a custom context field you can use the custom context field to group users with the gradual rollout strategy. This will guarantee a consistent behavior for specific values of this context field.

## IPs {#ips}

The remote address strategy activates a feature toggle for remote addresses defined in the IP list. We occasionally use this strategy to enable a feature only for IPs in our office network.

**Parameters**

- IPs - _List of IPs to enable the feature for._

This strategy has the following modelling name in the code:

- **remoteAddress**

## Hostnames {#hostnames}

The application hostname strategy activates a feature toggle for client instances with a hostName in the `hostNames` list.

**Parameters**

- hostNames - _List of hostnames to enable the feature toggle for._

This strategy has the following modelling name in the code:

- **applicationHostname**

## Multiple activation strategies {#multiple-activation-strategies}

You can apply as many activation strategies to a toggle as you want. When a toggle has multiple strategies, Unleash will check each strategy in isolation. If any one of the strategies would enable the toggle for the current user, then the toggle is enabled.

As an example, consider a case where you want to roll a feature out to 75% of your users. However, you also want to make sure that you and your product lead get access to the feature. To achieve this, you would apply a **gradual rollout** strategy and set it to 75%. Additionally, you would add a **user IDs** strategy and add `engineer@mycompany.com` and `productlead@mycompany.com`.

![A feature toggle with two active strategies: a user ID strategy and a gradual rollout strategy. The strategies are configured as described in the preceding paragraph.](/img/control_rollout_multiple_strategies.png)

## Deprecated strategies

### gradualRolloutUserId (DEPRECATED from v4) - Use Gradual rollout instead {#gradualrolloutuserid-deprecated-from-v4---use-gradual-rollout-instead}

The `gradualRolloutUserId` strategy gradually activates a feature toggle for logged-in users. Stickiness is based on the user ID. The strategy guarantees that the same user gets the same experience every time across devices. It also assures that a user which is among the first 10% will also be among the first 20% of the users. That way, we ensure the users get the same experience, even if we gradually increase the number of users exposed to a particular feature. To achieve this, we hash the user ID and normalize the hash value to a number between 1 and 100 with a simple modulo operator.

![hash_and_normalise](/img/hash_and_normalise.png)

Starting from v3.x all clients should use the 32-bit [MurmurHash3](https://en.wikipedia.org/wiki/MurmurHash) algorithm to normalize values. ([issue 247](https://github.com/Unleash/unleash/issues/247))

**Parameters**

- percentage - _The percentage (0-100) you want to enable the feature toggle for._
- groupId - _Used to define an activation group, which allows you to correlate rollout across feature toggles._

### gradualRolloutSessionId (DEPRECATED from v4) - Use Gradual rollout instead {#gradualrolloutsessionid-deprecated-from-v4---use-gradual-rollout-instead}

Similar to `gradualRolloutUserId` strategy, this strategy gradually activates a feature toggle, with the exception being that the stickiness is based on the session IDs. This makes it possible to target all users (not just logged-in users), guaranteeing that a user will get the same experience within a session.

**Parameters**

- percentage - _The percentage (0-100) you want to enable the feature toggle for._
- groupId - _Used to define an activation group, which allows you to correlate rollout across feature toggles._

### gradualRolloutRandom (DEPRECATED from v4) - Use Gradual rollout instead {#gradualrolloutrandom-deprecated-from-v4---use-gradual-rollout-instead}

The `gradualRolloutRandom` strategy randomly activates a feature toggle and has no stickiness. We have found this rollout strategy very useful in some scenarios, especially when we enable a feature which is not visible to the user. It is also the strategy we use to sample metrics and error reports.

**Parameters**

- percentage - _The percentage (0-100) you want to enable the feature toggle for._

redpajama_set_name: RedPajamaGithub


text:
require File.expand_path('../../../spec_helper', __FILE__)

ruby_version_is "1.9" do
  describe "Symbol#<=> with Symbol" do
    it "compares individual characters based on their ascii value" do
      ascii_order = Array.new(256) { |x| x.chr.to_sym }
      sort_order = ascii_order.sort
      sort_order.should == ascii_order
    end

    it "returns -1 when self is less than other" do
      (:this <=> :those).should == -1
    end

    it "returns 0 when self is equal to other" do
      (:yep <=> :yep).should == 0
    end

    it "returns 1 when self is greater than other" do
      (:yoddle <=> :griddle).should == 1
    end

    it "considers symbol that comes lexicographically first to be less if the symbols have same size" do
      (:aba <=> :abc).should == -1
      (:abc <=> :aba).should == 1
    end

    it "doesn't consider shorter string to be less if longer string starts with shorter one" do
      (:abc <=> :abcd).should == -1
      (:abcd <=> :abc).should == 1
    end

    it "compares shorter string with corresponding number of first chars of longer string" do
      (:abx <=> :abcd).should == 1
      (:abcd <=> :abx).should == -1
    end
  end

  # Note: This is inconsistent with Array#<=> which calls #to_ary instead of
  # just using it as an indicator.
  describe "Symbol#<=>" do
    it "returns nil if its argument does not provide #to_sym" do
      (:abc <=> 1).should == nil
      (:abc <=> mock('x')).should == nil
    end

    it "returns nil if its argument does not provide #<=>" do
      obj = mock('x')
      (:abc <=> obj).should == nil
    end
  end
end


text:
define(["decj"],function(decj){
  var log=decj.App.log;
 return {
    resources:['res/demo-basic'],/*Declare resource files required by this module*/
    screen:'UpdateRegInfo.htm',
    css:["form.css","decj.css"],
    metaDataURL:'handler.php?src=metaData.json',
    validators:{
      "valueConfirm":function(value,params){
        var result={valid:true};
        if(document.forms[0]['passwd'].value!=document.forms[0]['passwd-re'].value){
          result.valid=false;
          result.message="res pwd.not.match".val(params);
        }
        return result;
      }
    },
    forms:{
      "userInfo":{
        resident:true,
        method:'PUT',
        //encodingType:"application/x-www-form-urlencoded",
        filter:function(form,data,originalData){/*Make some extra processing on packaged form data*/
          var pwd=data.passwd;
          var pwdHash=CryptoJS.SHA256(pwd).toString();
          data.passwd=pwdHash;
        },
        submitSuccess:function(data){/*This is a callback that will be invoked after a form is successfully submitted*/
          alert("Server date:"+data.date+"\n"+"res form.submit.ok".val({memberId:data.id}));
        },
        validation:{/*Declare extra validation rules for a form field*/
          "passwd":{"valueConfirm":{}},
          "passwd-re":{"valueConfirm":{}}
        }
      }
    },
    events:{
      "click@#chkShowLog":function(){
        $("#log").toggle();
      },
      "click@#chkDemoExpl":function(){/*Declare an event handler for click event on HTML element whose ID is btnDemoExpl */
         var alreadyLoaded=$('#demoExplain').data('explLoaded');
         if(alreadyLoaded){
          $('#demoExplain').toggle();
         }else{
          log("Load demo explanation...");
          //Load moudle module/UpdateRegInfoExplain
          "module module/UpdateRegInfoExplain".val({
            viewTarget:'demoExplain',
            resident:true,
            locale:$('#demoExplain').data('locale')});
          $('#demoExplain').data('expl-loaded',true);
         }
      },
      "change@[name=lang]":function(){/*Declare an event handler for change event on HTML element whose name is lang */
         var locale=$(this).val();
         if(""!=locale){
          var answer=confirm("res change.lang.tip".val());
          if(answer){
            decj.App.locale=locale;
            //Load moudle module/UpdateRegInfoStatic
            'module module/UpdateRegInfoStatic'.val({
              resident:false,
              httpRequest:{
                  url:'handler.php?src=userInfoData.json'
              }
            });
            $('#demoExplain').data('explLoaded',false);
          }
         }
      },
      "click@#unloadModule":function(){
        decj.unloadModule('wkspc');
      }
    },
    preInit:function(){
      log("HTML/CSS/Javascript loaded for the demo module.");
    },
    init:function(){
      $('#progressTip').css('display','none');
      $('[name=lang]').val(decj.App.locale);
      log("The demo initilized");
      log("Page was loaded",new Date(window.pageLoadeTime || performance.timing.loadEventStart));
      require(["sha256"]);//Delay the loading of this dependency
    },
    finalize:function(){
      $("#log").html('');
      log=null;
      decj.unloadModule("demoExplain");
    }
};
});


text:
#if GOOGLE_CUDA || TENSORFLOW_USE_ROCM

#define EIGEN_USE_GPU

#include "tensorflow/core/kernels/scatter_functor_gpu.cu.h"

#include "tensorflow/core/framework/register_types.h"

namespace tensorflow {

typedef Eigen::GpuDevice GPUDevice;

#define DEFINE_GPU_SPECS_OP(T, Index, op)                           \
  template struct functor::ScatterFunctor<GPUDevice, T, Index, op>; \
  template struct functor::ScatterScalarFunctor<GPUDevice, T, Index, op>;

#define DEFINE_GPU_SPECS_INDEX(T, Index)                       \
  DEFINE_GPU_SPECS_OP(T, Index, scatter_op::UpdateOp::ASSIGN); \
  DEFINE_GPU_SPECS_OP(T, Index, scatter_op::UpdateOp::ADD);    \
  DEFINE_GPU_SPECS_OP(T, Index, scatter_op::UpdateOp::SUB);    \
  DEFINE_GPU_SPECS_OP(T, Index, scatter_op::UpdateOp::MUL);    \
  DEFINE_GPU_SPECS_OP(T, Index, scatter_op::UpdateOp::DIV);    \
  DEFINE_GPU_SPECS_OP(T, Index, scatter_op::UpdateOp::MIN);    \
  DEFINE_GPU_SPECS_OP(T, Index, scatter_op::UpdateOp::MAX);

#define DEFINE_GPU_SPECS(T)         \
  DEFINE_GPU_SPECS_INDEX(T, int32); \
  DEFINE_GPU_SPECS_INDEX(T, int64);

DEFINE_GPU_SPECS(Eigen::half);
DEFINE_GPU_SPECS(float);
DEFINE_GPU_SPECS(double);

#define DEFINE_GPU_SPECS_ASSIGN_ONLY(T)                        \
  DEFINE_GPU_SPECS_OP(T, int32, scatter_op::UpdateOp::ASSIGN); \
  DEFINE_GPU_SPECS_OP(T, int64, scatter_op::UpdateOp::ASSIGN);

TF_CALL_bool(DEFINE_GPU_SPECS_ASSIGN_ONLY);
TF_CALL_INTEGRAL_TYPES(DEFINE_GPU_SPECS_ASSIGN_ONLY);

#undef DEFINE_GPU_SPECS_ASSIGN_ONLY
#undef DEFINE_GPU_SPECS
#undef DEFINE_GPU_SPECS_INDEX
#undef DEFINE_GPU_SPECS_OP

}  // namespace tensorflow

#endif  // GOOGLE_CUDA || TENSORFLOW_USE_ROCM


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

/**
 * @fileoverview Controllers for the form builder test page.
 *
 * @author sll@google.com (Sean Lip)
 */

oppia.directive('formOverlay', ['recursionHelper', function(recursionHelper) {
  return {
    scope: {
      definition: '=',
      isDisabled: '&',
      savedValue: '=',
      allowExpressions: '&'
    },
    templateUrl: 'formOverlay/entryPoint',
    restrict: 'E',
    compile: recursionHelper.compile,
    controller: ['$scope', function($scope) {
      $scope.$watch('savedValue', function(newValue, oldValue) {
        $scope.localValue = angular.copy($scope.savedValue);
      });

      $scope.submitValue = function(value) {
        $scope.savedValue = angular.copy($scope.localValue);
        alert($scope.savedValue);
      };
      $scope.cancelEdit = function() {
        $scope.localValue = angular.copy($scope.savedValue);
      };
    }]
  };
}]);

oppia.controller('FormBuilderTests', [
    '$scope', 'parameterSpecsService', function($scope, parameterSpecsService) {
  parameterSpecsService.addParamSpec('paramBool1', 'bool');
  parameterSpecsService.addParamSpec('paramBool2', 'bool');
  parameterSpecsService.addParamSpec('paramInt1', 'int');
  parameterSpecsService.addParamSpec('paramFloat1', 'float');
  parameterSpecsService.addParamSpec('paramFloat2', 'float');
  parameterSpecsService.addParamSpec('paramUnicode1', 'unicode');
  parameterSpecsService.addParamSpec('paramUnicode2', 'unicode');
  parameterSpecsService.addParamSpec('paramUnicode3', 'unicode');

  $scope.testText = 'abc{{paramUnicode1}}';

  $scope.unicodeForm = {
    schema: {
      type: 'unicode'
    },
    value: 'aab{{paramUnicode1}}',
    allowExpressions: true
  };

  $scope.booleanForms = [{
    name: 'Boolean form',
    schema: {
      type: 'bool'
    },
    value: true
  }, {
    name: 'Boolean form with expressions',
    schema: {
      type: 'bool'
    },
    value: 'paramBool1',
    allowExpressions: true
  }];

  $scope.intForms = [{
    name: 'Integer form (value must be greater than 2)',
    schema: {
      type: 'int',
      validators: [{
        id: 'is_at_least',
        min_value: 2
      }]
    },
    value: 3
  }, {
    // TODO(sll): Add test for bad initialization.
    name: 'Integer form with expressions',
    schema: {
      type: 'int'
    },
    value: 'paramInt1',
    allowExpressions: true
  }];

  $scope.floatForms = [{
    name: 'Float form (value must be between -3 and 6)',
    schema: {
      type: 'float',
      validators: [{
        id: 'is_at_least',
        min_value: -3.0
      }, {
        id: 'is_at_most',
        max_value: 6.0
      }]
    },
    value: 3.14
  }, {
    name: 'Float form with expressions (value must be between -3 and 6)',
    schema: {
      type: 'float',
      validators: [{
        id: 'is_at_least',
        min_value: -3.0
      }, {
        id: 'is_at_most',
        max_value: 6.0
      }]
    },
    allowExpressions: true,
    value: 3.14
  }];

  $scope.unicodeForms = [{
    name: 'Restricted unicode form; the value must be either a or b.',
    schema: {
      type: 'unicode',
      choices: ['a', 'b']
    },
    value: 'a'
  }];

  $scope.htmlForms = [{
    name: 'HTML form',
    schema: {
      type: 'html'
    },
    value: 'Some HTML'
  }];

  $scope.compositeForms = [{
    name: 'Dict with a bool, a unicode string and a list of ints. The string must be either \'abc\' or \'def\'.',
    schema: {
      type: 'dict',
      properties: [{
        name: 'a_unicode_string_appearing_first',
        description: 'First field.',
        schema: {
          type: 'unicode',
          choices: ['abc', 'def']
        }
      }, {
        name: 'a_list_appearing_second',
        description: 'Second field.',
        schema: {
          type: 'list',
          items: {
            type: 'int'
          }
        }
      }, {
        name: 'a_boolean_appearing_last',
        description: 'Third field.',
        schema: {
          type: 'bool'
        }
      }]
    },
    value: {
      a_boolean_appearing_last: false,
      a_unicode_string_appearing_first: 'abc',
      a_list_appearing_second: [2, 3]
    }
  }, {
    name: 'List of code areas with custom \'add element\' text',
    schema: {
      type: 'list',
      items: {
        type: 'unicode',
        ui_config: {
          coding_mode: 'python'
        }
      },
      ui_config: {
        add_element_text: '[Custom \'add element\' text]'
      }
    },
    value: ['abc', 'def', 'ghi']
  }, {
    name: 'Fixed-length list of 2 multiple-choice floats',
    schema: {
      type: 'list',
      items: {
        type: 'float',
        choices: [1.0, 0.0, -1.0, -2.0, -3.0]
      },
      len: 2
    },
    value: [1.0, -3.0]
  }, {
    name: 'List of complex items (no descriptions in the dicts)',
    schema: {
      type: 'list',
      items: {
        type: 'dict',
        properties: [{
          name: 'intField',
          schema: {
            type: 'int',
          }
        }, {
          name: 'htmlField',
          schema: {
            type: 'html'
          }
        }]
      }
    },
    value: [{
      intField: 5,
      htmlField: 'def'
    }]
  }, {
    name: 'Nested lists',
    schema: {
      type: 'list',
      items: {
        type: 'list',
        items: {
          type: 'unicode'
        }
      }
    },
    value: [['abc'], ['def', 'ghi']]
  }];

  $scope.formsets = [{
    name: 'Boolean editors',
    forms: $scope.booleanForms
  }, {
    name: 'Integer editors',
    forms: $scope.intForms
  }, {
    name: 'Float editors',
    forms: $scope.floatForms
  }, {
    name: 'Unicode editors',
    forms: $scope.unicodeForms
  }, {
    name: 'HTML editors',
    forms: $scope.htmlForms
  }, {
    name: 'Composite editors',
    forms: $scope.compositeForms
  }];
}]);


text:
package spell.english;

import org.apache.felix.ipojo.annotations.Component;
import org.apache.felix.ipojo.annotations.Instantiate;
import org.apache.felix.ipojo.annotations.Provides;
import spell.services.DictionaryService;

/**
 * An implementation of the Dictionary service containing English words
 * see DictionaryService for details of the service.
 **/
@Component // It's an iPOJO Component
@Provides // We provide a service
@Instantiate // We declare an instance of our component
public class EnglishDictionary implements DictionaryService {

    /**
     * Implements DictionaryService.checkWord(). Determines
     * if the passed in word is contained in the dictionary.
     * @param word the word to be checked.
     * @return true if the word is in the dictionary,
     *         false otherwise.
     **/
    public boolean checkWord(String word) {
        //TODO
        return false;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectTasksOptions">
    <TaskOptions isEnabled="true">
      <option name="arguments" value="fmt $FileDir$/$FileName$" />
      <option name="checkSyntaxErrors" value="true" />
      <option name="description" />
      <option name="exitCodeBehavior" value="ERROR" />
      <option name="fileExtension" value="go" />
      <option name="immediateSync" value="false" />
      <option name="name" value="Go fmt" />
      <option name="output" value="" />
      <option name="outputFilters">
        <array />
      </option>
      <option name="outputFromStdout" value="false" />
      <option name="program" value="/usr/local/bin/go" />
      <option name="scopeName" value="Project Files" />
      <option name="trackOnlyRoot" value="false" />
      <option name="workingDir" value="$FileDir$" />
      <envs />
    </TaskOptions>
  </component>
</project>


text:
#ifndef ObjectConstructor_h
#define ObjectConstructor_h

#include "InternalFunction.h"

namespace JSC {

    class ObjectPrototype;

    class ObjectConstructor : public InternalFunction {
    public:
        ObjectConstructor(ExecState*, NonNullPassRefPtr<Structure>, ObjectPrototype*, Structure* prototypeFunctionStructure);

    private:
        virtual ConstructType getConstructData(ConstructData&);
        virtual CallType getCallData(CallData&);
    };

} // namespace JSC

#endif // ObjectConstructor_h


text:
$matchAnything = 'a',1,'!',' '

$matchAnything -match '.'

#Matching word characters with \w
$wordCharacterTest = 'a','b',' ',1,'$'

$wordCharacterTest -match '\w'

#Finding Active Directory Users

Get-ADUser -Filter * | Where-Object Name -Match '\w\w\w\waccount'

#Matching digits with \d

$IPAddress = (Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias Ethernet).IPAddress

$IPAddress -match '\d\d\d.\d\d\d.\d.\d\d'

$IPAddress.replace('.','$') -match '\d\d\d.\d\d\d.\d.\d\d'

#Escaping metacharacters
$IPAddress.replace('.','$') -match '\d\d\d\.\d\d\d.\d\.\d\d'

#endregion


text:
.class public Landroid/support/v4/media/session/MediaSessionCompat;
.super Ljava/lang/Object;


text:
package it.cnr.isti.vir.similarity;

import it.cnr.isti.vir.features.FeatureClassCollector;
import it.cnr.isti.vir.features.AbstractFeaturesCollector;
import it.cnr.isti.vir.features.Permutation;

public class SpearmanFootruleAmato implements ISimilarity<Permutation>{

	private int maxLength = 0;

	public SpearmanFootruleAmato() {};

	public SpearmanFootruleAmato(int maxLength) {
		if ( maxLength >= 0)
			this.maxLength =maxLength;
	}

	@Override
	public double distance(Permutation f1, Permutation f2) {
		if ( maxLength == 0 ) return sfd(f1.getROPositions(), f2.getROPositions());
		return sfd_l(f1.getROPositions(), f2.getROPositions(), maxLength, f1.getNRO()-1);
	}

	@Override
	public double distance(Permutation f1, Permutation f2, double max) {
		if ( maxLength == 0 ) return sfd(f1.getROPositions(), f2.getROPositions(), (int) Math.ceil( max ));
		return sfd_l(f1.getROPositions(), f2.getROPositions(), (int) Math.ceil( max ), maxLength, f1.getNRO()-1);
	}

	@Override
	public final double distance(AbstractFeaturesCollector f1, AbstractFeaturesCollector f2 ) {
		return distance((Permutation) f1.getFeature(Permutation.class), (Permutation) f2.getFeature(Permutation.class));
	}

	@Override
	public final double distance(AbstractFeaturesCollector f1, AbstractFeaturesCollector f2, double max ) {
		return distance((Permutation) f1.getFeature(Permutation.class), (Permutation) f2.getFeature(Permutation.class));
	}

	@Override
	public long getDistCount() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public FeatureClassCollector getRequestedFeaturesClasses() {
		// TODO Auto-generated method stub
		return new FeatureClassCollector( Permutation.class );
	}

	public static int sfd(int[] pos1, int[] pos2) {

		int sum = 0;
		for ( int i=0; i<pos1.length; i++) {
			sum += Math.abs(pos1[i] - pos2[i]);
		}
		return sum;
	}

	public static int sfd(int[] pos1, int[] pos2, int max) {
		int sum = 0;
		for ( int i=0; i<pos1.length; i++) {
			sum += Math.abs(pos1[i] - pos2[i]);
			if ( sum > max ) return -sum;
		}
		return sum;
	}

	/**
	 * @param obj1
	 * @param obj2
	 * @param permLength max permutation length
	 * @return
	 */
	public static double sfd_l(int[] pos1, int[] pos2, int permLength, int maxROID) {

		int sum = 0;
		for ( int i=0; i<pos1.length; i++) {
			int t1 = pos1[i];
			int t2 = pos2[i];
			if ( t1 >= permLength &&  t2 >= permLength) continue;
			if ( t1 >= permLength ) t1 = maxROID;
			if ( t2 >= permLength ) t2 = maxROID;
			sum += Math.abs( t1 - t2 );
		}
		return sum;
	}

	/**
	 * @param obj1
	 * @param obj2
	 * @param max
	 * @param permLength max permutation length
	 * @return
	 */
	public static double  sfd_l(int[] pos1, int[] pos2, int max, int permLength, int maxROID) {

		int sum = 0;
		for ( int i=0; i<pos1.length; i++) {
			int t1 = pos1[i];
			int t2 = pos2[i];
			if ( t1 >= permLength &&  t2 >= permLength) continue;
			if ( t1 >= permLength ) t1 = maxROID;
			if ( t2 >= permLength ) t2 = maxROID;
			sum += Math.abs( t1 - t2 );
			if ( sum > max ) return -sum;
		}
		return sum;
	}

	public String getStatsString() { return ""; };
}


text:
module BeehivesHelper
end


text:
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/sbeio/sbe_psuSendMemConfig.C $                        */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2018,2022                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
/**
* @file sbe_psuSendMemConfig.C
* @brief Send Memory configuration information, for a PROC, to the SBE
*/

#include <errl/errlmanager.H>                  // errlHndl_t
#include <sbeio/sbe_psudd.H>                   // SbePsu::psuCommand
#include <targeting/common/commontargeting.H>  // get_huid
#include <targeting/common/utilFilter.H>       // getAllChips
#include <sbeio/sbeioreasoncodes.H>            // SBEIO_PSU, SBEIO_PSU_SEND
#include <sbeio/sbeioif.H>
#include <sys/mm.h>                            // mm_virt_to_phys
#include <errno.h>
#include <sbeio/sbe_utils.H>                   // SBE_PMIC_HLTH_CHECK_BUFFER_LEN_BYTES
#include <targeting/common/mfgFlagAccessors.H> // areAllSrcsTerminating

extern trace_desc_t* g_trac_sbeio;

#define SBE_TRACFBIN(printf_string,args...) \
    TRACFBIN(g_trac_sbeio, "getMemConfigInfo: " printf_string,##args)

namespace SBEIO
{
using namespace TARGETING;

// See below for function description, this is the forward declaration
uint32_t getMemConfigInfo(const TargetHandle_t i_pProc,
                           CLASS i_class,
                           TYPE i_type,
                           uint32_t i_max_number,
                           SbePsu::MemConfigData_t * io_buffer);

 /** @brief Get PMIC Health Check Data from the SBE
 *
 *  @return nullptr if no error else an error log
 */
errlHndl_t getPmicHlthCheckData()
{
    errlHndl_t l_err(nullptr);
    bool l_pmic_health_log = true;

    TRACFCOMP(g_trac_sbeio, ENTER_MRK"getPmicHlthCheckData");

    //Allocate and align memory due to SBE requirements
    void* l_sbeMemAlloc = nullptr;
    SBEIO::sbeAllocationHandle_t l_alignedMemHandle { };
    uint64_t l_pmicHlthCheckDataSize = SBE_PMIC_HLTH_CHECK_BUFFER_LEN_BYTES;
    l_alignedMemHandle = sbeMalloc(l_pmicHlthCheckDataSize, l_sbeMemAlloc);

    do
    {
        TargetHandleList functionalProcChipList;
        getAllChips(functionalProcChipList, TYPE_PROC, true);
        for (const auto & l_pProc: functionalProcChipList)
        {
            union versionUnion{
                uint32_t sbe_version_combo;
                uint16_t sbe_sub_version[2];
            };
            versionUnion sbe_version_data = { };
            auto l_sbeVersion = l_pProc->getAttr<ATTR_SBE_VERSION_INFO>();
            sbe_version_data.sbe_version_combo = l_sbeVersion;
            TRACDCOMP(g_trac_sbeio, "MAJOR sbe_sub_version[0]=0x%X", sbe_version_data.sbe_sub_version[0]);
            TRACDCOMP(g_trac_sbeio, "MINOR sbe_sub_version[1]=0x%X", sbe_version_data.sbe_sub_version[1]);

            TargetHandleList l_TargetList;
            // Get the targets associated with the PROC target based on i_class and i_type
            // UTIL_FILTER_FUNCTIONAL for the Health Check Data
            getChildAffinityTargetsByState( l_TargetList,
                                            l_pProc,
                                            CLASS_NA,
                                            TYPE_OCMB_CHIP,
                                            UTIL_FILTER_FUNCTIONAL);
            TRACFCOMP( g_trac_sbeio, "getPmicHlthCheckData PROC HUID=0x%X OCMB_CHIP targets found=%d",
                get_huid(l_pProc), l_TargetList.size());
            for (const auto & l_Target: l_TargetList)
            {
                l_pmic_health_log = true; // loop each time to maybe get something
                const ATTR_FAPI_POS_type l_fapiPos = l_Target->getAttr<ATTR_FAPI_POS>();
                uint8_t l_InstanceId = l_fapiPos % SbePsu::SBE_OCMB_CONFIG_MAX_NUMBER;
                TRACFCOMP( g_trac_sbeio, "getPmicHlthCheckData PROC HUID=0x%X OCMB HUID=0x%X l_InstanceId=%d",
                    get_huid(l_pProc), get_huid(l_Target), l_InstanceId);
                // Create a PSU command message and initialize it with Health Check specific flags
                SbePsu::psuCommand l_psuCommand(
                    SbePsu::SBE_REQUIRE_RESPONSE,                 // control flag
                    SbePsu::SBE_PSU_GENERIC_MESSAGE,              // command class
                    SbePsu::SBE_CMD_PMIC_HEALTH_CHECK_DATA);      // command (0x0C)
                memset(l_alignedMemHandle.dataPtr, 0, l_pmicHlthCheckDataSize);

                // SBE consumes a physical address
                // Assume the virtual pages returned by malloc() are backed by contiguous physical pages

                TRACFCOMP(g_trac_sbeio, "getPmicHlthCheckData: SBE indirect data at physical address 0x%lx "
                    "dataPtr=0x%X SBE_PMIC_HLTH_CHECK_BUFFER_LEN_BYTES=%d SBE_TARGET_TYPE_OCMB_CHIP=0x%X l_sbeMemAlloc=0x%X",
                    l_alignedMemHandle.physAddr, l_alignedMemHandle.dataPtr, SBE_PMIC_HLTH_CHECK_BUFFER_LEN_BYTES,
                    SBE_TARGET_TYPE_OCMB_CHIP, l_sbeMemAlloc);

                l_psuCommand.cd7_getPmicHlthCheckData_DataAddr = l_alignedMemHandle.physAddr;
                l_psuCommand.cd7_getPmicHlthCheckData_MbxReg1_OCMB_TYPE = SBE_TARGET_TYPE_OCMB_CHIP;
                l_psuCommand.cd7_getPmicHlthCheckData_MbxReg1_InstanceId = l_InstanceId;

                // Create a PSU response message
                SbePsu::psuResponse l_psuResponse;

                bool command_unsupported = false;

                // Make the call to perform the PSU Chip Operation
                l_err = SbePsu::getTheInstance().performPsuChipOp(
                            l_pProc,
                            &l_psuCommand,
                            &l_psuResponse,
                            SbePsu::MAX_PSU_SHORT_TIMEOUT_NS,
                            SbePsu::SBE_HEALTH_CHECK_DATA_REQ_USED_REGS,
                            SbePsu::SBE_HEALTH_CHECK_DATA_RSP_USED_REGS,
                            SbePsu::COMMAND_SUPPORT_OPTIONAL,
                            &command_unsupported);

                if ( command_unsupported )
                {
                    // Traces have already been logged
                    TRACFCOMP( g_trac_sbeio, ERR_MRK"getPmicHlthCheckData: SBE firmware "
                               "does not support PSU getPmicHlthCheckData information for "
                               "PROC HUID=0x%X OCMB HUID=0x%X", get_huid(l_pProc), get_huid(l_Target));
                    break;
                }

                if (l_err)
                {
                    TRACFCOMP( g_trac_sbeio, ERR_MRK"getPmicHlthCheckData: ERROR: "
                               "Call to performPsuChipOp failed, error returned for PROC HUID=0x%X "
                               "OCMB HUID=0x%X l_InstanceId=%d",
                               get_huid(l_pProc), get_huid(l_Target), l_InstanceId);
                    l_pmic_health_log = false;
                    l_err->collectTrace(SBEIO_COMP_NAME);
                    errlCommit(l_err, SBEIO_COMP_ID);

                    // We will log the data later to show an entry for this Target even though we had
                    // a problem getting its Health Check Data so we will show an entry, otherwise it will
                    // be a missing entry and lead to tracking down the why it is missing versus we know
                    // it is missing due to the l_pmic_health_log flag saying we were unable to get any good data, etc.
                }

                uint8_t l_pmic_revision = 0;
                uint8_t l_pmic_status = 0;

                TRACFCOMP ( g_trac_sbeio, "getPmicHlthCheckData: l_psuResponse.pmic_health_check_data_size=%d",
                    l_psuResponse.pmic_health_check_data_size);

                if (l_psuResponse.pmic_health_check_data_size > 0)
                {
                    l_pmic_revision = reinterpret_cast<SbePsu::pmic_health_data_t *>(l_alignedMemHandle.dataPtr)->pmic_revision;
                    l_pmic_status = reinterpret_cast<SbePsu::pmic_health_data_t *>(l_alignedMemHandle.dataPtr)->pmic_status;
                }
                else
                {
                    // We have no data to log, but no explicit ERRORS
                    l_pmic_health_log = false; // we will log PMIC Health Check Data -NOT- available
                }

                TRACFCOMP( g_trac_sbeio, "getPmicHlthCheckData: l_pmic_revision=0x%X l_pmic_status=0x%X",
                    l_pmic_revision, l_pmic_status);

                // See HWSV hwcoSbeSvc.C
                if ((l_pmic_status == SbePsu::SBE_N_MODE) || (l_pmic_status == SbePsu::SBE_LOST) ||
                   (l_pmic_status == SbePsu::SBE_GI2C_FAIL) || (l_pmic_status == SbePsu::SBE_DIMM_NOT_4U))
                {
                    if (l_pmic_status != SbePsu::SBE_DIMM_NOT_4U)
                    {
                        // Produce a visible log in Mfg Mode for failed health check
                        if (TARGETING::areAllSrcsTerminating())
                        {
                            /*@
                             * @moduleid         SBEIO_PSU_PMIC_HEALTH_CHECK
                             * @reasoncode       SBEIO_PMIC_FAILED_HEALTH_CHECK
                             * @userdata1[00:31] PROC Target HUID
                             * @userdata1[32:63] OCMB Target HUID
                             * @userdata2[00:07] l_pmic_revision
                             * @userdata2[08:15] l_pmic_status
                             * @userdata2[16:23] l_InstanceId
                             * @userdata2[24:31] l_pmic_health_log <-- True if we should have non-zero addFFDC data
                             * @userdata2[32:47] l_psuResponse.primaryStatus
                             * @userdata2[48:63] l_psuResponse.secondaryStatus
                             * @devdesc          PMIC Health Check Data Failed in Mfg Mode
                             * @custdesc         PMIC Health Check Data Failed in Mfg Mode
                             */
                            l_err = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_PREDICTIVE,
                                                             SBEIO_PSU_PMIC_HEALTH_CHECK,
                                                             SBEIO_PMIC_FAILED_HEALTH_CHECK,
                                                             TWO_UINT32_TO_UINT64(
                                                                         get_huid(l_pProc),
                                                                         get_huid(l_Target)),
                                                             TWO_UINT32_TO_UINT64(
                                                                         FOUR_UINT8_TO_UINT32(
                                                                             l_pmic_revision,
                                                                             l_pmic_status,
                                                                             l_InstanceId,
                                                                             l_pmic_health_log),
                                                                         TWO_UINT16_TO_UINT32(
                                                                             l_psuResponse.primaryStatus,
                                                                             l_psuResponse.secondaryStatus)));

                            // If MFG mode add a HW Callout to properly identify the location code,
                            // but continue to create the Health Check Data entry to show a complete
                            // set of expected logs for OCMBs as usual, additional data logged may
                            // aide in root cause problem determination
                            //
                            // Identify this OCMB for the MFG check failure
                            l_err->addHwCallout( l_Target,
                                                 HWAS::SRCI_PRIORITY_HIGH,
                                                 HWAS::NO_DECONFIG,
                                                 HWAS::GARD_NULL);
                            l_err->collectTrace(SBEIO_COMP_NAME);
                            if (l_psuResponse.pmic_health_check_data_size > 0)
                            {
                                l_err->addFFDC( SBEIO_COMP_ID,
                                            l_alignedMemHandle.dataPtr,
                                            l_psuResponse.pmic_health_check_data_size,
                                            1,                           // Version
                                            SBEIO_UDT_NO_FORMAT,         // parser ignores data
                                            false );                     // merge
                            }
                            errlCommit(l_err, SBEIO_COMP_ID);
                        }
                    }
                }

                // Currently primaryStatus and secondaryStatus return zeros
                // even when Non functional targets are selected, seems like it should return
                // SBE_PRI_INVALID_DATA (SBE_SEC_OCMB_TARGET_NOT_FUNCTIONAL)
                //
                // See sbecmdpmictelemetry.C
                //
                // *NOTE* - even if the primaryStatus and secondaryStatus get fixed/changed
                // this logic will handle both current implementation and any future mods
                //
                // Summary - We are logging all the data we can to aide analysis
                TRACFCOMP( g_trac_sbeio, ERR_MRK"getPmicHlthCheckData: PMIC "
                           "Health Check Data for "
                           "PROC HUID=0x%X OCMB HUID=0x%X "
                           "l_psuResponse.pmic_health_check_data_size=%d "
                           "l_pmic_revision=0x%X l_pmic_status=0x%X "
                           "l_InstanceId=%d l_pmic_health_log=%d "
                           "l_psuResponse.primaryStatus=0x%X "
                           "l_psuResponse.secondaryStatus=0x%X",
                            get_huid(l_pProc), get_huid(l_Target),
                            l_psuResponse.pmic_health_check_data_size,
                            l_pmic_revision, l_pmic_status,
                            l_InstanceId, l_pmic_health_log,
                            l_psuResponse.primaryStatus,
                            l_psuResponse.secondaryStatus);
                /*@
                 * @moduleid         SBEIO_PSU_PMIC_HEALTH_CHECK
                 * @reasoncode       SBEIO_PMIC_HEALTH_CHECK_DATA
                 * @userdata1[00:31] PROC Target HUID
                 * @userdata1[32:63] OCMB Target HUID
                 * @userdata2[00:07] l_pmic_revision
                 * @userdata2[08:15] l_pmic_status
                 * @userdata2[16:23] l_InstanceId
                 * @userdata2[24:31] l_pmic_health_log <-- True if we should have non-zero addFFDC data
                 * @userdata2[32:47] l_psuResponse.primaryStatus
                 * @userdata2[48:63] l_psuResponse.secondaryStatus
                 * @devdesc          PMIC Health Check Data
                 * @custdesc         PMIC Health Check Data
                 */
                l_err = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_INFORMATIONAL,
                                                 SBEIO_PSU_PMIC_HEALTH_CHECK,
                                                 SBEIO_PMIC_HEALTH_CHECK_DATA,
                                                 TWO_UINT32_TO_UINT64(
                                                             get_huid(l_pProc),
                                                             get_huid(l_Target)),
                                                 TWO_UINT32_TO_UINT64(
                                                             FOUR_UINT8_TO_UINT32(
                                                                 l_pmic_revision,
                                                                 l_pmic_status,
                                                                 l_InstanceId,
                                                                 l_pmic_health_log),
                                                             TWO_UINT16_TO_UINT32(
                                                                 l_psuResponse.primaryStatus,
                                                                 l_psuResponse.secondaryStatus)));
                // Identify this OCMB for the Health Check Data Log
                l_err->addHwCallout( l_Target,
                                     HWAS::SRCI_PRIORITY_LOW,
                                     HWAS::NO_DECONFIG,
                                     HWAS::GARD_NULL);

                if (l_psuResponse.pmic_health_check_data_size > 0)
                {
                    l_err->addFFDC( SBEIO_COMP_ID,
                                l_alignedMemHandle.dataPtr,
                                l_psuResponse.pmic_health_check_data_size,
                                1,                           // Version
                                SBEIO_UDT_NO_FORMAT,         // parser ignores data
                                false );                     // merge
                }

                l_err->collectTrace(SBEIO_COMP_NAME);
                l_err->updateActionFlags(ERRORLOG::ERRL_ACTIONS_CALL_HOME);
                errlCommit(l_err, SBEIO_COMP_ID);

            } // end for l_Target
        } // end for l_pProc
    } while (0);
    // Free the buffer
    sbeFree(l_alignedMemHandle);

    TRACFCOMP(g_trac_sbeio, EXIT_MRK "getPmicHlthCheckData");

    return l_err;
}; // getPmicHlthCheckData

 /** @brief Populate the PSU Command with Memory target configuration info
 *          and send to the SBE
 *
 *  @param[in] i_pProc - The PROC target to extract the memory config targets from
 *  @return nullptr if no error else an error log
 */
errlHndl_t psuSendSbeMemConfig(const TargetHandle_t i_pProc)
{
    errlHndl_t l_err(nullptr);

    // Validate and verify that the target passed in is indeed a PROC
    assert( TYPE_PROC == i_pProc->getAttr<ATTR_TYPE>(),
            "psuSendSbeMemConfig: Expected a target of type PROC but received a target of type 0x%.4X",
            i_pProc->getAttr<ATTR_TYPE>() );

    TRACFCOMP(g_trac_sbeio, ENTER_MRK"psuSendSbeMemConfig: PROC target HUID 0x%X",
                            get_huid(i_pProc) );

    //Allocate and align memory due to SBE requirements
    void* l_sbeMemAlloc = nullptr;
    SBEIO::sbeAllocationHandle_t l_MemConfigAlloc { };
    do
    {
        // Create a PSU command message and initialize it with Memory Config specific flags
        SbePsu::psuCommand l_psuCommand(
                    SbePsu::SBE_REQUIRE_RESPONSE |
                    SbePsu::SBE_REQUIRE_ACK,          // control flags
                    SbePsu::SBE_PSU_GENERIC_MESSAGE,  // command class (0xD7)
                    SbePsu::SBE_CMD_MEM_CONFIG);      // command (0x0B)

        l_MemConfigAlloc = sbeMalloc(sizeof(SbePsu::MemConfigData_t), l_sbeMemAlloc);

        // memset the virtual address to zeros to assure data buffer properly initialized
        memset( l_sbeMemAlloc, 0, sizeof(SbePsu::MemConfigData_t));

        // SBE consumes a physical address
        // Assume the virtual pages returned by malloc() are backed by contiguous physical pages

        TRACFCOMP(g_trac_sbeio, "psuSendSbeMemConfig: SBE indirect data at address 0x%lx "
            "l_sbeMemAlloc=0x%X sizeof(MemConfigData_t)=0x%X",
            l_MemConfigAlloc.physAddr, l_sbeMemAlloc, sizeof(SbePsu::MemConfigData_t));

        l_psuCommand.cd7_sendMemConfig_DataAddr = l_MemConfigAlloc.physAddr;

        // Populate the indirect memory buffer to pass in the PSU command message
        // sbeMalloc'd aligned buffer structure packed (MemConfigData_t)
        // so ok to proceed with populating structure alignment friendly
        uint32_t l_total_targets_processed = 0;
        uint32_t l_targets_processed = 0;

        l_targets_processed = getMemConfigInfo(i_pProc, CLASS_NA, TYPE_PMIC,
                                        SbePsu::SBE_PMIC_CONFIG_MAX_NUMBER,
                                        reinterpret_cast<SbePsu::MemConfigData_t *>(l_sbeMemAlloc));

        l_total_targets_processed = l_targets_processed;

        TRACFCOMP(g_trac_sbeio, "psuSendSbeMemConfig: POST PMICs: current l_targets_processed=%d",
                      l_targets_processed);

        l_targets_processed = getMemConfigInfo(i_pProc, CLASS_NA, TYPE_GENERIC_I2C_DEVICE,
                                  SbePsu::SBE_GENERIC_I2C_CONFIG_MAX_NUMBER,
                                  reinterpret_cast<SbePsu::MemConfigData_t *>(l_sbeMemAlloc));
        l_total_targets_processed += l_targets_processed;
        TRACFCOMP(g_trac_sbeio, "psuSendSbeMemConfig: POST GENERIC I2Cs: current l_targets_processed=%d",
                      l_targets_processed);

        l_targets_processed = getMemConfigInfo(i_pProc, CLASS_CHIP, TYPE_OCMB_CHIP,
                                  SbePsu::SBE_OCMB_CONFIG_MAX_NUMBER,
                                  reinterpret_cast<SbePsu::MemConfigData_t *>(l_sbeMemAlloc));
        l_total_targets_processed += l_targets_processed;
        TRACFCOMP(g_trac_sbeio, "psuSendSbeMemConfig: POST OCMBs: current l_targets_processed=%d",
                      l_targets_processed);

        TRACFCOMP(g_trac_sbeio, "psuSendSbeMemConfig: TOTALS: current l_total_targets_processed=%d",
                      l_total_targets_processed);

        if ( l_total_targets_processed == 0 )
        {
            // If no targets have been processed then skip sending any config info
            TRACFCOMP(g_trac_sbeio, "psuSendSbeMemConfig: Skipped sending any config info, "
                "NO TARGETS processed for PROC HUID=0x%X", get_huid(i_pProc));
            break;
        }

        // Create a PSU response message
        SbePsu::psuResponse l_psuResponse;

        // Make the call to perform the PSU Chip Operation
        l_err = SbePsu::getTheInstance().performPsuChipOp(
                        i_pProc,
                        &l_psuCommand,
                        &l_psuResponse,
                        SbePsu::MAX_PSU_SHORT_TIMEOUT_NS,
                        SbePsu::SBE_MEM_CONFIG_REQ_USED_REGS,
                        SbePsu::SBE_MEM_CONFIG_RSP_USED_REGS,
                        SbePsu::COMMAND_SUPPORT_OPTIONAL);

        if (l_err)
        {
            // Traces have already been logged
            TRACFCOMP( g_trac_sbeio, ERR_MRK"psuSendSbeMemConfig: ERROR: "
                       "Call to performPsuChipOp failed, error returned" );

            break;
        }
    } while (0);
    // Free the buffer
    sbeFree(l_MemConfigAlloc);

    TRACFCOMP(g_trac_sbeio, EXIT_MRK "psuSendSbeMemConfig");

    return l_err;
}; // psuSendSbeMemConfig

 /** @brief Populate the PS Command with Memory target configuration info
 *
 *  @param[in] i_pProc       - The PROC target to extract the memory targets from
 *  @param[in] i_class       - The CLASS of the targets to query
 *  @param[in] i_type        - The TYPE of the targets to query
 *  @param[in] i_max_number  - The MAX number of possible targets in the model
 *  @param[in/out] io_buffer - The SBE aligned malloc buffer for indirect data send
 *                             Caller must initialize the buffer
 *  @return The number of memory target instances processed
 */
uint32_t getMemConfigInfo(const TargetHandle_t i_pProc,
                           CLASS i_class,
                           TYPE i_type,
                           uint32_t i_max_number,
                           SbePsu::MemConfigData_t * io_buffer)
{

    // Return the number of Targets found and processed
    TRACFCOMP(g_trac_sbeio, "sbe_psuSendMemConfig.C:getMemConfigInfo: ENTRY WORKING on "
        "i_type=0x%X PROC HUID=0x%X io_buffer=0x%X",
        i_type, get_huid(i_pProc), io_buffer);
    uint32_t l_numberOfTargetsProcessed(0);
    uint32_t l_max(0);
    bool l_max_exceeded =false;

    TargetHandleList l_TargetList;

    // Get the targets associated with the PROC target based on i_class and i_type
    // UTIL_FILTER_ALL will retrieve ALL BLUEPRINT
    getChildAffinityTargetsByState( l_TargetList,
                                    i_pProc,
                                    i_class,
                                    i_type,
                                    UTIL_FILTER_ALL);

    // Be sure to populate the callers buffer
    // Data population of the callers buffer is done here to contain
    // the buffer management logic in a single location
    // to provide full visibility and maintainability for future

    //  i2c_config_version is consumed by SBE, we only set it here for
    //  later SBE consumption
    io_buffer->i2c_config_version = SbePsu::SBE_PSU_I2C_CONFIG_VERSION_LATEST;

    // see sbe_psudd.H struct MemConfigData_t

    //  i2c_config_types_supported is consumed by SBE, we only set it here for
    //  later SBE consumption for any version/size validations
    io_buffer->i2c_config_types_supported = SbePsu::SBE_PSU_I2C_CONFIG_TYPES_SUPPORTED;

    io_buffer->pmic_chips_max_number = SbePsu::SBE_PMIC_CONFIG_MAX_NUMBER;
    io_buffer->gi2c_chips_max_number = SbePsu::SBE_GENERIC_I2C_CONFIG_MAX_NUMBER;
    io_buffer->ocmb_chips_max_number = SbePsu::SBE_OCMB_CONFIG_MAX_NUMBER;

    TRACFCOMP(g_trac_sbeio, "sbe_psuSendMemConfig.C:getMemConfigInfo: version=0x%X config_types_supported=%d",
        io_buffer->i2c_config_version, io_buffer->i2c_config_types_supported);
    TRACFCOMP(g_trac_sbeio, "sbe_psuSendMemConfig.C:getMemConfigInfo: Max entries supported for "
        "PMIC=%d GENERIC=%d OCMB=%d",
        io_buffer->pmic_chips_max_number, io_buffer->gi2c_chips_max_number,
        io_buffer->ocmb_chips_max_number);
    TRACFCOMP(g_trac_sbeio, INFO_MRK"sbe_psuSendMemConfig.C:getMemConfigInfo: "
        "PROC HUID=0x%X targets found=%d io_buffer=0x%X i_type=0x%X",
        get_huid(i_pProc), l_TargetList.size(), io_buffer, i_type);

    switch (i_type)
    {
        case (TYPE_PMIC):
        {
            TRACFCOMP(g_trac_sbeio, "sbe_psuSendMemConfig:getMemConfigInfo: Validating MAX entries "
                "for TYPE_PMIC PMICs found=%d MAX PMICs=%d",
                l_TargetList.size(), (io_buffer->pmic_chips_max_number));
            if (l_TargetList.size() > (io_buffer->pmic_chips_max_number))
            {
                l_max_exceeded = true;
                l_max = (io_buffer->pmic_chips_max_number);
                TRACFCOMP(g_trac_sbeio, "sbe_psuSendMemConfig.C:getMemConfigInfo: Exceeded MAX entries "
                    "for TYPE_PMIC");
            }
            break;
        }
        case (TYPE_GENERIC_I2C_DEVICE):
        {
            TRACFCOMP(g_trac_sbeio, "sbe_psuSendMemConfig:getMemConfigInfo: Validating MAX entries "
                "for TYPE_GENERIC_I2C_DEVICE GI2Cs found=%d MAX GI2Cs=%d",
                l_TargetList.size(), (io_buffer->gi2c_chips_max_number));
            if (l_TargetList.size() > (io_buffer->gi2c_chips_max_number))
            {
                l_max_exceeded = true;
                l_max = (io_buffer->gi2c_chips_max_number);
                TRACFCOMP(g_trac_sbeio, "sbe_psuSendMemConfig.C:getMemConfigInfo: Exceeded MAX entries "
                    "for TYPE_GENERIC_I2C_DEVICE");
            }
            break;
        }
        case (TYPE_OCMB_CHIP):
        {
            TRACFCOMP(g_trac_sbeio, "sbe_psuSendMemConfig:getMemConfigInfo: Validating MAX entries "
                "for TYPE_OCMB_CHIP OCMBs found=%d MAX OCMBs=%d",
                l_TargetList.size(), (io_buffer->ocmb_chips_max_number));
            if (l_TargetList.size() > (io_buffer->ocmb_chips_max_number))
            {
                l_max_exceeded = true;
                l_max = (io_buffer->ocmb_chips_max_number);
                TRACFCOMP(g_trac_sbeio, "sbe_psuSendMemConfig.C:getMemConfigInfo: Exceeded MAX entries "
                    "for TYPE_OCMB_CHIP");
            }
            break;
        }
        default:
        {
            TRACFCOMP(g_trac_sbeio, "sbe_psuSendMemConfig.C:getMemConfigInfo: DEFAULT for unrecognized MAX Checks");
            // We will SKIP handling the unrecognized case in the next steps below
            break;
        }
    }

    if ( (l_TargetList.size() == 0) || l_max_exceeded )
    {
        TRACFCOMP(g_trac_sbeio, INFO_MRK"sbe_psuSendMemConfig.C:getMemConfigInfo: No targets "
            "found in BLUEPRINT OR TOO many found for i_type=0x%X", i_type);

        if (l_max_exceeded)
        {

            /*@
             * @moduleid         SBEIO_PSU
             * @reasoncode       SBEIO_PSU_COUNT_UNEXPECTED
             * @userdata1[00:31] The PROC Target HUID
             * @userdata1[32:63] l_TargetList.size MAX
             * @userdata2[00:31] i_type TYPE_PMIC TYPE_GENERIC_I2C_DEVICE TYPE_OCMB_CHIP
             * @userdata2[32:63] l_max  How many of the TYPE we expected as MAX
             * @devdesc          Unexpected counts during getMemConfigInfo
             * @custdesc         A software error occurred during system boot
             */
            errlHndl_t l_err = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_INFORMATIONAL,
                                             SBEIO_PSU,
                                             SBEIO_PSU_COUNT_UNEXPECTED,
                                             TWO_UINT32_TO_UINT64(
                                                         get_huid(i_pProc),
                                                         l_TargetList.size() ),
                                             TWO_UINT32_TO_UINT64(
                                                         i_type,
                                                         l_max ),
                                             ERRORLOG::ErrlEntry::ADD_SW_CALLOUT );
            errlCommit(l_err, SBEIO_COMP_ID);
        }
    }
    else
    {
        TRACFCOMP(g_trac_sbeio, INFO_MRK"sbe_psuSendMemConfig.C:getMemConfigInfo: START WORKING on "
            "PROC HUID=0x%X targets found=%d io_buffer=0x%X i_type=0x%X",
            get_huid(i_pProc), l_TargetList.size(), io_buffer, i_type);

        // Iterate thru the targets and gather the config info
        for (const auto & l_Target: l_TargetList)
        {
            // Get the FAPI position of the target.  The FAPI position will
            // be used as an index into PSU command message.
            const ATTR_FAPI_POS_type l_fapiPos = l_Target->getAttr<ATTR_FAPI_POS>();
            uint32_t l_arrayIndex = l_fapiPos % i_max_number;

            // Get the FAPI I2C control info from the target. The port, engine and devAddr
            // resides within the FAPI I2C control info.
            ATTR_FAPI_I2C_CONTROL_INFO_type l_fapiI2cControlInfo
                = l_Target->getAttr<ATTR_FAPI_I2C_CONTROL_INFO>();

            ATTR_FAPI_I2C_CONTROL_INFO_type l_dynamic_i2cInfo = { };

            // If the target has dynamic device address attribute, then use that instead of the
            // read-only address found in ATTR_FAPI_I2C_CONTROL_INFO. We use the dynamic address
            // attribute because ATTR_FAPI_I2C_CONTROL_INFO is not writable and its difficult
            // to override complex attributes.
            if (l_Target->tryGetAttr<TARGETING::ATTR_DYNAMIC_I2C_DEVICE_ADDRESS>(l_dynamic_i2cInfo.devAddr))
            {
                l_fapiI2cControlInfo.devAddr = l_dynamic_i2cInfo.devAddr;
            }

            // Gather the functional and present state of the target
            const HwasState l_currentState = l_Target->getAttr<TARGETING::ATTR_HWAS_STATE>();

            switch (i_type)
            {
                case (TYPE_PMIC):
                {
                    io_buffer->pmic_chips[l_arrayIndex].i2c_port  = l_fapiI2cControlInfo.port;
                    io_buffer->pmic_chips[l_arrayIndex].i2c_engine  = l_fapiI2cControlInfo.engine;
                    io_buffer->pmic_chips[l_arrayIndex].i2c_devAddr  = l_fapiI2cControlInfo.devAddr;
                    io_buffer->pmic_chips[l_arrayIndex].i2c_functional = l_currentState.functional;
                    io_buffer->pmic_chips[l_arrayIndex].i2c_present = l_currentState.present;
                    break;
                }
                case (TYPE_GENERIC_I2C_DEVICE):
                {
                    io_buffer->gi2c_chips[l_arrayIndex].i2c_port  = l_fapiI2cControlInfo.port;
                    io_buffer->gi2c_chips[l_arrayIndex].i2c_engine  = l_fapiI2cControlInfo.engine;
                    io_buffer->gi2c_chips[l_arrayIndex].i2c_devAddr  = l_fapiI2cControlInfo.devAddr;
                    io_buffer->gi2c_chips[l_arrayIndex].i2c_functional = l_currentState.functional;
                    io_buffer->gi2c_chips[l_arrayIndex].i2c_present = l_currentState.present;
                    break;
                }
                case (TYPE_OCMB_CHIP):
                {
                    io_buffer->ocmb_chips[l_arrayIndex].i2c_port  = l_fapiI2cControlInfo.port;
                    io_buffer->ocmb_chips[l_arrayIndex].i2c_engine  = l_fapiI2cControlInfo.engine;
                    io_buffer->ocmb_chips[l_arrayIndex].i2c_devAddr  = l_fapiI2cControlInfo.devAddr;
                    io_buffer->ocmb_chips[l_arrayIndex].i2c_functional = l_currentState.functional;
                    io_buffer->ocmb_chips[l_arrayIndex].i2c_present = l_currentState.present;
                    break;
                }
                default:
                {
                    TRACFCOMP(g_trac_sbeio, "sbe_psuSendMemConfig.C:getMemConfigInfo: Unrecognized "
                        "i_type=0x%X, no data populated", i_type);
                    break;
                }
            }

            ++l_numberOfTargetsProcessed;
        } // for (const auto & l_Target: l_TargetList)
    } // if ( l_TargetList.size() == 0 ) ... else

    TRACFCOMP(g_trac_sbeio, "sbe_psuSendMemConfig.C:getMemConfigInfo: EXIT "
        "io_buffer=0x%X l_numberOfTargetsProcessed=%d",
        io_buffer, l_numberOfTargetsProcessed);
    return l_numberOfTargetsProcessed;
} // getMemConfigInfo

} // namespace SBEIO