Tuesday, June 19, 2012

Runtime Expression Editor: It’s Magic, You Know!

Last month, I was singing “Oh, oh, oh it’s Magic, you know! Never believe it’s not so!” with 250 of my colleagues in Jaffa, one of the oldest port cities in the world. Why?

Because it is Magic! When I first got involved with the Magic Application Platform twelve years ago there was a lot of talk in the industry about rules engines, business rules editors, and the like. Today, you’re more likely to hear people discuss cloud computing or service-oriented architecture than business rules engines. But one of the features that puts the “Magic” in the Magic xpa Application Platform is the Runtime Expression Editor. One of the reasons Magic employees believe so passionately in the solutions we bring to market is because we know that the productivity features offered are unparalleled. The Runtime Expression Editor is a great example of how our smarter technology works to help accelerate business performance.
When running an application of the Magic xpa Application Platform, the end user can “zoom in” on a range field by pressing the F5 function key, for example. This will reveal the expression that is being used to determine what is being displayed in the view for that range field. Using the pulldown and context menus an end user can edit the expression on the fly. The Runtime Expression Editor can use numeric, string, “basic,” date & time, and variable functions (see the partial lists below from the Magic xpi reference documentation).

If an end user tries to use functions that are not in one of the groups mentioned above, a message appears: “Function not allowed for use in expression.”

Not every end user will have the aptitude needed to use the runtime expression editor.  However, more advanced users who want to be able to adjust business rules at runtime in order to view different results will find this a very powerful feature. Instead of rewriting the application, the business rule can be modified at runtime allowing for various kinds of what-if analysis. This takes the burden off of programming teams and gives power users the ability to work their Magic. After all "it's Magic, you know!"

Partial List of Functions Available in the Runtime Expression Editor

Numeric Functions

Multiplication Operator
Addition Operator
Subtraction Operator
Division Operator
Exponentiation Operator
ABS – Returns the absolute value of a real number, without regard to sign.
ACOS – Returns the arc cosine value of a number, in radians.
ASIN – Returns the trigonometric arc sine of a number, in radians.
ATAN – Returns the arc tangent of a number, in radians.
ChkDgt – Generates a check digit.
COS – Returns the cosine of an angle, where the angle is expressed in radians.
EXP – Calculates the exponential value of x.
Fix – Extracts a specified part of a number, real or integer.
HStr – Returns the hexadecimal (base 16) value of a decimal (base 10) number.
LOG – Returns the natural logarithm of a number.
MAX – Returns the greatest value from a group of values with the same attributes.
MIN – Returns the smallest of a group of values with the same attribute.
MOD – Returns the remainder of an integer division.
MStr – Converts a number to a Magic number with a specified length in bytes.
RAND – Generates random numbers.
Range – Checks whether a number falls within a range, and returns a Boolean true or false.
Round – Extracts a specified part of a number and rounds the result.
SIN – Returns the sine of an angle, where the angle is expressed in radians.
Str – Converts a number to an alpha string, according to a picture.
TAN – Returns the tangent of an angle, where the angle is expressed in radians.


String Functions
& – Concatenates Alpha strings.
ANSI2OEM – Converts data from ANSI to OEM.
ASCIIChr – Converts a number to a corresponding character in the ASCII character set.
ASCIIVal – ASCII value of a string character.
AStr – Applies a selected format to a string value.
CRC – Calculates redundancy check.
Del – Deletes characters from a string.
DStr – Converts a date or a date expression to a character string.
Fill – Repeats a string.
Flip – Inverts a string.
HVal – Returns the decimal (base 10) value of a hexadecimal (base 16) number.
Ins – Inserts a string in another string.
InStr – Searches for the first occurrence of a string in another string.
Left – Extracts a substring from the left.
Len – Returns the defined length of an Alpha string.
Logical – Converts a visual representation to a logical representation.
Lower – Returns a string in lowercase.
LTrim – Removes leading blanks.
MID – Extracts a substring.
MlsTrans – Returns the translation of a string.
mTVal – Converts a time value in milliseconds from an Alpha string to a numeric value.
MVal – Converts a Magic xpa number (with a specified length in bytes) to a number.
OEM2ANSI – Converts data from OEM to ANSI.
Rep – Replaces a substring within a string.
RepStr – Replaces all occurrences of a defined substring with another substring in a given source string.
Right – Extracts a substring from the right.
RTrim – Removes trailing blanks.
SoundX – Compares homonyms.
StrBuild – Replaces placeholders in a template string with string values.
StrToken – Returns a token from a delimited string.
StrTokenCnt – Returns the number of existing delimited tokens in a given string.
StrTokenIdx – Returns the token index in a delimited Alpha string.
Translate – Translates all logical names and nested logical names to their actual values.
TranslateNR – Translates all logical names, including nested logical names, in a string to their actual values.
Trim – Removes leading and trailing blanks.
TVal – Converts a time value stored as an Alpha character string to a numeric value.
UnicodeChr – Converts a numeric value to its corresponding Unicode character.
UnicodeFromANSI – Converts an ANSI string to Unicode characters as determined by the selected code page.
UnicodeToANSI – Converts a Unicode string to ANSI characters according to a selected code page.
UnicodeVal – Converts a Unicode character to its corresponding numeric value.
Upper – Returns a string in uppercase.
Val – Converts an Alpha character to a number.
Visual – Converts a logical representation to a Visual representation.

Date and Time Functions

AddDate – Performs calculation on date.
AddDateTime – Calculates the difference between two Datetime values Adds a time interval to a Datetime value, which is represented by Magic xpa Date and Time fields. The specified amount of years, months, days, hours, minutes, and seconds are added to the current value of Date & Time, and stored back into those two variables.
AddTime – Performs calculations on a time variable.
BOM – Returns start date of month specified.
BOY – Returns end date of year specified.
CDOW – Name of the day (e.g. Sunday) from date.
CMonth – Name of the month (e.g. January) from date.
Date – System date.
Day – Day of month (1-31) from date.
DifDateTime – Calculate the difference between two Datetime values.
DOW – Number of the day of the week (1-7) from date.
DStr – Date-to-string conversion.
DVal – String-to-date conversion.
EOM – Returns date of end of month specified.
EOY – Returns date of end of year specified.
Hour – Returns the hour portion of the time value.
MDate – Returns the Magic xpa date as input in logon screen.
Minute – Returns the minute portion of the time value.
Month – Returns the month portion of a date.
mTime – Retrieves the time value in milliseconds from midnight to the current time.
mTStr – Converts a time value in milliseconds to a specified Alpha string picture format.
NDOW – Converts the number of the day to the name of the day.
NMonth – Converts the number of the month to the name of the month.
Second – Returns the second portion of the time value.
Time – Returns the system time.
TStr – Converts the time value to an Alpha string.
TVal - Converts a time value stored as an Alpha character string to a numeric value, according to a picture.
Year – Returns the year of a date.

Variable Functions

CaretPosGet – Returns the current caret position in the Edit control.
DataViewToDNDataTable – Generates a .NET DataTable object from the current data view.
DataViewToHTML – Creates an HTML file from the data view variables sent to it.
DataViewToText – Creates a text file from the data view variables sent to it.
DataViewToXML – Creates an XML file from the data view variables sent to it.
DataViewVars – Fetches the variables displayed on the form from where the Print Data event was raised.
EditGet – Retrieves the control value in the edit mode.
EditSet – Sets the edited value of the control that invoked the last handler.
GetComponentName – Fetches the name of the current component.
GetGUID – Fetches the GUID of the application.
IsDefault – Tests if the value of a variable is equal to its default value.
ISNULL – Checks for the existence of a NULL value in a variable.
MarkedTextGet – Returns marked text.
MarkedTextSet – Replaces the marked text with a specified string.
MarkText – Marks the specified number of characters starting from a defined start position.
All Var functions use pointers to variables in memory. Each variable in the memory has a unique number according to the runtime tree. For example, if program A calls Program B, and in Program A there are 3 variables and in B there are 2, then Variable A in program A receives the number 1 in Runtime and variable A in program B receives the number 4. The Var functions allow you to get information about dynamic variables.
VarAttr – Returns a column’s attribute.
VarCurr – Retrieves the variable identifier.
VarCurrN – Returns the current value of a variable according to the variable’s name.
VarDbName – Queries a selected data view to retrieve the physical definition of each variable.
VarIndex – Returns the index of a variable according to the variable’s name.
VarInp – Identifies the last variable where the input has occurred.
VarMod – Variable modification check.
VarName – Provides a variable’s origin and description.
VarPic – Returns a string value that represents the picture of the selected field.
VarPrev – Retrieves the original value of a variable, based on a dynamic value representing a variable index within the Variable list.

Monday, June 11, 2012

What is Version control? Version Control (definition)

Version Control: Version control is the approach and methods taken to maintaining access, controlling histories, and recording instances of a software program during its development lifecycle. A version control system is a set of automated tools and approaches designed to manage and track source code for an application. Synonyms for version control system include revision control system and source code control system.

The Magic xpi Application Platform is designed to support enterprise-class version control features from within the Magic xpi Studio when you have a third-party version control product installed that complies with the Source Code Control (SCC) API V1.01. But it isn’t necessary to spend a lot of money on a version control system in order to access quality version control features from inside the Magic xpi Studio. Popular systems that provide this capability include Visual SourceSafe and PVCS. This open approach allows you to work collaboratively, track and access changes to your project, maintain version histories, compare differences, check-in and check out your work as part of a team of developers, and so on.

Version Control is advantageous in all types of programming projects and provides numerous advantages in the governance of a software development project.

Versioning. With version control features you can save versions of your project and access any of the versions at a later date. This is helpful when you want to work in a multi-developer environment. You can also use the Version Control feature as a single developer to keep track and have access to the project's versions.

Project Integrity. Version control allows you to protect your files. With version control features, you first have to check out your files before you can edit them. This protects the source files from being overwritten by another user.

Developer Collaboration.  Version control simplifies team development approaches, reduces communication overhead and eliminates much confusion. Because each developer works on their own copy of the project's source files and is responsible for synchronizing their own copy with the centrally-located version, the team is able to work in parallel and with efficiency.

Analyze Changes. Version control features allow you to analyze changes to your development project over time. You can track changes by comparing different versions of the project and you can trace which developer has made changes to a particular version. This is especially useful for evaluating progress on the project, debugging, and even rolling back versions if needed. 

Developing with an Application Platform that Supports SNMP

 Many developers are looking for a smarter way to build applications that utilize the SNMP protocol. The Magic xpa Application Platform supports Simple Network Management Protocol (SNMP) and works with Microsoft Windows SNMP Agent, the Net-SNMP Agent in UNIX environments, and the Native SNMP Agent for IBM i (System i/iSeries/AS400). SNMP is a standard in the application layer of the Internet protocol suite for management of various nodes on an IP network. SNMP enables network administrators to manage network performance, find and solve network problems, and plan for network growth. For developers, SNMP is the standard that you can use to communicate with application monitoring and other monitoring tools. The SNMP architectural model involves a set of network management stations and network elements. The purpose of the network management stations is to host management applications that control and monitor network elements. The network elements are devices that serve as gateways, hosts, terminal servers, etc. These various network elements have management agents that execute management functions requested by the network management stations. SNMP, as a protocol, includes the message format used to communicate between the stations and the elements. In general, application monitoring can be applied for any of these five broad requirements: 

Fault The most obvious use of application monitoring is to detect faults which can be major errors related to one or more elements within the architecture. The Magic xpa Application Platform can be configured to send only specific error codes to the monitor, or the entire range of errors. Normally, you would want to report only significant error conditions that affect the operational integrity of the application or quality of the users' application experience.

Performance External monitors may want to track application performance. Performance monitoring is useful in detecting sub-optimal software performance, as measured by average wait time, number of pending requests, number of currently processing requests, and so on. Performance problems usually correlate to increased user requests. When the load outstrips the ability of the application and systems to perform the required function within expected response times, a degraded quality of user experience occurs. Application monitoring can provide us with useful metrics for performance optimization related to both applications and the network itself. 

Security You may want to employ SNMP for certain types of security monitoring such as authentication failures. 

Configuration By monitoring certain configuration settings, you can ensure that key configuration variables affecting application performance and stability stay within specified limits. For example, if the Maximum Connection property is set to 10 for a specified DBMS and the SNMP Database Connections Utilization Threshold is set to 50, the Magic xpa Application Platform sends a trap message to the Network Management Station (NMS) when 5 connections (50% of 10) to the DBMS have been opened. 

Accounting Another application for application monitoring is accounting, for administration of things like usage fees and maintenance fees. SNMP is used when a third party application tracking these fees utilizes SNMP to monitor the activity to be accounted for. Since the Magic xpa Application Platform can easily track these elements within the application itself or through another Magic xpa application, SNMP is only likely to be used in rare instances where an enterprise wide IT policy has introduced SNMP as an accounting standard, especially in environments where there is a mix of Magic and non-Magic applications being accounted for. 

Application monitoring via SNMP can be implemented using applications such as IBM Tivoli. For example, IBM Tivoli Business Application Management (BAM) products help ensure the availability and performance of your business-critical applications, including portal and Service Oriented Architecture (SOA)-based technologies. SNMP is just one of the hundreds of incorporated technologies in the Magic xpa Application Platform that make it a highly open environment for developing and deploying applications. As you take advantage of these open standards, you are doing so in a way that leverages metadata rather than requiring you to program for the details of the SNMP protocol directly. This gives you the interoperability, forward-migration and service-oriented characteristics you need to build applications that are future-proof.

“Big Data” Definition for Business Computing

Big Data, n. (computer technology) any complex dataset that includes large amounts of dynamic, growing, unstructured data where relationships between data are frequently inferred rather than declared.

If you ask Gartner, big data is best understood by the 3 V’s: volume, velocity and variety. And the Mike 3.0 open source project seemingly tries to confuse everyone by stating that: “Big data can be very small and not all large datasets are big.” In my most recent glance at Wikipedia, Big Data was simply defined as any dataset that is “beyond the ability of commonly used software tools to capture, manage, and process the data within a tolerable elapsed time.” Like so many buzzwords introduced into the technology dialogue, Big Data is a marketing term. If you have any doubt just look at what Oracle is saying. According to Oracle, Big Data is just unstructured metadata lying around your business that you can analyze, organize and utilize to create business benefit.
Selling Big Data to business is going to be a marketing trend that continues for awhile. When reduced to the common commercial messages, the reality is that most Big Data solutions are really solutions for dealing with large amounts of unstructured data.
I propose that a more useful construct than the 3 V’s exists to help define the characteristics of Big Data: structured vs. unstructured, defined relationships vs. inferred relationships, static vs. dynamic, and stable vs. growing. In each case, the second term in the pair is more characteristic of Big Data, but that is not to say that Big Data does not encompass some data at both ends of the spectrum.
If you look at a dataset such as the combined real estate multiple listing databases in the United States, for example, you have a truly complex set of Big Data. At any given time, there are about 2 million real estate listings in the US. Something like 85% of these listings are being updated every fifteen minutes (that’s 6.8 million updates per hour). 85% of all those listings are served up by an application running on the Magic xpa Application Platform. That’s something like 5.5 million updates per hour or more than 1500 updates per second. Why so many updates? Because of the complex interrelationships of data in a real estate multiple listing. It’s not that the seller is changing the price every fifteen minutes or the agent is changing the advertising description of the property. But the record is related to all sorts of interrelated data and metadata as well as community data and averages that are constantly changing.
In-memory computing and data grid computing provide an interesting means for dealing with Big Data. The paradigm shift of using memory as storage allows you to access data randomly with near zero latency as opposed to sequential disk access methods which require sequential access for optimal reduction in latency. As more and more enterprise and cloud architectures incorporate in-memory computing the currently accepted definition of Big Data then becomes problematic. If Big Data only includes datasets that are “beyond the ability of commonly used software tools” then the bar for the Big Data definition is raised by the eventual proliferation of in-memory approaches. I like the fact that the Big Data buzzword focuses attention on the problems associated with the proliferation and increasing complexity of data. I am not convinced, however, that the commonly accepted definitions are useful. Big Data is any complex dataset that includes large amounts of dynamic, growing, unstructured data where relationships between data are frequently inferred rather than declared.