Blogger Buzz: Announcing the Blogger app for iOS

I think I should buy a new smart phone

Blogger Buzz: Announcing the Blogger app for iOS: Today we’re excited to announce the new Blogger app for iOS. With the Blogger app, you can write a new blog post and publish it immediately ...

Copy wordpress from local to online

I have installed wordpress latest version (3.2.1)  , on my local machine , and then uploaded it to a host , when I go to the admin panel , it keeps redirecting me to the local address .

After debugging , I discovered that wordpress stores some info in a configuration file , and other info in database , and I have uploaded the database as it is .

To solve this problem , I open phpmyadmin on the host server , and I changed the site_url option to the correct one , from table wp_options .

Create a new module on joomla 1.7

I moved to joomla to make a small job .
I needed to make a new module to make things customizable on the home page ,  but it seems that joomla 1.7 uses a new way to make modules, rather than the one described in their documentation ( click here ) .

You will make everything as the tutorial said , except some small changes in the xml file .
To add files and folders , you don't need to write all files in each folder but you can include a complete folder in a way like that

	mod_hello_world.php
	index.html
	tmpl
	mod_hello_world.xml

When you write tmpl , all files inside this folder are automatically included .
Also you will have to take care when you include parameters , there is a new way to do that


 
  

spaghetti code

I am working these days enhancing an old project .
I am writing some tweaks in a php page , that prints html code , and sometimes javascript code , that is included from another php code , that reads a cached file and writes a js array and then prints html code .

The legacy application connects to MsSql database , and for making a development virtual machine , we were obligated to run the application on windows xp , installing xampp and we started the game .

Always the first level is easy , some minor enhancements were required , and we were done .
But the post levels were tricky , some pages were not working at all , I struggled to find the reason , and I was surprised when I found it .

Some php pages where including some other pages , a way like this

include "/var/www/lib/ClassName.php" ;

Of course that was not working in Windows Xp , as there is now "/var/www" in windows platforms , so I learned a new lesson , when writing an application , the safest way to include files is to make one file of configuration that holds all the root folders as constant variables .
And when including specific files , you use those variables , and change it whenever you want , for example if you change the environment .

I love Linux .

Zend Framework modular design


Hi

This is a repost of the old post about the zend framework modular redesign .

Files and directories hierearchy

www/
 application/
  admin/
   controllers/
   forms/
   layouts/
   models/
   views/
  configs/
   application.ini
  default/
   controllers/
   forms/
   layouts/
   models/
   views/
  Bootrstap.php
 library/
  Zend/
 public/
  index.php

And here is the configs/application.ini file , I will list the most important lines .
This is for the modules , note that we have made the module directory , the Application Path itself , so you can put your modules inside application directory as we did in the directories hierarchy .

includePaths.library = APPLICATION_PATH "/../library"

bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"

appnamespace = "Application"
resources.frontController.moduleDirectory = APPLICATION_PATH 
resources.modules[] = 


and in the Bootstrap file , you can define _init function as you can , the most important one is the autoload function , here is Bootstrap.php file
here you are loading the two namespace you have ( default and admin ) .

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {

    public function _initAutoload() {
        $autoloader = new Zend_Application_Module_Autoloader(
                        array('namespace' => 'Default',
                            'basePath' => dirname(__FILE__) . '/default',
                        )
        );
        
        $autoloader2 = new Zend_Application_Module_Autoloader(
                        array('namespace' => 'Admin',
                            'basePath' => dirname(__FILE__) . '/admin',
                        )
        );
        
        $application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
        Zend_Layout::startMvc();
        $bootstrap = $application->getBootstrap();

        Zend_Session::start();
        $db = new Zend_Db_Adapter_Mysqli($bootstrap->getOption("database"));
        Zend_Db_Table_Abstract::setDefaultAdapter($db);
        return $autoloader;
    }
}
That's it , feel free to ask any questions .

BAD SUPERBLOCK

I fixed a bad superblock on linux ubuntu 10.10
I did recover some important files , I will reinstall ubuntu 11.04 64bit .

I took advice from this link
http://www.cyberciti.biz/faq/recover-bad-superblock-from-corrupted-partition/

Blogger Buzz: Announcing Blogger Mobile Templates

Blogger Buzz: Announcing Blogger Mobile Templates: "Posted by Jiho Han, Software Engineer A few months ago we introduced mobile templates to Blogger in Draft . Today, we’re excited to announ..."

From Blogger Buzz

This is very nice , I tried it for this blog and it seems good on iphone .

How to know first revisions on svn branches ?

So , if you are working as builder who merge the branches to the trunks , and find conflicts and all that *** * , I think that command will help you .

This will help you the first revision of the branch , so you can only merge the needed revisions

svn log BRANCH_LINK --stop-on-copy
The last revision will be the revision of copying .
Merging of course will be easy like this

svn merge -r REVISION:HEAD BRANCH_LINK

Assuming that your current directory is the working copy .

How to know the changed files on your svn branch ?

Hi all

Sometimes I encountered this problem with working with SVN , I took a branch and made a lot of changes , then I need to know which files I have changed in .

This can be done with a simple svn command , execute it on your branch .

svn diff -r 1234:HEAD --summarize

Where 1234 is the revision of the branch when you first copied it .
That's it , this command will list all your changes .

How to install jre on Ubuntu 10.10

Hi

This is a problem that faced me on installing a new version of ubuntu 10.10 , I think a big number of ubuntu users have the same problem .

How to install java ( jre and jdk ) on Ubuntu

I followed the instructions on this page from ubuntugeek.com and it worked successfully .

sudo add-apt-repository ppa:sun-java-community-team/sun-java6
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin

I hope it will help anyone .