Technical paper on a possible generic PHP based system

This article is for personal reference. Its creation became necessary while pondering on a certain subject, I realized my brains (as with all brains being limited to a maximum of 7+2 variables simultaneously) could not handle all the required variables at once and was therefore unable to see clearly a coherent big picture of the envisioned idea.

Hopefully in creating this technical paper could it be made visible to me any possible design flaws when I examine each part in detail.

The goal is to create a system/framework that does the following

1. Accept many user created xml documents each describing different reptitive tasks that happens in a company in XML.
2. A XML document will contain:
2.1 All fields that exist and their data type
2.2 All stages that exist and their order
2.3 Fields and Stages mapping, access permission to fields available in each stage
2.4 Each stage will provide views of the object defined in the XML document
3. Instantiates an object that holds all that is in the corresponding XML document declared as properties
4. Assign system users as personel in charge of each xml defined stage as this is not captured in the XMl document to keep XML document system independent
5. Serialize this object and store it as a record in the template database table.
6. When Template Manager Object is triggered, it retrieves this template object from the template database table and replicates a working instance which will be then stored in the object database table
7. Has a work manager object which handles the manipulation of data stored within working instance objects.
8. Has a work manager object which handles the synchronization of serialized records in the object database table and the instantiated deserialized records in the system SESSION.
9. Ideally the work manager object will have built in features that will handle concurrency issues.
10. Data types defined in the XML document as part of object property will automatically instantiate existing native classes already included in the System
11. Data types will extend a parent data type which will provide methods which child data types will have to declare. Possible methods envisioned includes
11.1 Display
11.2 Edit
11.3 Store

Potential advantages of what I have envisioned thus far.
1. Database table structure will be independent of the object structure
2. Database structure will effectively be just reduced to two tables irregardless of the variety of object structure.
2.1 template table
2.1.1 field : id -> primary key
2.1.2 field : data -> serialized object
2.2 object table
2.2.1 field : id -> primary key
2.2.2 field : data -> serialized object

3. Framework remains sufficient abstract and can be easily ported from system to system

Potential down side of what I have envisioned thus far.
1. All objects instance in the object table will be loaded into SESSION during each call. This might impose a high load on the database server during the initial loading.
2. It might be difficult to sort or do a search amongst a collection of the same objects as compared to sorting available in traditional SQL search queries.
3. Synchronization issues might arise.
4. Possible out of memory error as more object instance comes into existance.

My next step from here will be to research into design patterns to examine the possible patterns that I could apply on this framework to address issues 2 & 3.

I will also need to look into the PHP documentation to understand the factors that will cause issues 1 & 4

Learning how to use Ektron CMS

Browsing through the Ektron manuals as well as watching all the videos on YouTube does help alot with the picking up of Ektron CMS.

Today I finally created a template page and registered it as a template in the EKTRON CMS. I am currently using it as a sandbox within which I test all the user controls that come along with the Ektron CMS.

It applied a templated to my page called test by first including it as an option in my Content Folder which holds my content object

I then assigned the template to my content object.

Thereafter I went to the command prompt and inserted the command IISRESET. This forced the Ektron CMS to clear off its cache and create a new one. Thus my changes are updated nicely.

Strangely, even though I haven’t programmed in C# for quite a few years already I could understand up to 80% of the syntax used. The main part that I found to be tedious at tackling was its convention. There is the aspx file, the aspx.cs file (if you are using C#)

within the aspx file itself there seem to be a few lines at the top registering some assemblies the source of which I have no idea where from.

As compared to typical open source technologies like PHP, this is mainly the downside of Proprietory technologies like ASP.net. PHP being open allows you to investigate through all the codes that were used in the implementation of a system. Try investigating the source of where a function came from in ASP.net and sooner or later you will hit a wall. The function was compiled and hidden within a DLL file of which location you have no idea where. Ouch!

Things To Do Singapore progresses down the long tail

I checked the statistics of ThingsToDoSingapore.com apparently traffic has been quite stable recently over the past few days with average daily volume at 150 visitors per day.
Checking out google analytics I realised that ThingsToDoSingapore.com has been indexed by Google on over 2300++ keywords. A few of these keywords experience high daily search volumes per day while others experience more occasional visits which last for longer than average visit lenght.

It seems like ThingsToDoSingapore.com with 600++ pages so far is getting a nice long tail in terms of traffic at the moment.

An evening when all things come in threes. Work productivity and the two matrix

Since two months ago, I started putting into practise the maintenance of a time sheet. This is thanks to the need that arose due to my participation in one particular project. However not just limited to maintaining a time sheet for that particular project, I extended the use of this practise to maintain a comprehensive record of all my daily activites.

Each day of my time is divided into 30 minutes slots. Each hour will contain two time slots one ending at the 30minute mark and the other ending at the 60 minute mark. Each slot is dedicated specifically to just one activity and one activity alone. In the event whereby contingencies arise, that contingency is assigned to the next available time slot which is in best case scenario 1 minute away, in worst case scenario 30 minutes away. Such a practise while inflexible at first helped me in maintaining continuity in work hence ensured an acceptable level of productivity. I effectivly avoided the situation of having to tackle all matters while getting none done at the same time.

This evening after clocking a 9 hours working day, I sat down infront of my computer and started examining my time sheet. More specifically I matched the profit (in terms of cash in my bank account) I made over the past two months to specific time slots of specific days.

That which arose clearly before my very eyes was very interesting indeed. I observed a very clear pattern. Two patterns in fact. Profitability in terms of products sold as well as quality of customers.

The 3 businesses below are still by far the more lucrative products of my operations

  • Internet market campaigning for SMEs
  • Building DIY sites based on wordpress for SMEs
  • Building non-DIY sites based on Joomla for SMEs

Lucrativity is measured in terms of the 3 factors below

  • length of project turn around time.
  • Promptness in terms of client payment.
  • Cost in terms of time and effort spent on after sales support.

Having summarized my operations with the use of both matrixs. The images of three men suddenly popped into my head.

  • My Dad, veteren hawker who has been in business for years.
  • Master Gwee, an aged Feng Shui Master who is one of my existing clients that constantly provides me with clear insight to things in the environment as well as human physcology
  • An old Chief Marketing Officer of an IT company, which I once went for interview at, whom along with the CTO was very interested in getting me as an Executive Committee member for their company. (I finally backed out from their offer because I came to realized I wanted more from myself and that giving up the chance to bring forth my fullest potential just so as to provide security for a woman would cause be deep bitterness and hatred in me towards the latter part of my life.)

From my dad, this statement “son do not ever enter into ventures that don’t bring in money but just empty promises. Always ask your customers to show you they have money to spend and are willing to spend it.”

From Master Gwee, “always focus on where your finishing line is and do what you should do to get pass the finishing line. Avoid other side adventures that will only delay your crossing of the finishing line.”

From the CMO “you might die from prolonged starvation but you will definitely die immediately from indigestion. Despite the fact customers always attempt to beckon us to venture in a certain direction, we always politely reject them when that venture will not bring us strategic advantage but only cause the thinning of our valuable resources.”

To make a long story short, I only have a maximum of 14 possible working hours per day hence I should be spending a higher percentage of these hours milking my existing cash cows by concentrating on the sales of my most lucrative products as  well as looking for related markets to push these lucrative products to, instead of spending half of them for the creation of new products.

Creating of new products can come when I have automated the delivery process of my lucrative products through a process called leverage and have more funds and capital for RnD.

MSSQL 2008 server on VPC resource pool error

I tried getting funky with the Ektron installation by attempting to install the database on a separate server.

I created a log in account on the MSSQL 2008 server with all rights.

I configured the component services to allow remote access.

My ektron setup could detect and login to the remote MSSQL 2008 server, however when attempting to run the SQL scripts, the system threw and error

We ran out of resources on the MSSQL 2008 server. Checking the settings of the VPC I realised that I just gave it a 256mb ram. Not good!

Come to think of it no wonder this particular VPC was so slow in responding to my request.

Back to doddling with ASP.net technologies

Recently I started touching ASP.net all over again. This time it was due to the fact we might have some project where clients love Microsoft technology.

These are the potential places I have to watch for when setting up ASP.net systems on my IIS.

1. The permission and access of the Inetpub folder is very important. Make sure to add ASPNET user and give him full control to this folder

2. Login method allowed for your MSSQL server. MSSQL server allows administrators the ability to restrict log in types. Types available include Windows Integrated Authentication and SQL server authentication. Administrators could restrict it to either one of two types or allow both. Once done, types not allowed will have problems logging into the system

3. Always remember that Windows running the threads under different accounts, some accounts will have permission to access some locations or services while other don’t.

All in all dealing with Windows technology has always been a complicated affair. If the budget is there, I dont mind dealing with it, if not… chuck it! haha. There are so many alternatives out there.

    Joomla Component officially launched

    It was Sunday after two weeks of wait I discovered this email from some unknown addresses in my account. Curious, I took a look. It was from the Joomla team. The reviewers were finally taking a look at my submitted Joomla 1.5 component.

    After some slight modifications here and there I finally had my component approved. what a great day indeed. Now I am looking into this new CMS called Ektron which we will be proposing to another one of our clients next week.

    500Gb of space and the Tower of Hanoi Problem

    I happily went to Sim Lim Square this afternoon to buy myself a 500GB internal hard disk for my laptop. One of them the Lenovo R60 has only 80 GB when it first came to me. I used up all the disk space within a short span of time for my software developement work.

    At first I was thinking probably I would use the Lenovo System as my testing server since most of my development work is now done on my NEC system.

    In Sim Lim Square I collected all the product brochures and went up to level 6 where it was less crowded to analyze the prices of internal hard disk of each store. I realized that level 5 unit 18 had the cheapest 2.5″ Western Digital Hard Disk so I made my way there.

    I asked the shop keeper if he does help install hard disk. he said “Nay!” he only sells hard disk. He didnt seem very interested in anything else other than exchanging his wares for money. But he did mention once if I was sure my laptop could support up to 500GB. Truth was I didn’t know. I told him about my lack of knowledge with regards to that and proceded to show him my laptop which I had in my bag.

    Still he proposed “do if at your own risk

    Left without neither assistance nor expert opinion from him, the only thing I could thus do was to borrow a screw driver from him and to take out the hard disk of my laptop myself and attempt the best I could to determine if this hard disk would work on this laptop.

    Well they looked the same to me. I pondered for a while and it finally came to the moment of truth. What the hell, I took the bag that the 500GB hard disk was wrapped in and tore it open to extract the hard disk. Suddenly the shop keeper seemed visibly pissed.

    “Alrite you will have to pay now!”

    Well it is nice of him to ask for payment. Not wanting to get distracted from what I have in front of me I passed him the cash and concentrated on inserting the new hard disk into the Lenovo laptop. Alas, I realised the Lenovo laptop does not recognize the hard disk.

    Too bad then. I left the shop with my 500 Gb hard disk and laptop.

    Arriving home I decided to do an experiement with the hard disk and my NEC laptop. Well it detected the hard disk with no problem. One problem solved.

    I tried next to insert my 250GB from the NEC laptop to the Lenovo laptop. While the hard disk was successfully detected. The system failed to boot up using the existing operating system’s configuration. It should be likely due to the clashes between the drivers installed on that hard disk clashing with the hardwares on that system. So if I just formatted that hard disk and reinstalled a fresh operating system on it, this 250Gb hard disk should work nicely with that Lenovo system.

    Hence another problem arised however. How do I go about migrating all the important documents and system installations from this 250GB to that 500GB disk without having the risk of experiencing having my hands caught in the event of contigencies?Aka a client calling up in the midst of all this requiring my technical support which I could only provide from my 250Gb disk, since the 500GB disk is not up and ready yet and would take quite a while to be ready.

    It seems like a Tower of Hanoi problem to solve.

    Software developement

    There is a slight difference between software programming and software developement.

    Software programming is just restricted to the task of writing lines of codes to create a program that fulfils a function.

    Software developement entails not just programming but also the following:

    1. ensuring that what was created fulfills the function it was intended for
    2. that the function was defined properly
    3. that all possible permutation has been tested to ensure software is robust and does not crash due to unforeseen circumstances.
    4. that software be deployed and is in working order in the live environment.

    No wonder software developers gets more pay than programmers.

    This is most especially true for mission critical systems

    Restoring an MOSS site

    Given an MOSS bak file which looks something like blahblah.DAT. You will need to do the  following to install it on your MOSS installation.

    First you will need to go to your MOSS Central Administration Page and create a site collection. For example

    http://localhost/sites/test_site_collection

    of you could simply go to

    C:\program files\common files\microsoft\shared\web server extensions\12\bin

    and type the following

    STSADM.EXE -o createsite -url <url-to-site-collection> -ownerlogin domain\user -owneremail <email-address>

    Next you will need to navigate to the following location using command prompt

    C:\program files\common files\microsoft\shared\web server extensions\12\bin

    Once you are here type in the following command

    explorer .

    This command will open this location and you can copy your blahblah.DAT file here via copy and paste.

    Next go back to your command prompt you can type in the following command

    stsadmin -o restore – url http://localhost/sites/test_site_collection -filename blahblah.DAT -overwrite

    Click enter when you are done.

    To see the restored sitetype

    iexplore http://localhost/sites/test_site_collection