Tuesday, June 23, 2009

wikimedia setup

Wiki media configuration tips:

Edit LocalSetting.php

How to setup only logged in user can edit / add post:

//only logged in user can edit
$wgGroupPermissions['*']['edit'] = false;
How to setup only admin can add user:
//only admin can create account...
$wgGroupPermissions['*']['createaccount'] = false;
How to enable upload for wiki media?
//find for $wgEnableUploads
$wgEnableUploads = true;
How to allow upload of other files:

$wgFileExtensions[] = "zip";
$wgFileExtensions[] = "gz";
$wgFileExtensions[] = "pdf";
$wgFileExtensions[] = "doc";
$wgFileExtensions[] = "xls";
$wgFileExtensions[] = "ppt";

But, upload will fail if you enable imagemagick, because it assume all your is image. Therefor, we will need to disable imagemagick:

$wgUseImageMagick = false;

Hope it helps ;)

Reference:
http://www.mediawiki.org/wiki/Configuring_file_uploads#Upload_permissions

Monday, June 22, 2009

drupal vs wordpress vs joomla

My findings:

Drupal:
Good:
  • very modular
  • able to reuse other module
  • allow theming overrides
  • drag n drop ordering of fields
  • allow custom fields
  • front end & back end having similar login and path
  • good interface
  • inserting folder as module make things simple
  • cutting edge - using tinymce3...
Bad:
  • Complicated admin
  • Slow admin interface as 2 much form input in 1 screen

Wordpress:
Good:
  • allow theming overrides
  • drag n drop ordering of fields
  • allow custom fields
  • nicest gui and friendliness among 3 cms
  • cutting edge technology - using wikimedia, tinymce3...
Bad:
  • TODO

Joomla:
Good:
  • Clearly separate module, controller & view
  • allow theming overrides
  • support hooks

Bad:
  • no custom field support
  • admin no hook support, therefore hacking core is unavoidable
  • some bad component design like jevents use their own templating, which is bad
  • inconsistant template - esp. between category & section
  • interface is like erp, not so good...
  • difficult to reuse other module functions
  • mootool 1.1 & tinymce2 legacy stuff!
  • component/module/plugin installation is tedious, need to pack and clear db if something went wrong

Tuesday, November 25, 2008

Working Modal for Development

Most developer / software house does not put time to organise their concept of development.
Especially in Malaysia, most companies try their best to tender for project which squeeze their time and budget to as minimal as possible, leading to untested and non-flexible (rapid) system.

One of the best modal to work on will be:
AMDD - Agile-Modal Driven Development

It uses modal concept to plan overview system flexibility, while implementing TDD (Test-Driven Development) to have system test unit developed before the actual development begin.
By using this concept, development can be planned from overview to tasks to-do, and allow brain storm on variety of posibilities of business processes.

Project estimation has to be planned with a range of posibilities, problem from: simple case scenario to worst case scenario (everything that could involve, and more...) .

Each client have to understand that development of software requires proper planning.
Any changes on the system could involve major changes. For example, we can refer to any building structure. We can do changes on or in the building itself, but not changing the overall structure of the base nor the pillar concept. Changes on the overall structure could lead to reconstruction of the entire project, which could lead to duplication of afford and time used.

As a professional, we who is in the software development industry should see things in a long run. We should set a border line for time and money, in order to ensure everyone have a fair treatment and time constraint. For example: standardization of petrol price. If each petrol supplier tend to fight for lowest price, quality of product will reduce. People will tend to find the cheapest cost to deliver the software.

Comparing TDD and AMDD:

  • TDD shortens the programming feedback loop whereas AMDD shortens the modeling feedback loop.

  • TDD provides detailed specification (tests) whereas AMDD is better for thinking through bigger issues.

  • TDD promotes the development of high-quality code whereas AMDD promotes high-quality communication with your stakeholders and other developers.

  • TDD provides concrete evidence that your software works whereas AMDD supports your team, including stakeholders, in working toward a common understanding.

  • TDD “speaks” to programmers whereas AMDD speaks to business analysts, stakeholders, and data professionals.

  • TDD is provides very finely grained concrete feedback on the order of minutes whereas AMDD enables verbal feedback on the order minutes (concrete feedback requires developers to follow the practice Prove It With Code and thus becomes dependent on non-AM techniques).

  • TDD helps to ensure that your design is clean by focusing on creation of operations that are callable and testable whereas AMDD provides an opportunity to think through larger design/architectural issues before you code.

  • TDD is non-visually oriented whereas AMDD is visually oriented.

  • Both techniques are new to traditional developers and therefore may be threatening to them.

  • Both techniques support evolutionary development.


Reference:
http://www.agiledata.org/essays/tdd.html

Please correct us if we did any mistake on the article above.
Feel free to drop us comment :)

Thursday, September 4, 2008

Google Browser is up! - Chrome


Google came out with the Best Browser ever made from open source software,
"Webkit" (also used by Konqueror & Safari). http://www.google.com/chrome
On top of that, they have made a very impressively fast performance Javascript engine named "V8". The results were so impressive! It is more than 10X faster than traditional javascript engine made used in Mozilla Firefox 3.0 and M$ IE 7.

But its too bad that Chrome is yet to be available on Linux / Mac at this moment.

They managed to separate each tab / window process of Chrome into multiple process. Even plugin has their own separate process :)

With the new separated process, any crash on 1 window/tab can be controlled and constrained any crash into that particular tab/window without crashing on the other tabs or window. Even plugin works the same way!
This is what future browser need!

Recently, Mozilla has also optimized their JavaScript engine to a new level, named "Spider Monkey". They claim to have higher performance compared to Chrome "V8" engine. But compared to V8, V8 separates each tab processes independently, making it more stable.
http://www.mozilla.org/js/spidermonkey/

There has been claimed that some of the users are unable to open gmail or gdocs from google Chrome. As far as our testing goes, it works perfectly fine.
But we still like the "Home" button to be there on the chrome interface. Missing that features, make it awkward.

Here is a speed comparison chart on Chrome:

http://asia.cnet.com/crave/2008/09/03/speed-test-google-chrome-beats-firefox-ie-safa/

And another comparison:
http://gizmodo.com/5044958/dr-frankensteins-browser-the-strangely-obvious-ancestry-of-google-chrome




On top of that, we think that Adobe should seriously look into fixing up their Flash engine. It is so unstable on Windows, and even worst on Linux. The version we tested were Flash 9 and Flash 10 Beta.

Disclaimer:
Logos and photos used in this article are copyright of their respective owner. The content published above is solely for information purpose.

Tuesday, July 29, 2008

PHP Coding Ethic

Everyone can be programmer...
But we need to ensure that our coding is easy to be follow up by others...
Okay, maybe you don't care about others, but what if YOU are the one following up other peoples code?
Any nice feeling? i bet ya ;)

Okay, this might be not the only standard way of making things looks nice,
but it is our way of doing things in the company.

---------------------
Bad Coding:
$var1 = 123;
$var2 = "xxxx";
$var3 = true;
Why?
  • Bad Naming:
    - Who would have known the purpose of the variable "var1"?
    - Variable type is difficult to know... especially long piece of codes...
Better Coding:
$iCounter = 123;
$sMsg = "xxxx";
$bCheck = true;
Why?
  • Good naming:
    - $i... indicate variable type of number
    - $iCounter indicate what it is used for..

Its best to have proper naming. We include the starting 1st charactor in our variable naming as the variable type. List of naming:
  • $i... - number
  • $f... - float
  • $s... - string
  • $b... - boolean
  • $m... - mixed type
  • $o... - object
-----------------

Bad Coding:
if($bCheck == true) { $xxx = 1;
echo $xxx; }

foreach($xx as $yy ){
echo $yy; }

echo (($bXx == true) ? (($xxx==1)? "1": (($bYy==$xxx-1)? "true": "false")) : "ok" );
Why?:
  • Bad spacing if($bCheck <-- look too compact
  • Bad curly bracket positining and indent...
  • Too compact formula, look cool!, but it is definitely not easy to debug if problem risest! Even for the developer him/herself!
Better Coding:
if ($bCheck == true)
{
$xxx = 1;
echo $xxx;
}

foreach ($xx as $yy)
{
echo $yy;
}


if ($bXx == true)
{
if ($xxx == 1)
{
echo "1";
}
else
{
if ($bYy==$xx-1)
{
echo "true";
}
else
{
echo "false";
}
}
}
else
{
echo "ok";
}


Why?
  • Easier for reading and debugging
  • More spacing and proper curly bracket positioning


Disclaimer:
Logos and photos used in this tutorial are copyright of their respective owner. The content published above is solely for education purpose. Feel free to close this website if you are not happy here.. :)


PHP Tutorial #3 - The Basic

Previous*

Okay, time to get your hand dirty :D

For Ubuntu / Debian distribution:
1st, the starting page for apache is default pointed /var/www/
it is configured in /etc/apache2/sites-available/default assigned as parameter of DocumentRoot
The default file to open for directory will be in /etc/apache2/mods-enabled/dir.conf as parameter of DirectoryIndex

PHP files need to be declared as .php extension by default.
The starting page will be index.php

Create a file in /var/www/index.php
Enter the content:
<?php
$sNo = 123;
echo $sNo;
?>
You will get output:
123
In this tutorial, we will only show you the very simple basic.
For more information, please refer to php documentation or tutorial found here:
http://www.php.net/manual/en/language.basic-syntax.php

In PHP, a variable type is not needed to define. You may reassign the variable at any time to any type. "$" indicate it is a variable. Each statement must end with ";"
Example:
$mVar = 123;
echo $mVar;
echo "\r\n";
$mVar = "xyz";
echo $mVar;
Output:
123
xyz
"echo" is the simple function like c print.
you may also use the function print to do it.

To call a function:
$mResult = myFunction([parameter...]);

To define your function:
Example:
function myFunction($param1, $param2)
{
$iResult = $param1 + $param2;
return $iResult;
}
To call it:
Example:
$iResult = myFunction(123, 555);
echo $iResult;
Output:
678

For comment, use c like concept:
// Line based comment
/*
Multiple line
comments...
*/

Operators

Operators in PHP is alike C.
Example:
$iResult = 123 + 555;
//result to 678

$iResult = 111 - 10;
//result to 101

$iResult = 500 / 2;
//result to 250

$iResult = 50 * 3;
//result to 150

$bResult = (1==2)
//result to false (boolean)

$bResult = (1==1)
//result to true (boolean)

$bResult = (1!=2)
//result to true

$bResult = (1!=1)
//result to false

// AND operator
$bResult = (true && false)
//result to false

$bResult = (true && true)
//result to true

// OR operator
$bResult = (true || false )
// result to true

$bResult = (false || false )
// result to false
Next*

Disclaimer:
Logos and photos used in this tutorial are copyright of their respective owner. The content published above is solely for education purpose. Feel free to close this website if you are not happy here.. :)