Explore Yourself !!!


All projects backup in a Single PC (including Versioning)

It’s really nighhtmare to maintain all projects backup manually in a single computer when a project is developed by different programmer(s). But it’s really easy if we assign the manual task to any sub versioning sofware like Tortois SVN.

Prerequiresites:

1. Local area network(LAN).

2. Install SVN in all computers including Backup Server ( installation require 5 minutes per computer).  How to install?

3. Backup Server (don’t worry its a general configuration computer just consider as Backup Server). It’s wise to assign company name to backup server. For instance say company

When a project(first_project) starts, do the following task in Server:

1. Create Repository in Server computer. Which mean create a folder named first_project in server pc.
here is your new project in server

2. Open the folder and right click -> TortoisSVN -> Create Repository Here.
attempt to create repository

3. Many folders will create and show a popup confirmation as.
Repository created successfully

 

 

When a project(first_project) starts do the following task in Developer PC:

1. Create a folder in your root with the same name first_project. open the folder and Right click -> SVN Checkout
Make connection with server

 

2. You will get a folder named .svn. Now paste initial folder and files of your project here. After that, right click -> SVN commit. Press ok.
Your playground is ready for you

Every hour or end of the day when developer plan to take off from office, simply right click -> SVN Commit
Files stored in server with success

 

That’s it :) All projects are now under version control. Which mean after 2 month, if you want to revert a module it’s possible. Who developed this module (need some editing) is easy to identify. Enjoy Yourself !!
Hey keep in mind, if your backup server hard drive crash due to power failure i am not responsible for that :D If crashed, don’t worry every developer PC still contain latest version of the project. So lets get START :)



Create an SVN repository for your project
December 14, 2008, 5:30 am
Filed under: Web Technology | Tags: , ,

Subversion have a huge list of features what you can get from here. But i have not enough time to read the big list. So in short, subversion is a system which helps developer to backup and recovery(extreme feature) their code time to time. Tortoise SVN is a good subversioning system for windows. Easy to install and use.
Why we use SVN?
Best and attractive feature what i found is Checkout and Commit. Let me explain more. While i am working in a project i change a number of files in different folder. So when we need to synchronize with server we need to enter individual folder and upload files through FTP. Or whatever it’s local office development when multiple (or even single) developer engage in a single project. For all easy way to do this task is : just enter into project folder (eg. htdocs/my_project) now click SVN->Commit. a list of changed files displayed and you can easily check which files you wish to commit. Moreover, you can put a comment for your change. Someone in other end can easily receive these files by SVN->Checkout. He will notified what changes made by whom. It’s the cool feature and a lot more. So lets try to install and use it first.

First download it from here
How to setup ?

In Windows explorer, make a directory where you would like the SVN repository to be.
Right click on the directory you just created, then scroll to TortoiseSVN > Create Repository here…
You should get the following pop-up window:
pop up window. if not appear, don't worry

Choose the file type you would like and click OK.
How do you know it worked?

You should get the following message:

Ok message

Import the project into the SVN repository

Go to your work area in Windows Explorer. Right click on the directory you just created, then scroll to TortoiseSVN > Import…

URL of repository should be blank first and then press right tiny button

Click on the button in the top right to browse for the location of the SVN repository that you just created. Once selected, add a “/trunk” to the end of the file location. Enter “initial import” in the Import Message field. Click OK

How do you know it worked?

You should get output as follows:

output

Start using the SVN files in your work directory

To use the SVN repository, we’ll actually want to checkout the files in an empty directory – SVN needs an empty directory to start.

Using Windows Explorer, rename your project directory from aminul_stull to aminul_stuff_backup . Create a new work directory named aminul_stull Right click on the directory you just created, then scroll to TortoiseSVN > SVN Checkout… In the pop-up window verify that the “URL of repository” has the location of the SVN directory that you created; if not, browse and select it. Make sure you have /trunk added to the raw location. Click OK and you should get the following window:

ok window

When you go back to windows explorer, you should now see a green check mark next to the directory.
[SVN er Dorwaja Kholna MAMU]

[NOTE: i have STOLEN maximum content of this article over the net;) Don't worry no one blame you if you use it and get benefited :D ]



How simple to create an excel file from database using CI
December 11, 2008, 12:08 pm
Filed under: Code Igniter | Tags: ,

How simple to create an excel file from database using CI (don’t care about table(s) or data)
function export_excel()
{
$query = $this->db
->select(‘*’)
->from(‘customer’)
->get();
to_excel($query , ‘export_master’); // outputs export_master.xls
}

system/helper/common_helper.php
or
application/helper/common_helper.php
field_data();
if ($query->num_rows() == 0) {
echo ‘

The table appears to have no data.

‘;
return FALSE;
} else {
foreach ($fields as $field) {
$headers .= $field->name . “\t”;
}

foreach ($query->result() as $row) {
$line = ”;
foreach($row as $value) {
if ((!isset($value)) OR ($value == “”)) {
$value = “\t”;
} else {
$value = str_replace(‘”‘, ‘”"‘, $value);
$value = ‘”‘ . $value . ‘”‘ . “\t”;
}
$line .= $value;
}
$data .= trim($line).”\n”;
}

$data = str_replace(“\r”,”",$data);

header(“Content-type: application/x-msdownload”);
header(“Content-Disposition: attachment; filename=$filename.xls”);
echo “$headers\n$data”;
return TRUE;
}
}
?>
[NOTE/DISCLAIMER: 100% copy and paste from http://codeigniter.com/wiki/Excel_Plugin/ ]



YAML Database Format
December 10, 2008, 2:12 am
Filed under: Framework, Symfony

[NOTE: copy and paste from : http://www.symfony-project.org/jobeet/1_2/Propel/en/03 ]

According to the official YAML website, YAML is “is a human friendly data serialization standard for all programming languages”

Put another way, YAML is a simple language to describe data (strings, integers, dates, arrays, and hashes).

In YAML, structure is shown through indentation, sequence items are denoted by a dash, and key/value pairs within a map are separated by a colon. YAML also has a shorthand syntax to describe the same structure with fewer lines, where arrays are explicitly shown with [] and hashes with {}.

By Example, here is a YAML database schema
schema.yml
# config/schema.yml
propel:
jobeet_category:
id: ~
name: { type: varchar(255), required: true }

jobeet_job:
id: ~
category_id: { type: integer, foreignTable: jobeet_category, foreignReference: id, required: true }
type: { type: varchar(255) }
company: { type: varchar(255), required: true }
logo: { type: varchar(255) }
url: { type: varchar(255) }
position: { type: varchar(255), required: true }
location: { type: varchar(255), required: true }
description: { type: longvarchar, required: true }
how_to_apply: { type: longvarchar, required: true }
token: { type: varchar(255), required: true, index: unique }
is_public: { type: boolean, required: true, default: 1 }
is_activated: { type: boolean, required: true, default: 0 }
email: { type: varchar(255), required: true }
expires_at: { type: timestamp, required: true }
created_at: ~
updated_at: ~

jobeet_affiliate:
id: ~
url: { type: varchar(255), required: true }
email: { type: varchar(255), required: true, index: unique }
token: { type: varchar(255), required: true }
is_active: { type: boolean, required: true, default: 0 }
created_at: ~

jobeet_category_affiliate:
category_id: { type: integer, foreignTable: jobeet_category, foreignReference: id, required: true, primaryKey: true, onDelete: cascade }
affiliate_id: { type: integer, foreignTable: jobeet_affiliate, foreignReference: id, required: true, primaryKey: true, onDelete: cascade }

The schema.yml file contains the description of all tables and their columns. Each column is described with the following information:

type: The column type (boolean, tinyint, smallint, integer, bigint, double, float, real, decimal, char, varchar(size), longvarchar, date, time, timestamp, blob, and clob)
required: Set it to true if you want the column to be required
index: Set it to true if you want to create an index for the column or to unique if you want a unique index to be created on the column.



lets try symfony
December 10, 2008, 1:57 am
Filed under: Symfony

Symfony is an excellent framework which make programmer’s life more easier. fully structured, easy to build, debug and extend application.
First donwload symfony and extract into your web root.
Database: Some tools allow you to build a database graphically (for instance Fabforce’s Dbdesigner) and generate directly a schema.xml (with DB Designer 4 TO Propel Schema Converter).



Excellent eid this time
December 9, 2008, 11:02 pm
Filed under: It's My Life | Tags:

it’s after a long long long period of time my luck favor me to attend eid in my village where i born. in my childhood, along with my parents we had enjoyed around 2-4 weeks in our village many times. but we were unable to go village for eid last 3/4 years or more. lastly i manage somehow and enjoy eid with nearest relatives.
eid morning was not good enough for me due to tiredness for sleepless night. one of my cousin come back from malaysia and we travel from dhaka to bogra full night. as a result we were unable to sleep at night. however, start eid day by bath, breakfast and preparation for eid ga moidan. it as far away (around 2 km) from our home. only way of communication is walk. ha ha. but not boring at all. it was really peaceful. really plesend walking. it take around 20 minute to reach at eid ga moidan. it’s nothing special and very general by decoration and arrangement. but for me it’s special because this place is known to me from my childhood. i had been there many many times in my childhood. accomplish eid prayer with all villagers (although it wasn’t huge in number) and come back to home.
now the main part of eid ul ajha. KURBANI. all cow and goats were arranged in a field for kurbani. it took around 2-3 hours for all villagers. when all task had been finished it was around 2 PM. now the festival enjoyment. reception party all around. food, food and food. eating eating and eating… ha ha ha. Goat meet and beaf all around. finally yes!! it’s a great day for me and i am totally pleased with my luck :)