|
AAX SDK
2.3.1
Avid Audio Extensions Development Kit
|
#include <AAX_CParameter.h>
Generic implementation of an AAX_IParameter.
This is a concrete, templatized implementation of AAX_IParameter for parameters with standard types such as float
, uint32
, bool
, etc.
Many different behaviors can be composited into this class as delegates. AAX_ITaperDelegate and AAX_IDisplayDelegate are two examples of delegates that this class uses in order to apply custom behaviors to the AAX_IParameter interface.
Plug-in developers can subclass these delegates to create adaptable, reusable parameter behaviors, which can then be "mixed in" to individual AAX_CParameter objects without the need to modify the objects themselves.
Public Types | |
| enum | Type { eParameterTypeUndefined = 0, eParameterTypeBool = 1, eParameterTypeInt32 = 2, eParameterTypeFloat = 3, eParameterTypeCustom = 4 } |
| enum | Defaults { eParameterDefaultNumStepsDiscrete = 2, eParameterDefaultNumStepsContinuous = 128 } |
Public Member Functions | |
| AAX_CParameter (AAX_CParamID identifier, const AAX_IString &name, T defaultValue, const AAX_ITaperDelegate< T > &taperDelegate, const AAX_IDisplayDelegate< T > &displayDelegate, bool automatable=false) | |
| Constructs an AAX_CParameter object using the specified taper and display delegates. More... | |
| AAX_CParameter (const AAX_IString &identifier, const AAX_IString &name, T defaultValue, const AAX_ITaperDelegate< T > &taperDelegate, const AAX_IDisplayDelegate< T > &displayDelegate, bool automatable=false) | |
| Constructs an AAX_CParameter object using the specified taper and display delegates. More... | |
| AAX_CParameter (const AAX_IString &identifier, const AAX_IString &name, T defaultValue, bool automatable=false) | |
| Constructs an AAX_CParameter object with no delegates. More... | |
| AAX_CParameter (const AAX_IString &identifier, const AAX_IString &name, bool automatable=false) | |
| Constructs an AAX_CParameter object with no delegates or default value. More... | |
| AAX_DEFAULT_MOVE_CTOR (AAX_CParameter) | |
| AAX_DEFAULT_MOVE_OPER (AAX_CParameter) | |
| AAX_DELETE (AAX_CParameter()) | |
| AAX_DELETE (AAX_CParameter(const AAX_CParameter &other)) | |
| AAX_DELETE (AAX_CParameter &operator=(const AAX_CParameter &other)) | |
| virtual | ~AAX_CParameter () |
| Virtual destructor used to delete all locally allocated pointers. More... | |
| virtual AAX_IParameterValue * | CloneValue () const AAX_OVERRIDE |
| Clone the parameter's value to a new AAX_IParameterValue object. More... | |
| template<> | |
| bool | GetValueAsString (AAX_IString *) const |
| Retrieves the parameter's value as a string. More... | |
| template<> | |
| bool | SetValueWithBool (bool value) |
| Sets the parameter's value as a bool. More... | |
| template<> | |
| bool | SetValueWithInt32 (int32_t value) |
| Sets the parameter's value as an int32_t. More... | |
| template<> | |
| bool | SetValueWithFloat (float value) |
| Sets the parameter's value as a float. More... | |
| template<> | |
| bool | SetValueWithDouble (double value) |
| Sets the parameter's value as a double. More... | |
| template<> | |
| bool | SetValueWithString (const AAX_IString &value) |
| Sets the parameter's value as a string. More... | |
| template<> | |
| bool | GetNormalizedValueFromBool (bool value, double *normalizedValue) const |
| Converts a bool to a normalized parameter value. More... | |
| template<> | |
| bool | GetNormalizedValueFromInt32 (int32_t value, double *normalizedValue) const |
| Converts an integer to a normalized parameter value. More... | |
| template<> | |
| bool | GetNormalizedValueFromFloat (float value, double *normalizedValue) const |
| Converts a float to a normalized parameter value. More... | |
| template<> | |
| bool | GetNormalizedValueFromDouble (double value, double *normalizedValue) const |
| Converts a double to a normalized parameter value. More... | |
| template<> | |
| bool | GetBoolFromNormalizedValue (double inNormalizedValue, bool *value) const |
| Converts a normalized parameter value to a bool representing the corresponding real value. More... | |
| template<> | |
| bool | GetInt32FromNormalizedValue (double inNormalizedValue, int32_t *value) const |
| Converts a normalized parameter value to an integer representing the corresponding real value. More... | |
| template<> | |
| bool | GetFloatFromNormalizedValue (double inNormalizedValue, float *value) const |
| Converts a normalized parameter value to a float representing the corresponding real value. More... | |
| template<> | |
| bool | GetDoubleFromNormalizedValue (double inNormalizedValue, double *value) const |
| Converts a normalized parameter value to a double representing the corresponding real value. More... | |
Identification methods | |
| virtual AAX_CParamID | Identifier () const AAX_OVERRIDE |
| Returns the parameter's unique identifier. More... | |
| virtual void | SetName (const AAX_CString &name) AAX_OVERRIDE |
| Sets the parameter's display name. More... | |
| virtual const AAX_CString & | Name () const AAX_OVERRIDE |
| Returns the parameter's display name. More... | |
| virtual void | AddShortenedName (const AAX_CString &name) AAX_OVERRIDE |
| Sets the parameter's shortened display name. More... | |
| virtual const AAX_CString & | ShortenedName (int32_t iNumCharacters) const AAX_OVERRIDE |
| Returns the parameter's shortened display name. More... | |
| virtual void | ClearShortenedNames () AAX_OVERRIDE |
| Clears the internal list of shortened display names. More... | |
Taper methods | |
| virtual void | SetNormalizedDefaultValue (double normalizedDefault) AAX_OVERRIDE |
| Sets the parameter's default value using its normalized representation. More... | |
| virtual double | GetNormalizedDefaultValue () const AAX_OVERRIDE |
| Returns the normalized representation of the parameter's real default value. More... | |
| virtual void | SetToDefaultValue () AAX_OVERRIDE |
| Restores the state of this parameter to its default value. More... | |
| virtual void | SetNormalizedValue (double newNormalizedValue) AAX_OVERRIDE |
| Sets a parameter value using it's normalized representation. More... | |
| virtual double | GetNormalizedValue () const AAX_OVERRIDE |
| Returns the normalized representation of the parameter's current real value. More... | |
| virtual void | SetNumberOfSteps (uint32_t numSteps) AAX_OVERRIDE |
| Sets the number of discrete steps for this parameter. More... | |
| virtual uint32_t | GetNumberOfSteps () const AAX_OVERRIDE |
| Returns the number of discrete steps used by the parameter. More... | |
| virtual uint32_t | GetStepValue () const AAX_OVERRIDE |
| Returns the current step for the current value of the parameter. More... | |
| virtual double | GetNormalizedValueFromStep (uint32_t iStep) const AAX_OVERRIDE |
| Returns the normalized value for a given step. More... | |
| virtual uint32_t | GetStepValueFromNormalizedValue (double normalizedValue) const AAX_OVERRIDE |
| Returns the step value for a normalized value of the parameter. More... | |
| virtual void | SetStepValue (uint32_t iStep) AAX_OVERRIDE |
| Returns the current step for the current value of the parameter. More... | |
| virtual void | SetType (AAX_EParameterType iControlType) AAX_OVERRIDE |
| Sets the type of this parameter. More... | |
| virtual AAX_EParameterType | GetType () const AAX_OVERRIDE |
| Returns the type of this parameter as an AAX_EParameterType. More... | |
| virtual void | SetOrientation (AAX_EParameterOrientation iOrientation) AAX_OVERRIDE |
| Sets the orientation of this parameter. More... | |
| virtual AAX_EParameterOrientation | GetOrientation () const AAX_OVERRIDE |
| Returns the orientation of this parameter. More... | |
| virtual void | SetTaperDelegate (AAX_ITaperDelegateBase &inTaperDelegate, bool inPreserveValue=true) AAX_OVERRIDE |
| Sets the parameter's taper delegate. More... | |
Display methods | |
| virtual void | SetDisplayDelegate (AAX_IDisplayDelegateBase &inDisplayDelegate) AAX_OVERRIDE |
| Sets the parameter's display delegate. More... | |
| virtual bool | GetValueString (AAX_CString *valueString) const AAX_OVERRIDE |
| Serializes the parameter value into a string. More... | |
| virtual bool | GetValueString (int32_t iMaxNumChars, AAX_CString *valueString) const AAX_OVERRIDE |
| Serializes the parameter value into a string, size hint included. More... | |
| virtual bool | GetNormalizedValueFromBool (bool value, double *normalizedValue) const AAX_OVERRIDE |
| Converts a bool to a normalized parameter value. More... | |
| virtual bool | GetNormalizedValueFromInt32 (int32_t value, double *normalizedValue) const AAX_OVERRIDE |
| Converts an integer to a normalized parameter value. More... | |
| virtual bool | GetNormalizedValueFromFloat (float value, double *normalizedValue) const AAX_OVERRIDE |
| Converts a float to a normalized parameter value. More... | |
| virtual bool | GetNormalizedValueFromDouble (double value, double *normalizedValue) const AAX_OVERRIDE |
| Converts a double to a normalized parameter value. More... | |
| virtual bool | GetNormalizedValueFromString (const AAX_CString &valueString, double *normalizedValue) const AAX_OVERRIDE |
| Converts a given string to a normalized parameter value. More... | |
| virtual bool | GetBoolFromNormalizedValue (double normalizedValue, bool *value) const AAX_OVERRIDE |
| Converts a normalized parameter value to a bool representing the corresponding real value. More... | |
| virtual bool | GetInt32FromNormalizedValue (double normalizedValue, int32_t *value) const AAX_OVERRIDE |
| Converts a normalized parameter value to an integer representing the corresponding real value.  More... | |
| virtual bool | GetDoubleFromNormalizedValue (double normalizedValue, double *value) const AAX_OVERRIDE |
| Converts a normalized parameter value to a double representing the corresponding real value. More... | |
| virtual bool | GetStringFromNormalizedValue (double normalizedValue, AAX_CString &valueString) const AAX_OVERRIDE |
| Converts a normalized parameter value to a string representing the corresponding real value. More... | |
| virtual bool | GetStringFromNormalizedValue (double normalizedValue, int32_t iMaxNumChars, AAX_CString &valueString) const AAX_OVERRIDE |
| Converts a normalized parameter value to a string representing the corresponding real, size hint included. value. More... | |
| virtual bool | SetValueFromString (const AAX_CString &newValueString) AAX_OVERRIDE |
| Converts a string to a real parameter value and sets the parameter to this value. More... | |
Automation methods | |
| virtual void | SetAutomationDelegate (AAX_IAutomationDelegate *iAutomationDelegate) AAX_OVERRIDE |
| Sets the automation delegate (if one is required) More... | |
| virtual bool | Automatable () const AAX_OVERRIDE |
| Returns true if the parameter is automatable, false if it is not. More... | |
| virtual void | Touch () AAX_OVERRIDE |
| Signals the automation system that a control has been touched. More... | |
| virtual void | Release () AAX_OVERRIDE |
| Signals the automation system that a control has been released. More... | |
Typed accessors | |
| virtual bool | GetValueAsBool (bool *value) const AAX_OVERRIDE |
| Retrieves the parameter's value as a bool. More... | |
| virtual bool | GetValueAsInt32 (int32_t *value) const AAX_OVERRIDE |
| Retrieves the parameter's value as an int32_t. More... | |
| virtual bool | GetValueAsFloat (float *value) const AAX_OVERRIDE |
| Retrieves the parameter's value as a float. More... | |
| virtual bool | GetValueAsDouble (double *value) const AAX_OVERRIDE |
| Retrieves the parameter's value as a double. More... | |
| virtual bool | GetValueAsString (AAX_IString *value) const AAX_OVERRIDE |
| Retrieves the parameter's value as a string. More... | |
| virtual bool | SetValueWithBool (bool value) AAX_OVERRIDE |
| Sets the parameter's value as a bool. More... | |
| virtual bool | SetValueWithInt32 (int32_t value) AAX_OVERRIDE |
| Sets the parameter's value as an int32_t. More... | |
| virtual bool | SetValueWithFloat (float value) AAX_OVERRIDE |
| Sets the parameter's value as a float. More... | |
| virtual bool | SetValueWithDouble (double value) AAX_OVERRIDE |
| Sets the parameter's value as a double. More... | |
| virtual bool | SetValueWithString (const AAX_IString &value) AAX_OVERRIDE |
| Sets the parameter's value as a string. More... | |
Host interface methods | |
| virtual void | UpdateNormalizedValue (double newNormalizedValue) AAX_OVERRIDE |
| Sets the parameter's state given a normalized value. More... | |
Direct methods on AAX_CParameter | |
These methods can be used to access the parameter's state and properties. These methods are specific to the concrete AAX_CParameter class and are not part of the AAX_IParameter interface. | |
| void | SetValue (T newValue) |
| Initiates a host request to set the parameter's value. More... | |
| T | GetValue () const |
| Returns the parameter's value. More... | |
| void | SetDefaultValue (T newDefaultValue) |
| Set the parameter's default value. More... | |
| T | GetDefaultValue () const |
| Returns the parameter's default value. More... | |
| const AAX_ITaperDelegate< T > * | TaperDelegate () const |
| Returns a reference to the parameter's taper delegate. More... | |
| const AAX_IDisplayDelegate< T > * | DisplayDelegate () const |
| Returns a reference to the parameter's display delegate. More... | |
| Public Member Functions inherited from AAX_IParameter | |
| virtual | ~AAX_IParameter () |
| Virtual destructor. More... | |
Protected Attributes | |
| AAX_CStringAbbreviations | mNames |
| bool | mAutomatable |
| uint32_t | mNumSteps |
| AAX_EParameterType | mControlType |
| AAX_EParameterOrientation | mOrientation |
| AAX_ITaperDelegate< T > * | mTaperDelegate |
| AAX_IDisplayDelegate< T > * | mDisplayDelegate |
| AAX_IAutomationDelegate * | mAutomationDelegate |
| bool | mNeedNotify |
| AAX_CParameterValue< T > | mValue |
| T | mDefaultValue |
| AAX_CParameter< T >::AAX_CParameter | ( | AAX_CParamID | identifier, |
| const AAX_IString & | name, | ||
| T | defaultValue, | ||
| const AAX_ITaperDelegate< T > & | taperDelegate, | ||
| const AAX_IDisplayDelegate< T > & | displayDelegate, | ||
| bool | automatable = false |
||
| ) |
Constructs an AAX_CParameter object using the specified taper and display delegates.
The delegates are passed in by reference to prevent ambiguities of object ownership. For more information about identifer
and name
, please consult the base AAX_IParameter interface.
| [in] | identifier | Unique ID for the parameter, these can only be 31 characters long at most. (the fixed length is a requirement for some optimizations in the host) |
| [in] | name | The parameter's unabbreviated display name |
| [in] | defaultValue | The parameter's default value |
| [in] | taperDelegate | A delegate representing the parameter's taper behavior |
| [in] | displayDelegate | A delegate representing the parameter's display conversion behavior |
| [in] | automatable | A flag to set whether the parameter will be visible to the host's automation system |
taperDelegate
.As of Pro Tools 10.2, DAE will check for a matching parameter NAME and not an ID when reading in automation data from a session saved with an AAX plug-ins RTAS/TDM counter part.
As of Pro Tools 11.1, AAE will first try to match ID. If that fails, AAE will fall back to matching by Name.
References AAX_CParameter< T >::SetToDefaultValue().
| AAX_CParameter< T >::AAX_CParameter | ( | const AAX_IString & | identifier, |
| const AAX_IString & | name, | ||
| T | defaultValue, | ||
| const AAX_ITaperDelegate< T > & | taperDelegate, | ||
| const AAX_IDisplayDelegate< T > & | displayDelegate, | ||
| bool | automatable = false |
||
| ) |
Constructs an AAX_CParameter object using the specified taper and display delegates.
This constructor uses an AAX_IString for the parameter identifier, which can be a more flexible solution for some plug-ins.
References AAX_CParameter< T >::SetToDefaultValue().
| AAX_CParameter< T >::AAX_CParameter | ( | const AAX_IString & | identifier, |
| const AAX_IString & | name, | ||
| T | defaultValue, | ||
| bool | automatable = false |
||
| ) |
Constructs an AAX_CParameter object with no delegates.
Delegates may be set on this object after construction. Most parameter operations will not work until after delegages have been set.
References AAX_CParameter< T >::SetToDefaultValue().
| AAX_CParameter< T >::AAX_CParameter | ( | const AAX_IString & | identifier, |
| const AAX_IString & | name, | ||
| bool | automatable = false |
||
| ) |
Constructs an AAX_CParameter object with no delegates or default value.
Delegates and default value may be set on this object after construction. Most parameter operations will not work until after delegages have been set.
References AAX_CParameter< T >::SetToDefaultValue().
|
virtual |
Virtual destructor used to delete all locally allocated pointers.
| AAX_CParameter< T >::AAX_DEFAULT_MOVE_CTOR | ( | AAX_CParameter< T > | ) |
Move constructor and move assignment operator are allowed
| AAX_CParameter< T >::AAX_DEFAULT_MOVE_OPER | ( | AAX_CParameter< T > | ) |
| AAX_CParameter< T >::AAX_DELETE | ( | AAX_CParameter< T >() | ) |
Default constructor not allowed, except by possible wrappering classes.
| AAX_CParameter< T >::AAX_DELETE | ( | AAX_CParameter< T >(const AAX_CParameter< T > &other) | ) |
| AAX_CParameter< T >::AAX_DELETE | ( | AAX_CParameter< T > & | operator = (const AAX_CParameter< T > &other) | ) |
|
virtual |
Clone the parameter's value to a new AAX_IParameterValue object.
The returned object is independent from the AAX_IParameter. For example, changing the state of the returned object will not result in a change to the original AAX_IParameter.
Implements AAX_IParameter.
|
virtual |
Returns the parameter's unique identifier.
This unique ID is used by the Parameter Manager and by outside applications to uniquely identify and target control messages. This value may not be changed after the parameter has been constructed.
Implements AAX_IParameter.
|
virtual |
Sets the parameter's display name.
This name is used for display only, it is not used for indexing or identifying the parameter This name may be changed after the parameter has been created, but display name changes may not be recognized by all AAX hosts.
| [in] | name | Display name that will be assigned to the parameter |
Implements AAX_IParameter.
|
virtual |
Returns the parameter's display name.
Implements AAX_IParameter.
|
virtual |
Sets the parameter's shortened display name.
This name is used for display only, it is not used for indexing or identifying the parameter These names show up when the host asks for shorter length parameter names for display on Control Surfaces or other string length constrained situations.
| [in] | name | Shortened display names that will be assigned to the parameter |
Implements AAX_IParameter.
|
virtual |
Returns the parameter's shortened display name.
Implements AAX_IParameter.
References AAX_CString::Get().
|
virtual |
Clears the internal list of shortened display names.
Implements AAX_IParameter.
|
virtual |
Sets the parameter's default value using its normalized representation.
Implements AAX_IParameter.
|
virtual |
Returns the normalized representation of the parameter's real default value.
Implements AAX_IParameter.
|
virtual |
Restores the state of this parameter to its default value.
Implements AAX_IParameter.
Referenced by AAX_CParameter< T >::AAX_CParameter().
|
virtual |
Sets a parameter value using it's normalized representation.
For more information regarding normalized values, see Parameter Manager
| [in] | newNormalizedValue | New value (normalized) to which the parameter will be set |
Implements AAX_IParameter.
|
virtual |
Returns the normalized representation of the parameter's current real value.
Implements AAX_IParameter.
|
virtual |
Sets the number of discrete steps for this parameter.
Stepped parameter values are useful for discrete parameters and for "jumping" events such as mouse wheels, page up/down, etc. The parameter's step size is used to specify the coarseness of those changes.
| [in] | numSteps | The number of steps that the parameter will use |
Implements AAX_IParameter.
References AAX_ASSERT.
|
virtual |
Returns the number of discrete steps used by the parameter.
See SetNumberOfSteps() for more information about parameter steps.
Implements AAX_IParameter.
|
virtual |
Returns the current step for the current value of the parameter.
See SetNumberOfSteps() for more information about parameter steps.
Implements AAX_IParameter.
|
virtual |
Returns the normalized value for a given step.
See SetNumberOfSteps() for more information about parameter steps.
Implements AAX_IParameter.
|
virtual |
Returns the step value for a normalized value of the parameter.
See SetNumberOfSteps() for more information about parameter steps.
Implements AAX_IParameter.
|
virtual |
Returns the current step for the current value of the parameter.
See SetNumberOfSteps() for more information about parameter steps.
Implements AAX_IParameter.
|
virtual |
Sets the type of this parameter.
See GetType for use cases
| [in] | iControlType | The parameter's new type as an AAX_EParameterType |
Implements AAX_IParameter.
|
virtual |
Returns the type of this parameter as an AAX_EParameterType.
Implements AAX_IParameter.
|
virtual |
Sets the orientation of this parameter.
| [in] | iOrientation | The parameter's new orientation |
Implements AAX_IParameter.
|
virtual |
Returns the orientation of this parameter.
Implements AAX_IParameter.
|
virtual |
Sets the parameter's taper delegate.
| [in] | inTaperDelegate | A reference to the parameter's new taper delegate |
| [in] | inPreserveValue |
Implements AAX_IParameter.
References AAX_ITaperDelegate< T >::Clone().
|
virtual |
Sets the parameter's display delegate.
| [in] | inDisplayDelegate | A reference to the parameter's new display delegate |
Implements AAX_IParameter.
References AAX_IDisplayDelegate< T >::Clone().
|
virtual |
Serializes the parameter value into a string.
| [out] | valueString | A string representing the parameter's real value |
| true | The string conversion was successful |
| false | The string conversion was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Serializes the parameter value into a string, size hint included.
| [in] | iMaxNumChars | A size hint for the size of the string being requested. Useful for control surfaces and other limited area text fields. (make sure that size of desired string also has room for null termination) |
| [out] | valueString | A string representing the parameter's real value |
| true | The string conversion was successful |
| false | The string conversion was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a bool to a normalized parameter value.
| [in] | value | A value for the parameter |
| [out] | normalizedValue | The normalized parameter value associated with value |
| true | The value conversion was successful |
| false | The value conversion was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts an integer to a normalized parameter value.
| [in] | value | A value for the parameter |
| [out] | normalizedValue | The normalized parameter value associated with value |
| true | The value conversion was successful |
| false | The value conversion was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a float to a normalized parameter value.
| [in] | value | A value for the parameter |
| [out] | normalizedValue | The normalized parameter value associated with value |
| true | The value conversion was successful |
| false | The value conversion was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a double to a normalized parameter value.
| [in] | value | A value for the parameter |
| [out] | normalizedValue | The normalized parameter value associated with value |
| true | The value conversion was successful |
| false | The value conversion was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a given string to a normalized parameter value.
| [in] | valueString | A string representing a possible real value for the parameter |
| [out] | normalizedValue | The normalized parameter value associated with valueString |
| true | The string conversion was successful |
| false | The string conversion was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a normalized parameter value to a bool representing the corresponding real value.
| [in] | normalizedValue | The normalized value to convert |
| [out] | value | The converted value. Set only if conversion is successful. |
| true | The conversion to bool was successful |
| false | The conversion to bool was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a normalized parameter value to an integer representing the corresponding real value.
| [in] | normalizedValue | The normalized value to convert |
| [out] | value | The converted value. Set only if conversion is successful. |
| true | The conversion to int32_t was successful |
| false | The conversion to int32_t was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a normalized parameter value to a float representing the corresponding real value.
| [in] | normalizedValue | The normalized value to convert |
| [out] | value | The converted value. Set only if conversion is successful. |
| true | The conversion to float was successful |
| false | The conversion to float was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a normalized parameter value to a double representing the corresponding real value.
| [in] | normalizedValue | The normalized value to convert |
| [out] | value | The converted value. Set only if conversion is successful. |
| true | The conversion to double was successful |
| false | The conversion to double was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a normalized parameter value to a string representing the corresponding real value.
| [in] | normalizedValue | A normalized parameter value |
| [out] | valueString | A string representing the parameter value associated with normalizedValue |
| true | The string conversion was successful |
| false | The string conversion was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a normalized parameter value to a string representing the corresponding real, size hint included. value.
| [in] | normalizedValue | A normalized parameter value |
| [in] | iMaxNumChars | A size hint for the size of the string being requested. Useful for control surfaces and other limited area text fields. (make sure that size of desired string also has room for null termination) |
| [out] | valueString | A string representing the parameter value associated with normalizedValue |
| true | The string conversion was successful |
| false | The string conversion was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a string to a real parameter value and sets the parameter to this value.
| [in] | newValueString | A string representing the parameter's new real value |
| true | The string conversion was successful |
| false | The string conversion was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Sets the automation delegate (if one is required)
| [in] | iAutomationDelegate | A reference to the parameter manager's automation delegate interface |
Implements AAX_IParameter.
References AAX_IAutomationDelegate::RegisterParameter().
|
virtual |
Returns true if the parameter is automatable, false if it is not.
Implements AAX_IParameter.
|
virtual |
Signals the automation system that a control has been touched.
Call this method in response to GUI events that begin editing, such as a mouse down. After this method has been called you are free to call SetNormalizedValue() as much as you need, e.g. in order to respond to subsequent mouse moved events. Call Release() to free the parameter for updates from other controls.
Implements AAX_IParameter.
|
virtual |
Signals the automation system that a control has been released.
Call this method in response to GUI events that complete editing, such as a mouse up. Once this method has been called you should not call SetNormalizedValue() again until after the next call to Touch().
Implements AAX_IParameter.
|
virtual |
Retrieves the parameter's value as a bool.
| [out] | value | The parameter's real value. Set only if conversion is successful. |
| true | The conversion to bool was successful |
| false | The conversion to bool was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Retrieves the parameter's value as an int32_t.
| [out] | value | The parameter's real value. Set only if conversion is successful. |
| true | The conversion to int32_t was successful |
| false | The conversion to int32_t was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Retrieves the parameter's value as a float.
| [out] | value | The parameter's real value. Set only if conversion is successful. |
| true | The conversion to float was successful |
| false | The conversion to float was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Retrieves the parameter's value as a double.
| [out] | value | The parameter's real value. Set only if conversion is successful. |
| true | The conversion to double was successful |
| false | The conversion to double was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Retrieves the parameter's value as a string.
| [out] | value | The parameter's real value. Set only if conversion is successful. |
| true | The conversion to string was successful |
| false | The conversion to string was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Sets the parameter's value as a bool.
| [out] | value | The parameter's real value. Set only if conversion is successful. |
| true | The conversion from bool was successful |
| false | The conversion from bool was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Sets the parameter's value as an int32_t.
| [out] | value | The parameter's real value. Set only if conversion is successful. |
| true | The conversion from int32_t was successful |
| false | The conversion from int32_t was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Sets the parameter's value as a float.
| [out] | value | The parameter's real value. Set only if conversion is successful. |
| true | The conversion from float was successful |
| false | The conversion from float was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Sets the parameter's value as a double.
| [out] | value | The parameter's real value. Set only if conversion is successful. |
| true | The conversion from double was successful |
| false | The conversion from double was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Sets the parameter's value as a string.
| [out] | value | The parameter's real value. Set only if conversion is successful. |
| true | The conversion from string was successful |
| false | The conversion from string was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Sets the parameter's state given a normalized value.
This is the second half of the parameter setting operation that is initiated with a call to SetValue(). Parameters should not be set directly using this method; instead, use SetValue().
| [in] | newNormalizedValue | Normalized value that will be used to set the parameter's new state |
Implements AAX_IParameter.
| void AAX_CParameter< T >::SetValue | ( | T | newValue | ) |
Initiates a host request to set the parameter's value.
This method normalizes the provided value and sends a request for the value change to the AAX host. The host responds with a call to AAX_IParameter::UpdateNormalizedValue() to complete the set operation.
| [in] | newValue | The parameter's new value |
| T AAX_CParameter< T >::GetValue | ( | ) | const |
Returns the parameter's value.
This is the parameter's real, logical value and should not be normalized
| void AAX_CParameter< T >::SetDefaultValue | ( | T | newDefaultValue | ) |
Set the parameter's default value.
This is the parameter's real, logical value and should not be normalized
| [in] | newDefaultValue | The parameter's new default value |
| T AAX_CParameter< T >::GetDefaultValue | ( | ) | const |
Returns the parameter's default value.
This is the parameter's real, logical value and should not be normalized
| const AAX_ITaperDelegate< T > * AAX_CParameter< T >::TaperDelegate | ( | ) | const |
Returns a reference to the parameter's taper delegate.
| const AAX_IDisplayDelegate< T > * AAX_CParameter< T >::DisplayDelegate | ( | ) | const |
Returns a reference to the parameter's display delegate.
|
virtual |
Retrieves the parameter's value as a string.
| [out] | value | The parameter's real value. Set only if conversion is successful. |
| true | The conversion to string was successful |
| false | The conversion to string was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Sets the parameter's value as a bool.
| [out] | value | The parameter's real value. Set only if conversion is successful. |
| true | The conversion from bool was successful |
| false | The conversion from bool was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Sets the parameter's value as an int32_t.
| [out] | value | The parameter's real value. Set only if conversion is successful. |
| true | The conversion from int32_t was successful |
| false | The conversion from int32_t was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Sets the parameter's value as a float.
| [out] | value | The parameter's real value. Set only if conversion is successful. |
| true | The conversion from float was successful |
| false | The conversion from float was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Sets the parameter's value as a double.
| [out] | value | The parameter's real value. Set only if conversion is successful. |
| true | The conversion from double was successful |
| false | The conversion from double was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Sets the parameter's value as a string.
| [out] | value | The parameter's real value. Set only if conversion is successful. |
| true | The conversion from string was successful |
| false | The conversion from string was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a bool to a normalized parameter value.
| [in] | value | A value for the parameter |
| [out] | normalizedValue | The normalized parameter value associated with value |
| true | The value conversion was successful |
| false | The value conversion was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts an integer to a normalized parameter value.
| [in] | value | A value for the parameter |
| [out] | normalizedValue | The normalized parameter value associated with value |
| true | The value conversion was successful |
| false | The value conversion was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a float to a normalized parameter value.
| [in] | value | A value for the parameter |
| [out] | normalizedValue | The normalized parameter value associated with value |
| true | The value conversion was successful |
| false | The value conversion was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a double to a normalized parameter value.
| [in] | value | A value for the parameter |
| [out] | normalizedValue | The normalized parameter value associated with value |
| true | The value conversion was successful |
| false | The value conversion was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a normalized parameter value to a bool representing the corresponding real value.
| [in] | normalizedValue | The normalized value to convert |
| [out] | value | The converted value. Set only if conversion is successful. |
| true | The conversion to bool was successful |
| false | The conversion to bool was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a normalized parameter value to an integer representing the corresponding real value.
| [in] | normalizedValue | The normalized value to convert |
| [out] | value | The converted value. Set only if conversion is successful. |
| true | The conversion to int32_t was successful |
| false | The conversion to int32_t was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a normalized parameter value to a float representing the corresponding real value.
| [in] | normalizedValue | The normalized value to convert |
| [out] | value | The converted value. Set only if conversion is successful. |
| true | The conversion to float was successful |
| false | The conversion to float was unsuccessful |
Implements AAX_IParameter.
|
virtual |
Converts a normalized parameter value to a double representing the corresponding real value.
| [in] | normalizedValue | The normalized value to convert |
| [out] | value | The converted value. Set only if conversion is successful. |
| true | The conversion to double was successful |
| false | The conversion to double was unsuccessful |
Implements AAX_IParameter.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |


How to implement your own visitor (Implementation of your proprietary algorithm) that can easily run inside DataFrame
DataFrame visitors have a very simple interface that you can follow. To see examples of built-in visitors, look at the file DataFrameStatsVisitors.h.
These are the interfaces you must have:
- It is helpful if you include file DataFrameStatsVisitors.h in your new visitor source file. It includes some macros you can use.
- A visitor at its heart is a functor:
- You must declare a struct or class with an appropriate name for your visitor. If your visitor needs parameters, take them in the functor constructor.
- Your functor must publicly declare the operator()(). The number of parameters to the () operator depends on your algorithm and what you are implementing. The first pair of parameters to () operator is always the begin and end iterators of the index vector. After that you have pairs of begin/end iterators to the data vectors. DataFrame supports visitors that operate on 1 to 5 data columns. DataFrame calls this operator to pass the data. Your algorithm should be here.
- Your functor must publicly typedef the following types:
- index_type: This defines the index column type
- value_type: This defines the data column(s) type. If you have multiple data columns of different types, define it for the first one
- result_type: This defines the type of your algorithm result. The result could be an item or a container of items or … If you have multiple result types, define it for the first/main one.
- Your functor must publicly define the following member functions:
- void pre(): This is called by DataFrame before passing data to your visitor. You can initialize the process here. And/or reset the process here for repeated use of the same visitor instance.
- void post(): This is called by DataFrame after it finishes with passing data to your visitor. You can finalize the process here.
- const result_type &get_result() const: This returns the result of your algorithm. If you have multiple results, define this for the first/main result.
- result_type &get_result(): non-const version of above, if applicable.
- Your visitor will be used by DataFrame's visit() or signle_act_visit() methods.


execline
Software
skarnet.org
The ifte program
ifte performs a conditional alternative.
Interface
In an execlineb script:
ifte [ -X ] [ -n ] { progthen... } { progelse... } progif...
- ifte reads progthen... and progelse... in two
consecutive blocks.
- ifte runs progif... as a child process
and waits for it to complete.
- If progif... crashes (i.e. is killed by a signal), ifte
prints an error message, then exits 128 plus the number of the signal that
killed progif.
- If progif... exits zero, ifte execs into
progthen..., else it execs into progelse....
Options
- -X : do not exit if progif crashes; instead,
proceed as if the test had returned false.
- -n : negate the test. progthen... will be run
iff progif... exits nonzero.
Notes
ifte is a simpler version of ifthenelse.
It performs only conditional execution, not instruction sequence.
"ifthenelse { progif } { progthen } { progelse } remainder" is the
equivalent of "foreground { ifte { progthen } { progelse } progif } remainder".


Analyses 'isset(...)' function usages.
This inspection suggests using 'null !== ...', 'array_key_exists(..., ...)' instead.
In cases when isset is applied to array-accessing expressions, this inspection checks if concatenation is
used to generate an index.
It should be noted that array_key_exists returns true even if array item is null; this inspection
is focused on verifying data structures' sanity and may be safely ignored in some cases.
Refactoring this might present a significant cost in terms of
additional development and legacy code reverse engineering, so
the cost-benefit should be weighed carefully.


{% extends 'base.html' %} {% block title %}Grading {{ study.name }}{% endblock %} {% block content %}
Look at the picture and fill out the grading form. << Grading criteria here >>


Information for this website is provided by the Better Doctor Inc. API.
Search parameters are limited to 20 results.


| GEOS SDK TechDocs
|
| noStructEnum ...
| patchin ...
objmessagebrk
objmessagebrk [<address>]
Examples:
-
"objmessagebrk MyObj"
-
break whenever a message is sent to MyObj
-
"objmessagebrk"
-
stop intercepting messages
Break whenever a message is sent to a particular object via ObjMessage.
-
The <address> argument is the address to an object to watch for messages being sent to it. If no argument is specified then the watching is stopped.
-
This breaks whenever a message is sent (before they get on the message queue. This enables one to track identical messages to an object which can be removed.
See Also: objwatch,
mwatch,
procmessagebrk,
pobject.
objwalk
objwalk [<address>]
Examples: "objwalk"
Prints out information about an object block.
-
The <address> argument is the address of the block to print. The default is the block pointed at by DS.
See Also: lhwalk,
pobject.
objwatch
objwatch [<address>]
Examples:
-
"objwatch ds:si"
-
watch the messages which reach the object at DS:SI
-
"objwatch MyObject"
-
watch the messages which reach MyObject
-
"objwatch"
-
Watch the messages which reach the process object.
Display message calls that have reached a particular object.
-
The <address> argument is the address of the object to watch.
-
This returns the token of the breakpoint being used to watch message deliveries to the object. Use the "brk" command to enable, disable, or turn off the watching of the object.
See Also: brk,
mwatch,
objmessagebrk,
procmessagebrk,
pobject.
omfq
omfq <message> <object> <args>*
Examples:
-
"omfq MSG_META_QUIT *HelloApp"
-
Sends
MSG_META_QUIT
to the *
HelloApp
object.
Forces a message for an object onto its event queue.
-
This command calls ObjMessage, passing it
di=mask MF_FORCE_QUEUE.
-
<args> is the set of additional parameters to pass to ObjMessage. It consists of <variable/register> <value> pairs, which are passed to the "assign" command. As a special case, if the variable is "push", the value (a word) is pushed onto the stack and is popped when the message has been queued.
-
The registers active before you issued this command are always restored, regardless of whether the call to
ObjMessage
completes successfully. This is in contrast to the "call" command, which leaves you where the machine stopped with the previous state lost.
-
This command will only work when execution halts in the thread that is to receive
the message.
See Also: call.
pappcache
pappcache
Examples:
-
"pappcache"
- Print out current state of the app-cache
Prints out the current state of the system application cache, for systems operating in transparent launch mode.
Specifically, this command prints out:
-
Applications in the cache (First choice for detaching)
-
Top full-screen App (Not detached except by another full screen app)
-
Desk accessories (detached only as last resort)
-
Application geodes in the process of detaching
patch
patch [<addr>]
patch del <addr>*
Patch assists in creating breakpoints that invisibly make small changes to code. This can help the programmer find several bugs without remaking and redownloading.
-
If you give no <addr> when creating a patch, the patch will be placed at the most-recently accessed address, as set by the command that most-recently accessed memory (e.g. bytes, words, listi, imem, etc.)
-
When creating a patch, you are prompted for its contents, each line of which comes from the following command set:
Patch Command Set
|
Form | Meaning | Example |
|
<reg> = <value> | assign value to reg | ax = bx dl = 5 |
|
push <reg>|<value> | push value | push ax push 45 |
|
pop <reg>|<value> | pop value | pop ax pop 45 |
|
pop | pop nothing (sp=sp+2) | pop |
|
jmp <address> | change ip | jmp UI_Attach+45 |
|
scall <address> <regs> | call routine (save) | scall MemLock ax = 3 |
|
mcall<address> <regs> | call routine (modify) | mcall MemLock ax = 3 |
|
xchg <reg> <reg> | swap two registers | xchg ax bx |
|
set <flag> | set condition flag | set CF set ZF |
|
reset <flag> | reset condition flag | reset CF reset ZF |
|
if <flag> | if flag set then ... | if CF |
|
if !<flag> | if flag reset then ... | if !ZF |
|
if <expr> | if expr then ... | if foo == 4 |
|
else | | |
|
endif | | |
|
ret | make function return | ret |
|
$ | terminate input | |
|
a | abort | |
|
<other> | tcl command | echo $foo |
<flag> is taken from the set TF, IF, DF, OF, SF, ZF, PF, AF, CF and must be in upper-case.
The "scall" command has no effect on the current registers (not even for purposes of return values), while the "mcall" command changes whatever registers the function called modifies. See the "call" documentation for the format of <regs>.
| GEOS SDK TechDocs
|
| noStructEnum ...
| patchin ...


It seems like I did not update my blog for almost a month. The reason is that lately, I spent most of my time on preparing the interviews and also taking the deep learning courses on Coursera by Andrew Ng (I will summarize what I have learned from this course later on).
Today I will continue my Spark learning since one of my latest interviews needs me to have such skills. Without further ado, let us see what is Spark MLlib.
MLlib is Spark's machine learning library. Its goal is to make practical machine learning scalable and easy. At the very start, MLlib is an RDD-based library; but since the appearance of Spark Dataframe, it is recommended to use DataFrame instead.
1. Data Types
Even though we will use DataFrame as our main input for performing machine learning; I think it is still very necessary to know the basic RDD-based data types.
1.1 Local Vectors and Labeled Point
Local vector is the basic composition of the RDD data. There are two types:
- Dense Vector: double array
- Sparse Vector: indices and values
Let us see one example:
from pyspark.mllib.linalg import Vectors
from pyspark.mllib.regression import LabeledPoint
# Create dense vector
Vectors.dense([2,0,4]) # --> DenseVector([2.0,0.0,4.0])
# Create sparse vector
Vectors.sparse(3,[0,2],[2.0,4.0]) # 3 is the size, [0,2] represnet the location of non-zero values
# Create a Labeled point
LabeledPoint(label = 1, features = Vectors.dense([2,0,4]))
1.2 Local Matrix
A local matrix has integer-typed row and column indices and double-typed values, stored on a single machine. Similar to local vector, we also have the dense matrix and sparse matrix here. Due to the appearance of Spark DataFrame, the RDD-based matrix is used less and less, so I will ignore other matrix type derived from the local matrix.
from pyspark.mllib.linalg import Matrices
# Create a dense matrix
Matrices.dense(3,2,[1,2,3,4,5,6])
# Create a sparse matrix
Matrices.sparse(3,2,[0,1,3],[0,2,1],[9,6,8])
2. Machine Learning
Now we have the prerequisite knowledge of performing machine learning on Spark: basic RDD data type and Spark Dataframe (On last Spark post). Then can we use these data directly to perform a ML algorithm?
The answer is No. That is the difference between performing ML on Spark and on sklearn. Here are some detailed differences:
- Spark DataFrame is not mutable, so always we need to use some transformer to transform our DataFrame
- The DataFrame should have features and label column for supervised learning where features contain all the independent information and label contains the dependent information.
- There are several ways to construct Spark Dateframe, depending on the format of our source data (Detailed information is in my last spark post)
Except for the things above, the procedures are quite similar to normal sklearn machine learning. I will not list all the ML algorithms here, but I want to use Logistics Regression and Random Forest to illustrate two ways to deal with the ML problems.
2.1 Logistic Regression
I will use the classic iris data set to perform this classification. This time I would like to use pandas to manipulate the dataframe first and transform to Spark DataFrame.
First using pandas to create a two class datasets
import pandas as pd
from pyspark.sql import SparkSession
spark = SparkSession.builder.master('local').appName('try').getOrCreate()
# Create Toy Data
pd_df = pd.read_csv('/Users/gongfan/Desktop/iris', sep=',', header=None)
pd_df.columns = ['feature1','feature2', 'feature3','feature4','label']
pd_df = pd_df[pd_df['label'].isin(values=['Iris-setosa', 'Iris-versicolor'])]
pd_df.loc[:,'label'][pd_df['label'] == 'Iris-setosa'] = 0
pd_df.loc[:,'label'][pd_df['label'] == 'Iris-versicolor'] = 1
Then I transformed it to spark DataFrame
df = spark.createDataFrame(pd_df)
# Transform the Dataframe to (features, label) format
df.rdd.map(lambda x: (Vectors.dense(x[0:-1]), x[-1])).toDF(["features", "label"]))
# Results:
+-----------------+-----+
| features|label|
+-----------------+-----+
|[5.1,3.5,1.4,0.2]| 0|
|[4.9,3.0,1.4,0.2]| 0|
|[4.7,3.2,1.3,0.2]| 0|
+-----------------+-----+
Next is model training, which are quite similar to sklearn:
from pyspark.ml.classification import LogisticRegression
# train test split
(df_train, df_test) = df.randomSplit([0.7,0.3], 42) # 42 is the RandomState
# Train Logistic Regression Model
lr = LogisticRegression(maxIter=20, regParam=0.3, elasticParam = 0.8)
lrModel = lr.fit(df_train)
# Make Prediction
predict = lrModel.evaluate(df_test)
predict.predictions.show(3)
#Results:
+-----------------+-----+--------------------+--------------------+----------+
| features|label| rawPrediction| probability|prediction|
+-----------------+-----+--------------------+--------------------+----------+
|[4.4,2.9,1.4,0.2]| 0|[0.93747822263454...|[0.71858998880745...| 0.0|
|[4.4,3.0,1.3,0.2]| 0|[0.97002544348423...|[0.72512456918688...| 0.0|
|[4.4,3.2,1.3,0.2]| 0|[0.98632612358187...|[0.72836165252631...| 0.0|
+-----------------+-----+--------------------+--------------------+----------+
Finally for model evaluation, We can transform the evaluation results back to pandas and make plots:
roc = predict.roc.toPandas()
plt.plot(roc['FPR'], roc['TPR'], marker = '.')
plt.plot([0,1], [0,1], linestyle = '-', marker = '.')
plt.xlabel('FPR')
plt.ylabel('TPR')
plt.title('ROC Curve')
plt.show()
Conclusion: It seems like the first method is quite restrictive since we perform our data wrangling on pandas; still, the speed will be very slow on big data. So this method is only available for dealing with middle size complicated data. For big data, we need to use the next method which is pure Spark.
2.2 Random Forest Model
Then let us use a pure Spark way to make classification. To perform data manipulation in Spark DataFrame, we need several more functions:
- StringIndexer:
pyspark.ml.feature.StringIndexer(inputCol=None, outputCol=None, handleInvalid='error', stringOrderType='frequencyDesc')
A label indexer that maps a string column of labels to an ML column of label indices (numerical). - OneHotEncoder:
pyspark.ml.feature.OneHotEncoder(dropLast=True, inputCol=None, outputCol=None)
maps a column of label indices to a column of binary vectors, with at most a single one-value - VectorIndexer:
pyspark.ml.feature.VectorIndexer(maxCategories=20, inputCol=None, outputCol=None, handleInvalid='error')
Automatically identify categorical features, and index them. We specify maxCategories so features with > max distinct values are treated as continuous - IndexToString:
pyspark.ml.feature.IndexToString(inputCol=None, outputCol=None, labels=None)
maps a column of label indices back to a column containing the original labels as strings
By just looking at these function explanation is quite confusing, let me then take random forest model as an example to use them:
This time, I will first create Spark DataFrame by using RDD:
from pyspark.ml.classification import RandomForestClassifier
from pyspark.ml.feature import StringIndexer, VectorIndexer, IndexToString
from pyspark.ml.evaluation import MulticlassClassificationEvaluator
rdd = spark.sparkContext.textFile('/Users/gongfan/Desktop/iris')
rdd = rdd.map(lambda x: x.split(',')) # split the row data by comma
# Map the rdd to (features, label) format and then transform to DataFrame
df = rdd.map(lambda x: (Vectors.dense(x[0:-1]), x[-1])).toDF(["features", "label"])
#Results:
+-----------------+-----------+
| features| label|
+-----------------+-----------+
|[5.1,3.5,1.4,0.2]|Iris-setosa|
|[4.9,3.0,1.4,0.2]|Iris-setosa|
|[4.7,3.2,1.3,0.2]|Iris-setosa|
+-----------------+-----------+
Then let me use StringIndexer
to transform my string label to a numerical one. If we have categorical features we could use OneHotEncoder
or VectorIndexer
to transform them in a similar way.
labelIndexer = StringIndexer(inputCol='label', outputCol='indexedLabel').fit(df)
df = labelIndexer.transform(df)
# Results:
+-----------------+-----------+------------+
| features| label|indexedLabel|
+-----------------+-----------+------------+
|[5.1,3.5,1.4,0.2]|Iris-setosa| 0.0|
|[4.9,3.0,1.4,0.2]|Iris-setosa| 0.0|
|[4.7,3.2,1.3,0.2]|Iris-setosa| 0.0|
+-----------------+-----------+------------+
Then we train our model:
(df_train, df_test) = df.randomSplit([0.7,0.3], 42)
rf = RandomForestClassifier(labelCol='indexedLabel',
featuresCol='features', # sometimes use 'indexedFeatures which transformed by VectorIndexer'
numTrees = 10)
Next, we want to make predictions, and here we use IndexToString
to covert our indexed labels back to original labels.
# Create our label converter
labelConverter = IndexToString(inputCol="prediction", outputCol="predictedLabel",
labels=labelIndexer.labels) # original label names
# make prediction
rf = rf.fit(df_train)
rf_prediction = rf.transform(df_test)
rf_prediction = labelConverter.transform(rf_prediction)
rf_prediction.show(3)
# Results:
+-----------------+-----------+------------+--------------+-------------+----------+--------------+
| features| label|indexedLabel| rawPrediction| probability|prediction|predictedLabel|
+-----------------+-----------+------------+--------------+-------------+----------+--------------+
|[4.4,2.9,1.4,0.2]|Iris-setosa| 0.0|[10.0,0.0,0.0]|[1.0,0.0,0.0]| 0.0| Iris-setosa|
|[4.4,3.0,1.3,0.2]|Iris-setosa| 0.0|[10.0,0.0,0.0]|[1.0,0.0,0.0]| 0.0| Iris-setosa|
|[4.4,3.2,1.3,0.2]|Iris-setosa| 0.0|[10.0,0.0,0.0]|[1.0,0.0,0.0]| 0.0| Iris-setosa|
+-----------------+-----------+------------+--------------+-------------+----------+--------------+
Finally, don't forget to evaluate our model. Here I use MulticlassClassificationEvaluator
module from pyspark.ml.evaluation
library, it also has other evaluation methods such as RegressionEvaluator
for regression problems.
evaluator = MulticlassClassificationEvaluator(labelCol="indexedLabel", predictionCol="prediction", metricName="accuracy")
accuracy = evaluator.evaluate(rf_prediction)
print("Test Accuracy = {}".format(accuracy))
# --> Test Accuracy = 0.9444444444444444
3. Something needs to be notice..
When I used some modules in pyspark machine learning lib, I got several errors that I did not know why. Later I realized that there are two different machine learning modules in pyspark and may contain same functions and classes, so I think it is necessary to clarify their differences:
spark.mllib
: Contains the original API built on top of RDDsspark.ml
: Provides higher-level API built on top of DataFrames for constructing ML pipelines.
They may have same modules within these two libraries, but they are not compatible. So make sure which module to use dealing with different problems.


Reports if statements (with no else branch) throwing java.lang.Throwable.
For example: if (param == 2) throw new Exception(); or guava's: Preconditions.checkNotNull(param, message)
Quick fix replaces it with an assert statement.
Example: assert param != 2;


If you're lookin for advanced BBcode tags, try here.
BBcode refers to Bulletin Board code. Like HTML, it is a markup language used to format text for view on the World Wide Web. Specifically, it is designed to be used by forum posters to format their posts. This documentation page will identify which BBcode tags can be used on this forum.
By using the above tags, you can apply simple styles to any text.
For example:
[b]This text is bold[/b] [u]This text is underlined[/u] [i]This text is italic[/i] [b][i]This text[/i] is [u]mixed[/u][/b]
The above will display as:
This text is bold
This text is italic
This text is underlined
This text is mixed
The [color=...] tag can be used to apply a color to some text. The color must be a valid HTML color code (e.g. "blue", "red", "#ff0000", "#888", etc.). Refer to this page for other, valid HTML color codes.
Examples:
The following text is colored [color=red]red[/color], [color=#eeaa00]yellow[/color] and [color=#30f]blue[/color]!
This will be displayed as:
The following text is colored red, yellow and blue!
The [size=...] tag is used to resize the font of a piece of text. The size must be a valid CSS size indication (e.g. "12px", "small", "larger", etc.). Refer to this page to read about valid CSS size properties.
Examples:
[size=x-small]It[/size][size=small]looks[/size][size=medium]like[/size][size=large]I'm[/size][size=x-large]growing![/size]
This will be displayed as:
It looks like I'm growing!
These tags are all used to link to web resources.
Examples:
[img]http://http://www.w3schools.com/tags/angry.gif[/img] [url]http://www.example.com[/url] [url=http://www.example.com]Visit Example.com![/url]<EMAIL_ADDRESS><EMAIL_ADDRESS>email[/email]
These will be displayed as:
www.example.com
Visit
Example.com!
<EMAIL_ADDRESS>Link to
example-users's email
Frequently you will have programming code, ASCII art, etc. which you want to display in your post. For those situations, you can use the [code] tags.
For example:
[code] __ ____ ___ ________ _____ ______ | | ____ _/ __ \\ \/ /\__ \ / \\____ \| | _/ __ \ \ ___/ \ / / __ \| Y Y \ |_\ \ |_\ ___/ \___ /__/\_ \(____ /__|_| / __/|____/\___ \ \/ \/ \/ \/|__| \/ [/code]
Without the [code] tags around it, this would look totally scrambled, like:
__But with the [code] tags around it, it looks like:
__ ____ ___ ________ _____ ______ | | ____ _/ __ \\ \/ /\__ \ / \\____ \| | _/ __ \ \ ___/ \ / / __ \| Y Y \ |_\ \ |_\ ___/ \___ /__/\_ \(____ /__|_| / __/|____/\___ \ \/ \/ \/ \/|__| \/
When you need to quote something or someone in your post, you can use the [quote] tags. If you want to include the name of the person you are quoting, you can use the [quote=...] tag.
Examples:
[quote]El Dorado is the best![/quote] [quote=William Shakespeare] To be or not to be, --that is the question:-- Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them? [/quote]
These will be displayed as:
El Dorado is the best!
William Shakespeare wrote:
To be or not to be, --that is the question:--
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune
Or to take arms against a sea of troubles,
And by opposing end them?
These tags are used when you want your post to initially hide specific content, be it text or other embedded media. Sometimes this is due to the graphic nature of this content, or sometimes you just don't want the reader to see it initially.
Examples:
[nsfw]This could be deemed unsafe for co-workers to oversee![/nsfw] [spoiler]The spoiler tag works great as a way to give away the end of movies[/spoiler] [hide=The answer]...or, you can make your own "hide-it" link[/hide]
This will be displayed as:
Continue to the advanced BBcode tags here.


--- layout: page title: About Me subtitle: CS Undergrad(pending thesis) | Former AOC Gamer ---
Currently I am looking into applications of Deep Learning in Computer Vision and Natural Language Processing. I have primarily worked on sequence-to-sequence conversion and sequence tagging problems.
I would like work on projects that has potential for big impact. I am an ideal fit in any team working on data driven products.
I like gaming, watching sit-coms, movies and cartoons. I also enjoy teaching and learning new things.


保险业国别风险评估：中国寿险
提交表格后开始下载完整报告！
姓名
邮件
电话（选填）
公司名称
公司种类
选择
Academia
Asset Manager
Asset Owner
Auditors/Accounting
Automobiles and Components
Capital Goods
Commercial Bank
Commercial Services and Supplies
Consumer Durables and Apparel
Consumer Services
Credit Union
Food, Beverage and Tobacco
Food and Staples Retailing
Government Entity/Regulatory Agency
Healthcare Equipment and Services
Hedge Fund
Household and Personal Products
Individual
Information Provider
Insurance
Investment Bank
Law Firm
Materials
Media/Telecom
Metals/Mining
Oil and Gas
Pharmaceuticals, Biotechnology and Life Sciences
Power
Private Equity
Public Relations/Investor Relation Firm
Recruiter/Headhunter
Real Estate
Retailing
Strategy/Business Consulting
Technology
Trade Association
Trading Companies and Distributors
Transportation
Unclassified
城市


Best Christmas gifts for kids 2019 including Linkimals, Harry Potter LEGO and Rizmo
From personalised presents, to classic books, to this year's top-rated toys, we've picked out what we reckon are the best Christmas gifts for kids in 2019 - whatever their age
by Molly Holt, https://www.facebook.com/mollyjaholt/Christmas always seems to have more meaning when kids are involved, but there's no need to spend a fortune on making it extra special.
Plus, it's important to keep them entertained over the festive period, so treating them to something special will at least keep them occupied for a fair few hours while you get some well-earned rest in.
Whether you're buying for a child that already has everything, want the top toy of the season, or are just looking for a unique and decent priced gesture that will warm your loved one's hearts this Christmas, we've rounded up our top picks of all the best Christmas gifts for kids below.
We've focused on little ones of all ages, whether they're just learning to hold things by themselves, or are fully active and ready to take on the world with their first ever scooter, to make sure that there's a little something for everyone.
1. Linkimals Smooth Moves Sloth, £25.43
Expected to be one of the best selling toys of the year, this is perfect for very little ones.
It claps its hands and bobs its head along to lights, songs and music, introducing babies to music and lights to keep them amused.
2. Personalised Christmas Eve box, £34.99
If you want to have a slightly more ethical Christmas this year, why not invest in a present that you can keep using for years to come.
Amazon sell an array of handmade boxes that you can fill with gifts for your little ones for Christmas Eve and personalise with your kids names. Plus, it saves you some money on wrapping paper...
3. Personalised micro scooter, £159.95
Let them zoom their way around the village with a personalised micro scooter, in which the board is emblazoned with their name.
Choose from mint green or black for your metal body, then pick the name and wrap it up under the tree.
Get it from Micro Scooter for £159.95
4. LEGO Harry Potter Hogwarts Clock Tower, £84.99
If you know someone that's obsessed with all things Harry Potter, let them reimagine the scenes themselves with their very own Clock Tower model
Young witches and wizards can visit Dumbledore's office, attend a Dark Arts lesson and dance at the Yule Ball, as the Hogwarts set comes complete with minifigures, who are all dressed in their Yule Ball outfits.
5. Rizmo, £49.99
Growing up alongside your little one, Tomy's new Rizmo toys are being dubbed the first ever "evolving toy" as overtime, as you engage, cuddle, sing and play with Rizmo, you’ll experience its magical evolution from baby to kid, and eventually adult mode.
It's all down to clever tech, apparently, with the plush toy combining innovative robotics to create a remarkably interactive creature.
Get it from John Lewis for £49.99
6. Le Toy van coffee machine, £29.95
Wooden toys are having a bit of a moment right now, and there's surely no better gifts for hipster kids than a wooden coffee machine for them to pretend to make lattes on.
Perfect for training up little baristas, it even comes with its own pods. So simple but so genius.
Get it from Scandiborn for £29.95
7. LEGO Friends Heartlake City Amusement Pier park, £75.97
Christmas should always involve some form of LEGO, with this amusement park keeping them entertained for hours thanks to a pirate ghost ship, chair swing carousel, ticket kiosk and snack stall, as well as a spin-the-wheel stall with treats.
The carousel ride even fully swings around, with three chairs that spin thanks to a twisting function.
Get it from John Lewis for £75.97
8. Tiger who came to tea book, £4
You can't beat this classic bedtime reading by the brilliant Judith Kerr, which is still a favourite amongst most families after fifty years.
It's Britain's best loved picture book for good reason!
9. Knitted Diplodocus, £9.99
Get your little ones interested in science before they're even able to talk with this adorable knitted dinosaur toy, that also doubles up as a rattle.
As well as being absolutely adorable, it's also practical too, as its knitted exterior means that it's machine washable!
Get it from Best Years for £9.99
10. Plop Trumps, £5.30
The age-old game of Trumps, but with a child's twist!
Each card has a different poo-based subject matter that talks about animals as varied as leopards, Locusts and lemurs.


Hi, my name is Max and I'm software engineer, film and photography enthusiast.
I love traveling, meeting new people and learn new skills.
I also like movies and some good 🍻.
I'm currenlty studying in Prague and working as web developer in RIGANTI.
personal web
Hi, my name is Max and I'm software engineer, film and photography enthusiast.
I love traveling, meeting new people and learn new skills.
I also like movies and some good 🍻.
I'm currenlty studying in Prague and working as web developer in RIGANTI.
| Year | Place |
|---|---|
| 2013 – 2017 | Private High School of Computer Science, Prague |
| 2017 - 2020 | Applied Informatics (Bc) - University of Economics and Business, Prague. You can check out my thesis here👈 |
| 2020 - present | Data and Web technologies (Masters) - University of Economics and Business, Prague |
I have an extensive knowledge and more than 5 years experience in .NET and .NET Core platforms. I work daily with technologies like .NET Entity Framework and ASP.NET Core MVC
I am also familiar with CI/DI technologies like Azure Dev Ops, Azure Cloud and have experience as project lead.
I have some experience in Adobe creative pack and created simple stock banner videos for conference purposes.
It is understandable, that soft skills like communication and negotiation area also important if not more importatnt than hard skills.
As long as I remember I cannot think about having issue with my colleages and co-workers.
It is easy for me to work in a large team or alone. I can handle critique and also don't mind to give an advice myself.


Geode processes use either UDP or TCP/IP ports to communicate with other processes or clients.
For example:
- Members can use multicast to communicate with peer members. You specify multicast addresses and multicast ports in your
gemfire.properties
file or as parameters on the command-line when starting the members usinggfsh
. - Clients connect to a locator to discover cache servers.
- JMX clients (such as
gfsh
and JConsole) can connect to JMX Managers and other manageable members on the pre-defined RMI port 1099. You can configure a different port if necessary. - Each gateway receiver usually has a port range where it listens for incoming communication.
See Firewalls and Ports for the complete list of ports used by Geode, their default values, and how to configure them if you do not want to use the default value.
Geode does not have any external interfaces or services that need to be enabled or opened.
Resources That Must Be Protected
These configuration files should be readable and writeable only by the dedicated user who runs servers:
-
gemfire.properties
-
cache.xml
-
gfsecurity.properties
A defaultgfsecurity.properties
is not provided in thedefaultConfigs
directory. If you choose to use this properties file, you must create it manually. A clear text user name and associated clear text password may be in this file for authentication purposes. The file system’s access rights are relied upon to protect this sensitive information.
The default location of the gemfire.properties
and cache.xml
configuration files is the defaultConfigs
child directory of the main installation directory.
Log File Locations
By default, the log files are located in the working directory used when you started the corresponding processes.
For Geode members (locators and cache servers), you can also specify a custom working directory location when you start each process. See Logging for more details.
The log files are as follows:
-
locator-name.log
: Contains logging information for the locator process. -
server-name.log
: Contains logging information for a cache server process. gfsh-%u_%g.log
: Contains logging information of an individualgfsh
environment and session.Note: By default,
gfsh
session logging is disabled. To enablegfsh
logging, you must set the Java system property-Dgfsh. log-level=desired_log_level
. See Configuring the gfsh Environment for more information.
These log files should be readable and writable only by the dedicated user who runs the servers.


Notes
- Each tx can be sent for free (with no fee)
- Each tx has custom field "data" which can be user-defined, max 128 bytes
Commissions
All commissions are divided by 10^8.
Actual commission is SendTx * 10^8 = 100 000 000 000 PIP = 0,0000001 BIP.
- SendTx = 1000
- ConvertTx = 10000
- CreateTx = 100000
- DeclareCandidacyTx = 100000
- DelegateTx = 10000
- UnbondTx = 10000
- RedeemCheckTx = 1000
- PayloadByte = 500
- ToggleCandidateStatus = 1000
Wallet
Generate wallet
Generates wallet from a random BIP39 mnemonic phrase (uses bip39.generateMnemonic under the hood).
So wallet instance will contain:
- Private key - random 64 bytes
- Mnemonic phrase - random 12 words
Export wallet
There are 3 ways of exporting a wallet:
- Export Private key - random 64 bytes
- Export Mnemonic phrase - random 12 words
- Export Vault file
Import wallet
There are 3 ways of importing a wallet:
- Import Private key - random 64 bytes
- Import Mnemonic phrase - random 12 words
- Import Vault file
Show transaction (s)
| Hash |
Mt44f31...a9216 |
| Block |
233 |
| From |
Mxa9316...49409f |
| Type |
Send |
| Message (payload) |
Hi there |
| Commission |
0.00000001 MNT |
| Data |
Data depends on type of transaction.
Type Send
Type Convert
Type Create Coin
- Name
- Symbol
- Initial Amount
- Initial Reserve
- CRR
Type Declare Candidacy
- Address
- PubKey
- Commission
- Coin
- Stake
Type Delegate
Type Unbond
Type Redeem Check
Type Set candidate online/offline
|
Coins
Coin info
| Name |
MacCoin |
| Symbol |
MCC |
| CRR |
20% |
| Reserve |
1,000 bip |
| Volume |
1,000 MCC |
| Creator |
Mxa9316...49409f |
Checks
Validators
Show candidate (s)
| Address |
Mxa93163fdf10724dc4785ff5cbfb9ac0b5949409f |
| Public key |
Mpaaee1dd...6f5dae3979 |
| Total Stake |
1,000,000 bips (14%) |
| Stakes |
Mxa9316...49409f: 100,000 MNT
Mxa9316...49409f: 100,000 MNT
|
| Status |
- Active - candidate is active and working
- Pending - candidate is active, but stake is too small to be included in validators
list
- Failed - candidate is missing blocks
- Offline - candidate is not active
|
| Missed blocks |
0..12 |


?WBBKsL
íiMTIMl
wm?.-
'
.W\
•??
Vaie-/
b
*****
j
'
‘^^'THE
NEV/yORK
BOTANICAL
GARDEN’
exploration
of
cuba
Province
of
Pinar
del
Rio
Rio
Guao
spli
F
J|
kajf
Q/rtsvoJic^
N.
L.
Britton
1
j
-
“•
}COLLECTORS
FEBRUARY
26.
27.
1911
New
York
Botanical
Garden
1616260
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


{{ navbar | safe }}
User ID:
Password:
{% if error %}
We could not find an account with those credentials, please try again.
{% endif %}
Create Account


HepG2 cytotoxicity assay
example_id1
Assay for cytotoxicity against human liver cancer cell line after 72 hour incubation and detection using Caspase-3 fluorometric assay
- purpose: cancer screen
- assay type: toxicity
- organism: Homo sapiens
- strain: HepG2
- detection method: fluroescence
- assay: Caspase-3 fluorometric
Drug incubation conditions
HepG2 cells, derived from human liver, were obtained at ATCC. HepG2 cells were cultured in DMEM media supplemented with 10% (v/v) fetal bovine serum and 0.2% (v/v) of a penicillin/streptomycin solution. Antibiotics were added to the medium to eliminate potential interference from microbial contamination that may be present on the test material and control samples. Cells were cultured at 37 °C and 5% CO2; complete medium was changed every 2 to 3 days. HepG2 cells (150,000 cells/well) were seeded in black view 96-well plates and exposed to the toxic agents for 72 h. A volume of 0.2 mL per well of diluted test compound in DMEM with FBS and penicillin/streptomycin was added to HepG2 cells cultured overnight in a 96-well plate (0 - 1 mM, final concentration of compound). In untreated cells, only complete medium was added. Following incubation with the compound, cells were washed twice with PBS. [NOTE: this is meant for illustrative purposes only]
- cell provider: ATCC
- incubation time: 72.0 h
- incubation temperature: 37.0 °C
- drug concentration: 0 - 1 mM
- protocol
Detection conditions
Detection was performed using the Caspase-3 fluorometric assay. All reactions were run in and the 1× assay buffer (20 mM HEPES [pH 7.4], 0.1% CHAPS, 5 mM DTT, and 2 mM EDTA). 50 µL of the 1× lysis buffer (50 mM HEPES [pH 7.4], 5 mM CHAPS, and 5 mM DTT) was added to the cells, and plates were incubated for 20 min at 4 °C in the orbital shaker at 350 rpm. To this, 150 µL of the reaction mixture (from 3 mL of the 1× reaction buffer and 5 µL of the Ac-DEVD-AMC substrate (10 mM in DMSO) was added, and plates were further incubated for 1 h in the dark. Fluorescence was measured at excitation 360 nm and emission 460 nm in the Gemini fluorometer every 10 minutes for 40-60 minutes (slit width 5 nm). For the positive controls, lyophilized caspase-3 was reconstituted in water to a concentration of 100 µg/mL; before use, it was diluted 1:200 in the 1× cell lysis buffer. [NOTE: this is meant for illustrative purposes only]
- assay provider: Sigma Aldrich
- fluorophore: Asp-7-amido-4-methylcoumarin (Ac-DEVD-AMC)
- fluorophore concentration: 12.5 µM
- λex: 357.5 - 362.5 nm
- λem: 457.5 - 462.5 nm
- fluorescence reader: Gemini EM Microplate Reader (Molecular Devices)
- protocol


A policy brief on the NGO GiveDirectly was just released today.
GiveDirectly is an NGO founded by two MIT Economics PhD students to provide
unconditional cash transfers (UCTs) to poor households in Kenya, in which they
give large lump sums of money (up to two years worth of income) with no
strings attached. Unconditional cash transfers have become one of the most
exciting opportunities and areas of research in development economics over the
past few years. GiveDirectly, one of the foremost UCT programs in the field,
has received somepress in the past year, and this marks the
first thorough study of GiveDirectly. I think the promising results of the
study hold exciting potential for a new paradigm of charity-giving for the
poor.
A few week ago, I happened upon the Wikipedia entry for Ötzi the
Iceman, Europe’s oldest natural human mummy that dates back to 3,300
BC. I was absolutely fascinated by the depth of analysis that researchers had
produced on this mummy. Scientists were able to determine Ötzi’s age, the
contents of his last two meals, his profession, his lifestyle, and even his
cause of death.
High levels of both copper particles and arsenic were found in Ötzi’s hair.
This, along with Ötzi’s copper axe which is 99.7% pure copper, has led
scientists to speculate that Ötzi was involved in copper smelting.
By examining the proportions of Ötzi’s tibia, femur and pelvis, Christopher
Ruff has determined that Ötzi’s lifestyle included long walks over hilly
terrain.
Question: What non-technical classes at Harvard should a technical major
really consider taking?
I’ll suggest a few classes, but I’m going to focus on proposing a framework for
thinking about what non-technical classes would be most valuable for you to
take as a technical major. After all, every person is unique and would enjoy
their own particular set of classes!
I see at least three distinct reasons why you would want to take
a non-technical class. But I’d like to focus on the first one, because
I believe it’s the most important one to spend time thinking about. If you
don’t read everything, at least read this first section.
A few months ago, my friend put forth an interesting question: What happens
to the number of last names over time? It is common to hear about a family
name dying with a last descendant who never had any children. That suggests
that it is possible that in the future, we will all have just one of a handful
of last names, as most of them will have died off. Yet, I would expect that if
it could happen, it should have happened by now, or at the very least, I would
be able to discern some kind of sign suggesting a trend toward fewer last
names. But the number and diversity of last names on Earth is quite
remarkable, and it’s still a uncommon thing for two unrelated people to meet
and have the same last name.
Anyway, in the spirit of curiosity, I decided to write a small Ruby script
that would simulate the progression of last names over many generations, just
to see what the end result might be. I had an enjoyable time exploring the
problem, and ended up with some interesting results.
A couple of weeks ago, a friend of mine introduced me to the amazing world of
littleBits. I had been taking an electrical
engineering course last semester, spending lots of time in lab playing with
circuits, so I was especially excited to see such an innovative product that
made it so easy for kids to explore the world of electronics and build their
own toys out of them!
littleBits is like LEGOs for electronics: they have a variety of different
electrical components that snap together with magnetics to create all sorts of
different circuits. For example, you could snap the power source component,
the knob component, and the LED component, and as you turn the knob, the LED
will turn dimmer and brighter. littleBits has already developed all sorts of
creative bits, as they call them, to create a wide variety of electronic
circuits, including motion sensor inputs to DC motor outputs. You can see all
of them here
Oftentimes when we having a conversation with a friend, and we are telling
a story about something that happened, we will refer to other people in the
story as “my friend,” “my other friend,” and so on, avoiding mentioning their
names. The logic is that it is probably better leave out the names, as they
would confuse the listener, who probably wouldn’t remember them anyway.
However, I’ve found that when I’m having a conversation with a good friend,
and we’re sharing a very personal story that is important to one of us, it
distances the listener when we avoid mentioning names, and instead continually
repeat a phrase like “my friend” or “my girlfriend” throughout the story.
In recent times, it seems that there has been continual negativity against
social media and social network-based entrepreneurship. They’ve been
continually criticized for adding minimal value to society and being
opportunistic. Other times, they’re viewed as young people who just want to
start a company for the sake of starting a company. Indeed, I agree that social
media and social network-based problems are not the most important issues that
our society faces today. I think that much of the criticism of the changed VC
landscape and the resulting short-termed thinking of investors is quite valid,
but I believe that the criticism sometimes goes a little far when it begins to
condemn the individuals who are starting these companies (which I’ll refer to
for the rest of this post as social media startups).
The primary criticism of social media startups is that they are not adding much
value to society or the economy, and that their talents, capital, and efforts
would be much better spent solving “real” problems like education, energy, or
our healthcare system. While this is certainly true, it’s also quite an unfair
criticism to make. Before giving any proper critique, one should always
consider the likely alternatives to the object of criticism — or else they
risk wasting their breath on something that can’t be easily changed or being
unfair by criticizing something that, although flawed, turns out to be the
better than most other options. I believe that most criticism of social media
startups fails to do the latter.
What makes someone a master of facilitating meetings?
When people teach others how to run effective meetings, they usually cover
specific meeting techniques that can be used. Here are some of the most
commons ones:
Allow everyone a chance to speak, and actively encourage reticent
participants.

Create a list of action items to follow up on after the meeting, with assigned
persons of responsibility and deadlines.
Implementing these techniques will undoubtedly make your meetings more
effective, but I feel that these recommendations miss the high-level skills
that are often more subtle to articulate. The actions above will help anyone
become competent at running meetings, but there is much more that is needed to
become a true master at meetings.
Briefly, I discuss two skills I believe are core to any outstanding
meeting facilitator. While my points may be less actionable than many of the
techniques you can find online, I believe they provide a valuable framework
for evaluating yourself as an effective leader during meetings. Self-awareness
is the first step to personal growth!
I’ve been spending more time exploring the biotechnology startup world lately,
and it’s quite interesting to see its many differences from the consumer web
startup world that I’ve become familiar with. In particular, I’ve noticed many
ways in which their executive teams differ in their structure and presentation
on websites.
In this post, I’m going to list some observations that I’ve made, and then give
some explanations that will hopefully account for these observations. I’ve
picked a few startup team pages that I’ll be basing my observations on.
Most .vimrc files that I’ve seen are quite long and unwieldy, often extending
to upwards of 300 lines of code. The .vimrc becomes a mess of code as it is
built up over the years, just a few lines at a time. Many people try to
resolve this issue by breaking the .vimrc down into sections, often with the
help of comments or fold markers. This makes it much easier to read, but it
isn’t a perfect solution. I still find myself having to scroll around the
.vimrc to find the line of I want to change or to find a place I can insert
a new line of vimscript.
There’s a much better solution for organizing the .vimrc, thanks to the
ability to source other vimscripts from within a vimscript. I’ve broken up my
own .vimrc file into 8 smaller files, and I include them into my main .vimrc
file by using the source function. Here’s what it looks like:
123456789101112131415161718
setnocompatiblebehave xtermfiletype plugin indent onsyntaxonsource $HOME/.vim/vimrc/filetypes.vimsource $HOME/.vim/vimrc/looks.vimsource $HOME/.vim/vimrc/mappings.vimsource $HOME/.vim/vimrc/misc.vimsource $HOME/.vim/vimrc/plugin_configs.vimsource $HOME/.vim/vimrc/plugins.vimsource $HOME/.vim/vimrc/settings.vimsource $HOME/.vim/vimrc/spelling.vim" Source a local vimrc if it existsif filereadable(expand("$HOME/.vimrc.local")) source $HOME/.vimrc.local
endif
Now each of my files are much smaller and easier to manage! It’s also quite
simple to navigate to each of these files. I’ve set up ; to open up
a tab with the .vimrc, and then I can use vim’s handy gf action to open up the
file given by the filename under the cursor. I’ve included a nice way to allow
for local .vimrc additions as well.


--- active_crumb: Embedded Probe layout: documentation id: embedded_probe fa_icon: fa-tools ---
Embedded probe allows to run data probe in the same JVM process as JVM-based client application.
Typically, data probes are launched in their own independent JVMs. However, when a client application is itself a JVM-based process, it is sometimes preferable for performance reasons to host a data model - and hence the data probe - in the same "client" JVM.
In a standard processing flow, when data probe (with its deployed data models) is hosted in its own independent JVM, the request from the client application takes 4 network hops to go server, then to the data probe and back to the client application (see fig 1. below):
When performing model unit testing or when client "application" can be combined with the data probe in a single JVM, the embedded probe mode provides significant performance advantage. Using embedded probe you can reduce number of network hops to 2 in a similar scenario - in which case the hop3 and hop4 (see fig. 1) are performed inside of JVM between client and embedded probe:
Embedded probe support consists of the following types in org.apache.nlpcraft.probe.embedded
package:
Here's Java code snippet from Alarm Clock example illustrating the usage of embedded probe together with NLPCraft test framework and JUnit 5:
public class AlarmTest { private NCTestClient cli; @BeforeEach void setUp() throws NCException, IOException { if (NCEmbeddedProbe.start(AlarmModel.class)) { cli = new NCTestClientBuilder().newBuilder().build(); cli.open("nlpcraft.alarm.ex"); } } @AfterEach void tearDown() throws NCException, IOException { if (cli != null) cli.close(); NCEmbeddedProbe.stop(); } @Test public void test() throws NCException, IOException { // Should be passed. assertTrue(cli.ask("Ping me in 3 minutes").isOk()); assertTrue(cli.ask("Buzz me in an hour and 15mins").isOk()); assertTrue(cli.ask("Set my alarm for 30s").isOk()); } }
NOTES:
It's important to note that there are number of inherent limitations associated with embedded probe:
Note that embedded probe is automatically used by the auto model validator.


My very first blog post was about setting up Octopress. The following is an updated version of those instructions for setting up Octopress with Windows, ruby 1.9.3, python 2.7.3.
This is quick guide to setting up Octopress to publish to GitHub pages. I’m using Windows 8 64-bit, but the instructions should work with other versions of Windows.
Get with GitHub
First, get an account on GitHub and follow the excellent instructions for Windows here. here.
Once you are set up with GitHub, get yari by opening a command prompt:
Then create a directory for all your github projects. You could put this anywhere, e.g., %USERPROFILE%\github
. I chose to create a directory C:\projects\github\
.
Installing Octopress
Use yari instead of RVM/rbenv
Scott Muc has written yari which lets you switch between Windows Ruby versions. Get it with the following command.
cd C:\projects\github\
git clone git://github.com/scottmuc/yari.git yari
Once this has completed you can setup the required Ruby environment with the command:
yari 1.9.3
Then follow the rest of the instructions from the Octopress setup instructions.
git clone git://github.com/imathis/octopress.git octopress
cd octopress
ruby --version # Should report Ruby 1.9.3 thanks to yari
Next install dependencies
gem install bundler
bundle install
Install the default Octopress theme.
rake install
Deploying to GitHub
The instructions are here. The only difficulty I had was working out which URL to use after:
rake setup_github_pages
This will ask you for your Github Pages repository url, but it is not clear that this is the SSH one, e.g., git@github.com:ZeroSharp/zerosharp.github.com.git
. You can find it near the top of the repository page.
Configuring your blog
Follow the instructions here to configure your blog.
Markdown
It is quite difficult to find good help on the markdown syntax other than for the codeblocks section. For instance, it is not clear how to generate a codeblock with no line numbers, like this one:
How do I output a codeblock with no line numbers?
It turns out it either requires a <pre>
tag instead of a { codeblock }
tag, or alternatively, start the line with four spaces. The official syntax is here, but I also found this cheat sheet.
Fonts and Styles
Problem with CodeBlocks
I had a problem with codeblocks which seems to be specific to Windows. It seems that whenever you include a lang
parameter in a codeblock
, you get:
Liquid error: No such file or directory - python2.7 -c “import sys; print sys.executable”
There are two issues:
- Syntax highlighting requires Python which is not automatically installed.
- There is a problem with pythonexec.rb which does not seem to support Windows Python installations very well.
Luckily we can fix them both. Install Python 2.7.3. Actually I used ninite.com to install it.
Then modify the pythonrubyexec.rb which is in the depths of the yari subdirectory. Try here: .\yari\ruby-1.9.3-p194-i386-mingw32\lib\ruby\gems\1.9.3\gems\rubypython-0.5.3\lib\rubypython\pythonexec.rb
At the top of pythonexec.rb, modify the file as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|


Class: Rack::RewindableInput
| Relationships & Source Files | |
| Namespace Children | |
|
Classes:
| |
| Inherits: | Object |
| Defined in: | lib/rack/rewindable_input.rb |
Overview
Class which can make any IO object rewindable, including non-rewindable ones. It does this by buffering the data into a tempfile, which is rewindable.
Don’t forget to call #close when you’re done. This frees up temporary resources that RewindableInput
uses, though it does not close the original IO object.
Class Method Summary
- .new(io) ⇒ RewindableInput constructor
Instance Attribute Summary
- #filesystem_has_posix_semantics? ⇒ Boolean readonly private
Instance Method Summary
-
#close
Closes this
RewindableInput
object without closing the originally wrapped IO object. - #each(&block)
- #gets
- #read(*args)
- #rewind
- #size
- #make_rewindable private
Constructor Details
.new(io) ⇒ RewindableInput
# File 'lib/rack/rewindable_input.rb', line 29
def initialize(io) @io = io @rewindable_io = nil @unlinked = false end
Instance Attribute Details
#filesystem_has_posix_semantics? ⇒ Boolean
(readonly, private)
[ GitHub ]
# File 'lib/rack/rewindable_input.rb', line 109
def filesystem_has_posix_semantics? RUBY_PLATFORM !~ /(mswin|mingw|cygwin|java)/ end
Instance Method Details
#close
Closes this RewindableInput
object without closing the originally wrapped IO object. Cleans up any temporary resources that this RewindableInput
has created.
This method may be called multiple times. It does nothing on subsequent calls.
# File 'lib/rack/rewindable_input.rb', line 65
def close if @rewindable_io if @unlinked @rewindable_io.close else @rewindable_io.close! end @rewindable_io = nil end end
#each(&block)
[ GitHub ]# File 'lib/rack/rewindable_input.rb', line 45
def each(&block) make_rewindable unless @rewindable_io @rewindable_io.each(&block) end
#gets
[ GitHub ]# File 'lib/rack/rewindable_input.rb', line 35
def gets make_rewindable unless @rewindable_io @rewindable_io.gets end
#make_rewindable (private)
[ GitHub ]# File 'lib/rack/rewindable_input.rb', line 78
def make_rewindable # Buffer all data into a tempfile. Since this tempfile is private to this # RewindableInput object, we chmod it so that nobody else can read or write # it. On POSIX filesystems we also unlink the file so that it doesn't # even have a file entry on the filesystem anymore, though we can still # access it because we have the file handle open. @rewindable_io = Tempfile.new('RackRewindableInput') @rewindable_io.chmod(0000) @rewindable_io.set_encoding(Encoding::BINARY) @rewindable_io.binmode # :nocov: if filesystem_has_posix_semantics? raise 'Unlink failed. IO closed.' if @rewindable_io.closed? @unlinked = true end # :nocov: buffer = "".dup while @io.read(1024 * 4, buffer) entire_buffer_written_out = false while !entire_buffer_written_out written = @rewindable_io.write(buffer) entire_buffer_written_out = written == buffer.bytesize if !entire_buffer_written_out buffer.slice!(0 .. written - 1) end end end @rewindable_io.rewind end
#read(*args)
[ GitHub ]# File 'lib/rack/rewindable_input.rb', line 40
def read(*args) make_rewindable unless @rewindable_io @rewindable_io.read(*args) end
#rewind
[ GitHub ]# File 'lib/rack/rewindable_input.rb', line 50
def rewind make_rewindable unless @rewindable_io @rewindable_io.rewind end
#size
[ GitHub ]# File 'lib/rack/rewindable_input.rb', line 55
def size make_rewindable unless @rewindable_io @rewindable_io.size end


FROM DR. WOMA LEE THE MANAGER FOREIGN REMITTANCE DEPARTMENT, AFRICA DEVELOPMENT BANK(ADB) BURKINA FASO. Dear Partner, (TOP SECRET) I am DR WOMA LEE, the manager in charge of auditing and accounting section of Africa Development Bank.AFRICA DEVELOPMENT BANK(ADB) Ouagadougou Burkina-faso West Africa ,with due respect and regard. I have decided to contact you on a business transaction that will be very beneficial to both of us at the end of the transaction . During our investigation and auditing in this bank, my department came across a very huge sum of money belonging to a deceased person Mr.Andreas Schranner who who died with his wife and their only daughter on July 2000 in a plane crash and the fund has been dormant in his account with this Bank without any claim of the fund in our custody either from his family or relation before our discovery to this development. The said amount was U.S $10.150M ((Ten million one hundred and fiftythousand US dolloars)). As it may interest you to know, I got your impressive information through internation search in Burkina-faso here in Ouagadougou Burkina-faso. Meanwhile all the whole arrangement to put claim over this fund as the bonafide next of kin to the deceased, get the required approval and transfer this money to a foreign account has been put in place and directives and needed information will be relayed to you as soon as you indicate your interest and willingness to assist me and also benefit your self to this great business opportunity. In fact I could have done this deal alone but because of my position in this country as a civil servant(A Banker),we are not allowed to operate a foreign account and would eventually raise an eye brow on my side during the time of transfer because I work in this bank. This is the actual reason why it will require a second party or fellow who will forward claims as the next of kin with affidavit of trust of oath to the Bank and also present a foreign account where he will need the money to be re-transferred into on his request as it may be after due verification and clarification by the correspondent branch of the bank where the whole money will be remitted from to your own designation bank account. I will not fail to inform you that this transaction is 100% risk free. On smooth conclusion of this transaction, you will be entitled to 40% of the total sum as gratification, while 60% will be for me. Please, you have been adviced to keep "top secret" as I am still in service and intend to retire from service after we conclude this deal with you. I will be monitoraing the whole situation here in this bank until you confirm the money in your account and ask me to come down to your country for subsequent sharing of the fund according to percentages previously indicated and further investment, either in your country or any country you advice us to invest in. All other necessary information will be sent to you when I hear from you. Trusting to hear from you. you can contact me through this number(226 76440063). You can visit the sit http://news.bbc.co.uk/1/hi/world/europe/859479.stm Yours faithfully, DR. WOMA LEE. _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/