Showing posts with label Thoughts. Show all posts
Showing posts with label Thoughts. Show all posts

Friday, January 4, 2013

Replication of local Database to live Database

Recently i was working for one of the Government Office's Intranet based software. I had to develop a module "Sync Database to live". It was only replication (from Localhost to live site).

Mysql has replication feature. As i had little time to implement so i thought understanding of it and implementing into project will take me longer time. Then i developed my own module. Which i m going to describe here.

Firstly i prepared array of tables which are need to be replicated.
 e.g : $tables = array('authors','book_authors','publication','books','book_category');

Using PHPExcel, I generated the  multi-sheet excel file with all the data from given tables in respective sheet dynamically.

Using cURL, I uploaded excel file to target  (live server). Then i had to run a script in live server via cURL which reads the excel file and insert data to respective tables of live database.


        $ch = curl_init();
        $data = array('file' => "@$filepath");
        curl_setopt($ch, CURLOPT_URL, 'http://localhost/upload/upload.php');
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

        curl_exec($ch);

Sending @ before the filepath makes sure that cURL sends the file as a part of a “multipart/form-data” post. That was what i exactly needed.

Wednesday, December 29, 2010

IDEA that can change the "YOUTH"

 Five points that can change the youth (with the perspective of Information technology):

1)develop a platform, where all youth can participate n can share their problem about making right decision  at  right time, what their family wants from them and importantly what they wants themself in their life.

2)Individual counceling through a radio program. Program that is dedicated to youth, wher there will be lots of discussion concerning about the how youth can be benifited from education  i.e involvement of youth in science and technology....so that they can develop their career in Information and Technology field.

3)personal from IT sector(engineers, software developers, network engineers, professors, system admin) can give a presentation for group of youth or in selected school where they give their presentation on challeenges and future in IT.they can develop  interest of student in IT, motivation is the key factor to attract the student in IT sector.they will explore what is the benifit of IT......in their presentation and youth can be attracted.

4)Concept of E- Library in school. Students can know lots of things about Information technology with the use of computer.Indirectly that will help to change in behavoir of student and enthusiasm to know new thing, innovative idea and eager to know new things will develop. "Learning by doing" ultimately youth can be surely attracted in IT field.

5)Make a group of Youth(every youth are having some sorts of problems,ie what is their intrest and what they exactly wants to become in future). Start a discussion about their problems, they will share individual problems in group and will discuss what could be the solution of problems and ofcourse you can be one facilitator to them.
Conclusion:
Its not necessary for every students ( youth ) to go to science and technology  field but if most of youth are from science and technology background, it  will be easy to develop the nation."Engineers moves the nation ahead". More the engineers, fast will be the development of nation. For this all, there should be political stability and proper policies to utilise educated manpower and technomanagerial personals with in the country.