Stephen Smith's Blog

Musings on Machine Learning…

Archive for March 2013

Sage 300 ERP – Only Activate What You Need

with 12 comments

Introduction

As we continue to move Sage 300 ERP to the Azure Cloud, one question that gets asked is whether someone just running G/L, A/P and A/R (the Glapar which rhymes with clapper) is going to be negatively affected by the presence of say I/C, O/E and P/O? Fortunately, Sage 300 ERP activates each module independently and unless an accounting module is activated in the database, you don’t see it at all, it’s just as if you hadn’t installed it.

With per user pricing we’ve tended to bundle quite large number of modules under our various pricing schemes. However if you get such a bundle and then activate everything you have, you could enable quite a few fields and icons that clutter things up, which is a nuisance if you never use them. Generally business flows better if you only see icons and fields that you actually use. Why keep seeing currency rate fields when you never select a different currency? Why see selections for things like lots and serial numbers when you don’t use these? Why see project and job costing icons when you don’t use this module?

Using security and the built in form customization abilities can be used to hide complexity as well. However if the feature is enabled, it usually implies that someone in your organization is going to have to deal with it. So consider these in addition to setting up security and setting up customizations for your users.

In this article, I’m going to go through the process of activating applications and provide some behind the scenes info on the various processes around these issues. A slightly related article is my posting on Sage 300’s multi-version support.

Installation

To access a module, it first has to be installed. Generally from the installation DVD image, you can select (or de-select) most modules. There are some dependencies, so if you install Purchase Orders then that implies you need a number of other accounting modules to be installed as well. Each accounting module gets its own folder under the Sage 300 installation folders. These are formed by a two character prefix like GL or PO followed by a three letter version like 61A (not the year based display version). Generally all accounting applications are created equally and the Sage 300 System Manager becomes aware of them by the presence of these folders and then gathers information on the application by looking for standard files stored in these folders (like the roto and group files).

Activation

When you create a new company in Sage 300, the only applications that are there by default are Administrative Services and Common Services. Below is the data activation screen:

activate

This program lets you choose which applications to activate into the database from the list of all installed accounting modules. When you select a given module, you may need to specify a few extra parameters in the next screen. The program will also tell you about any dependencies that are required and select these for you. Then when it goes to activate the programs it call the activation object in each selected application to let the application do whatever is required to add it to the system. This usually involves creating all the database tables for the application along with seeding any data that is setup automatically (like perhaps a default options record). If you are upgrading to a new version it will do whatever is required to convert the data from the old version to the new.

You can run this program as many times as you like, so if you don’t activate something, you can always come back later and activate it then. Just keep in mind that after you activate something, you can’t de-activate it. We do put up a fairly strong message to ensure you back up your database before running data activation. Not all database conversions can be transactioned, so if data activation does fail, you may need to start over from a backup, though often you can fix the problem and run activation again to finish.

For our hosted versions, you don’t need to install anything and you don’t actually see the data activation screen, you select what you want from a web site and then the database is provisioned for you. For the on-premise version, installation and activation is usually performed by the business partner.

If you just activate General Ledger, then you will only see General Ledger on the desktop and won’t see icons from anything else that is installed.

onlygl

Also notice that “Create Revaluation Batch” isn’t shown because I haven’t enabled multi-currency for this database.

Other Separate Features

Some modules like multi-currency, serialized inventory, lot tracking and optional fields aren’t installed via data activation. The database support for these modules is always present. To be able to use these you need to install the license for the module and then you can enable the functionality within the other applications. For instance to turn on multicurrency you need to enable this in the Company Profile screen in Common Services.

Until you do this, all the fields, functions and icons for these will be hidden and won’t clutter up your desktop or entry forms. So if you don’t really need these, then don’t turn them on. Also keep in mind that once you enable these features, you can’t turn them off again, they are turned on permanently.

Sample Data

In one regard Sample Data is a bad example, since it has everything possible activated and enabled. Since it comes this way, applications will be activated even if they aren’t installed. This sometimes causes funny problems because some functions that communicate between modules won’t work in this case.

Sample data is a great way to show any feature in Sage 300 ERP, but in one regard it’s rather misleading. It tends to always be run as the ADMIN user and hence always shows all possible icons, fields, and functions. This tends to make the product look much more complicated that it really is in real world usage. In the real world, you wouldn’t activate things you don’t need and in the real world the user wouldn’t have security access to everything so again many things would be hidden and their workspace simplified.

Deactivation

We don’t normally allow deactivating an application or turning off a feature like multi-currency. The reason is that data integrity problems could theoretically occur if you do, since for instance if you have processed payroll checks, then bank would need payroll present to reconcile those checks and if you deactivate payroll while there are un-cleared checks in bank, then you will never be able to reconcile these checks. There are many cases like this so as a general good practice protection we prevent de-activation.

But the developers in the audience will know there is a back door. In the Sage 300 ERP SDK there is a “Deactivate” program that will deactivate an activated application. It does this by dropping all the tables for the application from the database and removing its entry from CSAPP. It does not do any cleanup of data that might be in any other accounting application’s tables. This is a great tool while developing a vertical accounting module for Sage 300, but if you use this on an production system, really be confident that the offending application hasn’t been used and you aren’t going to leave corrupted data in all the other modules as a result of removing this one. Again backup before proceeding. Similarly turning off things like multi-currency by editing the CSCOM table in SQL Enterprise Manager has the same caveats.

Summary

Generally you want to keep your accounting system as simple as possible. Modular ERP systems like Sage 300 ERP have a great breadth of functionality, but most companies only need a subset of that, which is relevant for their industry. So be careful to only select what you need and keep your system a little simpler and easier to use.

 

Advertisements

Written by smist08

March 29, 2013 at 6:35 pm

My First Experience Writing an iPad App

with 2 comments

Introduction

To get a feel for iOS programming I thought I would create a simple iOS application to display a Koch snowflake. There would be a simple edit box where you enter the fractal level and then it will draw the snowflake. I thought this would be a good example to get a feel for the XCode development environment, simple user interaction with controls and a flavor for some graphics programming.

Two jobs before I started with Computer Associates to work on CA-Accpac/2000, I worked for a company that created stock market software. They were working on a new workstation version for the NeXT computer. So with that company (over 20 years ago), I gathered good experience in this environment. We programmed in Objective-C and used the innovative NeXTStep development environment which had many neat features like using DisplayPostScript for rending on-screen graphics.

Now so many years later, here I am programming iOS and relearning Objective C. Although Apple has had many battles with Adobe over the years resulting in display postscript never being mentioned, I still see it there in how you do things. Since I’m newly relearning all this stuff and there have been many changes in the past 25 years, don’t take everything I say as the best way to do things, they are the way I first figured out how to do things for this simple project. Especially if you can do something visually in XCode versus writing code, I probably wrote code because that’s what I’m most comfortable with.

XCode

XCode is Apple’s IDE for doing both native Mac OS and IOs development. XCode is a very rich development environment with many built in tools for things like unit testing, debugging, screen designing and such. It has built in support for the Git source code control system, which is used by default for all projects. There is much built in documentation and help, as well as emulators to test and debug your iPad and iPhone applications. The main requirement of XCode is that it runs on MacOS. Hence I have to run it on my trusty MacBook Air.

XCode has a great many productivity helpers like auto-complete and many way to graphically create your programs rather than coding them. The thing that gave me the most trouble was the graphical part, I’m fine with writing code, but graphically connecting things wasn’t as intuitive to me as I would have expected.

xcode

Koch Snowflakes

Koch snowflakes are simple fractals that are a good way to give an idea of how fractals can build complexity out of simplicity. Basically you start with a base shape, in this case a triangle, then you replace each line segment with a new shape, in this case the two lines with a “v” in the middle. Then you do this recursively to get more and more complicated shapes. Below is the progression from level 0, the base shape to level 1, with the base shape lines replaced by the fractal generator and then so on as the level increases.

koch-snowflake-progression

This is a fractal because in the limit as the level goes to infinity, the shape has a fractal dimension, in that it is somewhere between 1 dimensional and 2 dimensional in a defined mathematical sense.

Turtle Graphics

To me the easiest way to draw fractals is with a turtle graphics library. This is a simple drawing library where you tell a turtle to either turn or move forwards. As he moves he leaves a trail. Hence the base shape for the Koch snowflake is forward 1, turn 60, forward 1, turn -120, forward 1, turn 60 forward 1. This is then really easy to apply recursively to draw fractals.

Objective C

Objective-C was one of the first object oriented extensions to C. It was implemented as a pre-processor that generated C code which was then compiled using regular C development tools. This greatly simplified implementation, but the syntax reflects that it was designed to be easily processed by a preprocessor. It’s certainly evolved since its early days, but is perhaps considered a bit clunky as a result. Objective-C has all the object oriented features like inheritance and classes, but lacks a lot of the complexity of C++. The object oriented features are more similar to Java, but unlike Java, Objective-C still has all of C under it, meaning all the pointers and pointer related features that Java removed; hence you can easily crash your iOS app if you make pointer mistakes like in a C program.

Both Java and C++ overloaded the pointer syntax to call methods and such making them behave like function pointers in a structure. Objective C tried for a syntax to reflect message passing using their square bracket syntax of [object method] to send a message to an object. See the source code listings below for some examples. Recently Objective C has adopted the pointer type syntax as an option but considers it good coding practice to only use this for accessing class properties.

My iPad App

When you create a new project in XCode you get a complete working program and then only have to fill in your own code for your functionality. I edited the iPad storyboard to have a single page consisting of a label and text field for the fractal level and then a view to draw the image on. I created a couple of classes, one for turtle graphics, another to draw the fractal and then one to act as the interface to the UI form. All in all, not a lot of code and it seems to run fairly well. I placed the source code listings at the end so as not to clutter up this article. Beware that WordPress often changes characters for typographic reason, things like regular double quotes to 66 or 99 type quotes, this tends to introduce syntax errors if you cut and paste the code, so beware.

Storyboards are a relatively new feature to XCode, they allow you to define many screens within a single file and to connect them all together, so a button on one screen can trigger a transition to another screen, all setup graphically with no code. This is a great tool for quickly prototyping applications, but since for this app, I only have one screen it isn’t really used.

To connect the controls in the storyboard to the code, you create matching variables in the generated interface file and then drag an arrow from a small o in the margin to the matching control in the storyboard file (a process I find a bit cumbersome). Then you can ask for notifications and set properties for the various controls. You can see a couple of examples in the interface file below.

With any object oriented framework like Cocoa Touch there is quite a steep learning curve. Not only do you need to find the properties and methods to call to do things for you, but you also need to learn when you have to extend one of the system base classes. In the case of drawing the fractal, it’s a matter of putting a view control on the page, but then you need to extend the default class to override its drawRect method that is called whenever the view need redrawing. This is similar to handling a WM_PAINT message in Windows. Again you can have a look at the code down below.

Below are a couple of screen grabs of running this iPad app in the iPad emulator on my MacBook Air:

level2

 

level4

Summary

Sadly you can’t just post and distribute iPad apps, but have to go through the Apple iTunes store. I’m not going to bother posting this app, so you can’t play with it. I do like being able to post source and app to let people just run it, but Apple doesn’t allow this.

Creating this app was fun. XCode is quite a good development environment and they make it easy to write code quickly. iOS is a very full featured operating system with many built in services and a great deal of power. This are tons of books and internet articles on iOS development along with all the Apple documentations. Now to dig in a bit deeper to what you can do.

Source Code Listings

//
//  csFractal.m

//  Fractal1
//
//  Created by Stephen Smith on 2013-03-05.
//  Copyright (c) 2013 Stephen Smith. All rights reserved.
//

#import "csFractal.h"
#import "csTurtleGraphics.h"

@implementation csFractal
{
    csTurtleGraphics *tg;
    CGContextRef context;
}

- (id)initWithContext: (CGContextRef) inContext
{
    self = [super init];
    if (self)
    {
        context = inContext;
        tg = [[csTurtleGraphics alloc] initWithContext:context];
    }
    return self;
}

- (void) KockSnowflake:(int)level
{
    [tg turn: 60];
    [self KockSnowflakeSide: level size: 500];
    [tg turn: -120];
    [self KockSnowflakeSide: level size: 500];
    [tg turn: -120];
    [self KockSnowflakeSide: level size: 500];
}

- (void) KockSnowflakeSide: (int)level size:(double) size
{
    if (level == 0)
    {
        [tg move: size];
    }
    else
    {
        [self KockSnowflakeSide: level-1 size: size/3];
        [tg turn: 60];
        [self KockSnowflakeSide: level-1 size: size/3];
        [tg turn: -120];
        [self KockSnowflakeSide: level-1 size: size/3];
        [tg turn:60];
        [self KockSnowflakeSide: level-1 size: size/3];
    }
}

@end

//
//  csTurtleGraphics.m
//  Fractal1
//
//  Created by Stephen Smith on 2013-02-23.
//  Copyright (c) 2013 Stephen Smith. All rights reserved.
//

#import "csTurtleGraphics.h"

const double pi = 3.14159;

@implementation csTurtleGraphics
{
    double x, y;
    double angle;
    CGContextRef    context;
}

- (id)initWithContext: (CGContextRef) inContext
{
    self = [super init];
    if (self)
    {
        context = inContext;
        x = 50.0;
        y = 150.0;
        CGContextMoveToPoint(context, x, y);

        angle = 0.0;
    }
    return self;
}

- (void)move:(int) dist
{
    x = x + dist * cos( angle * pi/ 180.0);
    y = y + dist * sin( angle * pi/ 180.0);
    CGContextAddLineToPoint(context, x, y);

}

- (void) turn: (int) angleIncrement
{
    angle = angle +angleIncrement;
}
@end

//
//  csViewController.m
//  Fractal1
//
//  Created by Stephen Smith on 2013-02-10.
//  Copyright (c) 2013 Stephen Smith. All rights reserved.
//

#import "csViewController.h"

@implementation csViewController

@synthesize textField;
@synthesize fracView;

- (void)viewDidLoad
{
    [super viewDidLoad];
                // Do any additional setup after loading the view, typically from a nib.
    textField.text = @"2";
    [fracView setLevel: 2];

    [[NSNotificationCenter defaultCenter]
        addObserver:self
        selector:@selector(textChangeNot:)
        name:UITextFieldTextDidChangeNotification
        object:textField];

}

- (void) textChangeNot: (id) object
{
    [fracView setLevel: textField.text.intValue];
    [fracView setNeedsDisplay];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

//
//  csFractalView.m
//  Fractal1
//
//  Created by Stephen Smith on 2013-02-17.
//  Copyright (c) 2013 Stephen Smith. All rights reserved.
//

#import "csFractalView.h"
#import "csFractal.h"

@implementation csFractalView
{
    csFractal *frac;
    int level;
}
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        level = 1;
    }
    return self;
}

- (void) setLevel: (int)lev
{
    level = lev;
}

// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code

    UIColor* currentColor = [UIColor blackColor];
    CGContextRef    context = UIGraphicsGetCurrentContext();

    //Set the width of the "pen" that will be used for drawing
    CGContextSetLineWidth(context,1);
    //Set the color of the pen to be used
    CGContextSetStrokeColorWithColor(context, currentColor.CGColor);

    frac = [[csFractal alloc] initWithContext: context];
    [frac KockSnowflake: level];

    //Apply our stroke settings to the line.
    CGContextStrokePath(context);
}

@end

Written by smist08

March 16, 2013 at 4:59 pm

The Singularity

with 3 comments

Introduction

In last week’s blog post, one of the topics covered was an exercise in predicting what things will be like in ten years. We didn’t discuss any negative impacts of technology like environmental collapse due to gross consumerism. The other thing that wasn’t discussed was the prospect of the so call technological singularity occurring in the next ten years. The singularity is defined as the point at which computers (or networks of computers) become self-aware and exceed human intelligence.

This has been a popular topic in Science Fiction for some time. Interestingly the term is often attributed to John von Neumann who spoke of “ever accelerating progress of technology and changes in the mode of human life, which gives the appearance of approaching some essential singularity in the history of the race beyond which human affairs, as we know them, could not continue.”

We’ve all felt how change has been accelerating. As change gets faster and faster, predicting the future becomes harder and harder. The idea behind the singularity is that you cannot predict what will happen on the other side of it. Basically as computers/networks become self-aware and more intelligent than us, then things will start to change so quickly that all our predictions will be out the door.

I think this could happen in the next ten years, there are many projections like the following chart that give good evidence that we should reach the prerequisite level of complexity between 2020 and 2040.

ss08_exponential_growth_large

Webmind

Robert J. Sawyer, the popular Canadian Science Fiction writer has an excellent trilogy of books, his WWW series consisting of Wake, Watch and Wonder which follow a scenario where the Internet becomes alive. This series is certainly a very positive view of this happening and I highly recommend reading this series (disclaimer: I haven’t read the third one yet).

I really like how Sawyer used cellular automata like the Game of Life as the model for how intelligence could emerge from the current internet. I tend to think this is thinking along the right track.

Verner Vinge

Mathematician and Science Fiction writer Verner Vinge wrote a very influential essay on the singularity here. A lot of ideas from the essay are woven into his Science Fiction novels like “A Fire Upon the Deep” or “Rainbow’s End”. I greatly enjoy Verner’s novels and highly recommend them.

Google

In fact companies like Google are actively working to make the singularity happen. Both Google founders Larry Page and Sergey Brin are driving projects within Google to achieve self-awareness and intelligence in the Google data centers. In fact both put in a lot of personal money to found the Singularity University.

You have to think that the company bringing self-driving cars to market, having personal concierge software like Google Now and with their giant data centers and huge resources are well positioned to bring the Singularity to life (or have they already done it?).

The Negative

Of course there are many Science Fiction works which portray a very negative vision of this happening. In particular the emergence of Skynet in the Terminator series, the enslavement of people as power generators in the Matrix series, as well as Hal in 2001. Generally these set up quite good action movies, but I’m not really sure the types of wars envisioned here are too likely. I tend to think that most negative outcomes for the future would be caused by our own doing, whether war or environmental collapse.

Accuracy of Predictions

Predicting the future has always been very inaccurate. We always predict things will happen much faster than they do. Putting years in novels like 1984 or 2001 quickly shows how slow things can develop. Interestingly back in the 60s for the original Star Trek, people thought we would have warp drive in a few years, but a talking computer that knows everything would be impossible and was quite implausible. Interesting how things do change.

I find news shows that make New Year’s predictions and look at the accuracy of last year’s predictions quite entertaining. Usually all the predictions from last year are wrong. Similarly if you study statistics and the accuracy of predicting trends by projecting graphs and such, you see that the mathematical inaccuracy grows extremely fast. So the graph of computer power above looks quite compelling, but believing the projection it makes is strictly an act of faith and intuition with no mathematical backing.

Is it Possible?

There is a lot of controversy about whether true human type self-aware intelligence is possible with just a Turing machine type computer. There is a lot of skepticism that some other secret sauce is required. Roger Penrose believes that our neurons actually aren’t just like computer logic gates, but that there are quantum effects going on that are necessary to go beyond a Turing machine.

I studied the transitions from stable simple systems to complex chaotic systems as part of my Master’s Degree. As dynamic systems make the transitions from stable simple predictable systems to chaotic systems, they don’t necessarily become completely random. It’s very common to get new stable emergent states that were completely unpredictable from the initial analysis.

I believe that self-aware intelligence is possible with just a Turing machine. That as our computing power and networks get more and more powerful and complex, that Chaos Theory will start to apply and that intelligence is in fact some sort of strange attractor that will eventually emerge.

Like we get amazing graphic images of Fractals from iterations of very simple equations, we get amazing unpredictable but stable complexity emerging. To me this will be the foundation for intelligence.

fractal3

Summary

Making predictions is fun, but usually not accurate. I find it fascinating to think about how intelligence might emerge on the Internet. It’s not just being left to emerge or evolve on its own, that in fact there are some very rich and powerful people putting quite large amounts of resources into making this happen.

I do think that once this happens (if it happens), that it will be a singularity and that we have no idea how things will progress past that point.

Written by smist08

March 9, 2013 at 8:16 pm

Our Sage R&D Leadership Conference at Newport Beach

with 6 comments

Introduction

This past week I had the privilege of attending a Sage Leadership conference that was put on for about 40 of the key Sage North American R&D Leaders. It was held over two days at the Newport Beach Hyatt Hotel. Newport Beach is a beautiful spot with Balboa Island and Back Bay in easy walking distance along with a number of good restaurants. The intent of the conference was to give people a chance to get away from the daily grind of problem solving and routine management to really concentrate on leadership. This is very important at Sage right now as the company is going through a large number of changes to adapt to the fast changing technology/societal landscape that we are now living in.

We had an artist drawing visually what we were doing, so in this blog posting I’ve added a few of her drawings on the relevant topics. They are really quite good and much better than getting an e-mail of PowerPoint presentations.

Sage Vision

The conference got off to a rocky start when the group was asked to stand if you could recite the Sage Vision statement and only a couple of people on the executive committee stood. This then led into a discussion about the Sage brand and the Sage Vision.

Just to be clear, the Sage brand isn’t just the Sage logo and the Sage Vision isn’t just some feel good marketing text that we put under the logo on our brochures. These aren’t about marketing at all, they are about defining the company that we want to become. The Sage Vision statement is:

To be recognized as the most valuable supporter of small and medium sized companies by creating greater freedom for them to succeed.

We then spent time breaking apart and analyzing this statement and then ensuring that what we are working on today aligns with this vision. Some of the key parts of this statement are that we will be recognized, that we do provide value in everything we do, it defines our market segment and defines our goal. We want to give our customers freedom from dealing with accounting matters so that they can concentrate on their real business whatever that may be.

p6

Leadership

After fully drinking the vision cool-aide, we then went about discussing and talking about leadership. A lot of this revolved around being a confident leader. In our ability to inspire our co-workers and to get all the cats moving in the same direction.

We discussed leadership attributes that we at Sage do well, but more importantly we spent more time discussing the leadership attributes that we are lacking and how to develop these.

The diagram then gives a good representation of what was discussed:

p5

Customer Connectedness

Rather than doing a Clint Eastwood and having the customer represented by an empty chair, we actually invited a couple of customers to kick off the second day. We started with a question and answer session to learn about their businesses, to learn about the problems that they are having, about what is working well. Not just for their ERP system but for their whole business in all its aspects.

p2

We were asked to take notes and then when the Q&A was over, the second part was to have our own Shark Tank show. Each table became a team (about five people each) and had 45 minutes to come up with a product idea to pitch to the sharks which in this case were our two visiting customers. They then judged the ideas and awarded a bottle of monopoly money to the team that they wanted to invest in.

This exercise was a lot of fun and was a good exercise of the creative juices. The winning ideas are then going to be fed into our innovation process to see if other customers also think they are good ideas.

It was interesting to watch, since this was entirely developers, that they fell into the same traps that we usually blame Product Management for, namely answering “yes it can” to every question and under pressure on pricing to keep lowing it until it’s a free service.

Innovation

A primary goal of the conference was to foster more innovation in everything we do. One fun exercise was to have all the tables go off into their own groups and put together a play or skit on a day in the life of someone using technology ten years into the future. I blogged on my vision of ERP in 2020 a couple of years ago here. Certainly my vision of ten years into the future was way more conservative than anything envisioned here. Center stage went to voice interaction and general direct input into the brain. In a way projected where technologies like Siri and Google Now along with Google Glasses will be in ten years.

The key theme is that no one will be keying in ERP transactions anymore. You will just do business by chatting and gesturing, sign contracts by shaking hands and all the debits and credits will happen magically (via technology) in the background.

Summary

The conference was a great deal of fun and highly successful. It was good to meet a number of people I’ve only dealt with via e-mail in person finally, as well as a number of people I didn’t know at all. It was good to ensure we are all aligned and working to the same vision and that we are all innovating together toward a common goal of really providing that freedom for our customers to succeed. But more importantly there are a number of things for me to start doing immediately on returning to the office.

Newport_Beach

Written by smist08

March 2, 2013 at 3:35 am