Mia Chat: A web based Ajax chat application.

Wednesday, March 26th, 2008

mia logoToday, Brilaps released version 0.8 of Mia chat -Ajax web based chat- application. Chad Auld states, “This release is stable enough for everyday use and has undergone a great deal of testing on the various popular platforms and browsers. We have been using it to do all our own chatting for months now and we’re loving it. We are nearing a 1.0 release, but have a few new tricks to try before then”. Mia Chat is released under the MIT License. For more information about Mia Chat go here.

Edit: Mia Chat and MiaCMS are entirely different applications. Mia Chat is a a standalone web application. It cannot be installed as an extension on MiaCMS.



MiaCMS makes it to the Finals

Sunday, August 31st, 2008

We made it. An -perhaps- insignificant step for humanity, but a giant step for the MiaCMS project.

MiaCMS has been selected as a finalist in the PacktPub 2008 Open Source CMS competition.  Our precious project will compete in the the “Most Promising Open Source CMS” category.  MiaCMS project is only about 5 months old, but we have worked hard and are quite proud of the results and the interest in the project.

The official list can be see here:
http://www.packtpub.com/2008-open-source-cms-award-finalists

The official voting (the real thing) starts Monday September 1.  Your nominations helped get us to this point, and we are thankful for that. However, we need to ask you one more time to show your support for MiaCMS project.

MiaCMS as the Most Promising Open Source CMS Award Winner



Must Call This Function!

Tuesday, June 30th, 2009

I was going through some code refactoring today, and needed a certain set of classes calling a particular function during their initialization.

I needed the function to be absolutely (i mean absolutely) implemented by any deriving classes of the base object.

I needed the function called automatically, so I won’t have to remember calling it anytime I derive something new out of the base class.

So, here is how I accomplished this lovely must-call-this-function pattern.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
interface ISample
{
    public function makeSureThatThisFunctionIsCalled();
}

abstract class ASample extends TheParentClass implements ISample
{
    public function __construct ($someParams)
    {
        parent::__construct($someParams);

        $this->makeSureThatThisFunctionIsCalled();
    }
}

class Sample extends ASample
{
    public function __construct($someParams)
    {
        parent::__construct($someParams);
    }

    public function makeSureThatThisFunctionIsCalled()
    {
        // do whatever you need to do here....
    }
}

class AnotherSample extends ASample
{
    public function __construct($someParams)
    {
        parent::__construct($someParams);
    }

    public function makeSureThatThisFunctionIsCalled()
    {
        // do whatever else you need to do here....
    }
}

The code should be self explanatory for the OOP savvy folks. Here is a very short description of what happens here.

Our actual class “Sample” extends the abstract class “ASample” which in turn implements the interface “ISample” (don’t worry about extending the TheParentClass). Implementing the “ISample” will require us to actually implement the makeSureThatThisFunctionIsCalled() function somewhere either in “ASample” or “Sample” class. We need class specific implementation of the function, so “Sample” and “AnotherSample” classes implement it.

Oh great, yay! We enforced our derived classes implement a function of the interface. Big deal!

How will we make sure that “makeSureThatThisFunctionIsCalled()” function will actually get called ?

In this sample, all the deriving class constructors call their parent::_construct which keeps bubbling up to TheParentClass so on and so forth…

So, we simply stick in “makeSureThatThisFunctionIsCalled()” in the immediate parent’s constructor and tada !!!

Our must-be-called function is surely getting called during the object’s initialization.

This may sound like a glorified initializer, but you never know. You may just need something like this.



Nice Techie & Geekie Blog on PHP

Wednesday, September 3rd, 2008

Martin Brampton has an interesting Web tech and PHP related blog at
http://blog.guru-php.com/

i.e. take a look at Helpers are unhelpful.

Overall, highly recommended bookmark.

Also, take a look at Martin’s book on PHP CMS Frameworks;

PHP 5 CMS framework development

click for details…



Suicidal Pattern and Observers

Wednesday, June 17th, 2009

The other day, I came up with a sort of bizarre idea of exception handling in PHP. Not so interestingly it may be, you’ll find out as you read, this design pattern is called “Suicidal Pattern“.

The idea is around an object throwing itself as “throw self” (actually throw this) and it’s own handler catching and handling and announcing to its observers.

And here it goes:

(more…)



What Do I Believe In?

Wednesday, January 28th, 2009

I’m an Humanist Muslim, who abides by the laws of Judaism, and going back and forth between Fundamental vs. Cafeteria Christianity; once in a while get confused by Mormonism, but always fighting the Satan.

*please refer to the respective definitions below.

The original article is here. I only picked up the ones that apply to me and copied over to avoid any misunderstanding.

C would be Judaism – it’s old and restrictive, but most of the world is familiar with its laws and respects them. The catch is, you can’t convert into it – you’re either into it from the start, or you will think that it’s insanity. Also, when things go wrong, many people are willing to blame the problems of the world on it.

Java would be Fundamentalist Christianity – it’s theoretically based on C, but it voids so many of the old laws that it doesn’t feel like the original at all. Instead, it adds its own set of rigid rules, which its followers believe to be far superior to the original. Not only are they certain that it’s the best language in the world, but they’re willing to burn those who disagree at the stake.

PHP would be Cafeteria Christianity – Fights with Java for the web market. It draws a few concepts from C and Java, but only those that it really likes. Maybe it’s not as coherent as other languages, but at least it leaves you with much more freedom and ostensibly keeps the core idea of the whole thing. Also, the whole concept of “goto hell” was abandoned.

C++ would be Islam – It takes C and not only keeps all its laws, but adds a very complex new set of laws on top of it. It’s so versatile that it can be used to be the foundation of anything, from great atrocities to beautiful works of art. Its followers are convinced that it is the ultimate universal language, and may be angered by those who disagree. Also, if you insult it or its founder, you’ll probably be threatened with death by more radical followers.

C# would be Mormonism – At first glance, it’s the same as Java, but at a closer look you realize that it’s controlled by a single corporation (which many Java followers believe to be evil), and that many theological concepts are quite different. You suspect that it’d probably be nice, if only all the followers of Java wouldn’t discriminate so much against you for following it.

Python would be Humanism: It’s simple, unrestrictive, and all you need to follow it is common sense. Many of the followers claim to feel relieved from all the burden imposed by other languages, and that they have rediscovered the joy of programming. There are some who say that it is a form of pseudo-code.

Visual Basic would be Satanism – Except that you don’t REALLY need to sell your soul to be a Satanist…

Thanks to guyro for his inspirational post which made me put my religions together.