Experiences of developing a project based on ubuntu

Source: Internet
Author: User
Developed a project based on ubuntu-general Linux technology-Linux programming and kernel information. The following is a detailed description. This project is to develop a Linux platform C/S structure examination system. Because I prefer the C language, GTK is used.

To improve efficiency, I decided to use anjuta. For the graphic interface, I used glade to draw the relevant interface, build the source code, and then add the source code to the interface. in c, if you use glade + anjuta for development, it will be troublesome to modify the interface later.

Just a few minutes to talk about Smile.

1. display Chinese content
UTF-8 encoding is required for GTK to display Chinese characters. Considering that the interface content of the client is relatively simple, the client can be directly embedded into the code. But in make dist, but no matter how the same (because the rpm package needs to be made), so all the Chinese UTF-8 part is separated, create a msg_cn.c file, use # define to process all Chinese content, so make dist passes smoothly. (I don't know why ). In addition, the server of the system has a selection function, which is to obtain the question content from mysql. To support UTF-8, mysql uses version 4.1 or later. By default, the encoding obtained from mysql is latin1 (mysql encoding is a very tedious problem). Later I found that the encoding in mysql is configured in four layers, to obtain UTF-8 encoded content, Run "set names utf8" before the connection, and define the data connection as utf8.

2. Development Process
For GTK controls, I also check the manual and solve the problem. I also often ask alpher (the author of The Link in Linux. In fact, GTK is similar to the form in HTML. When some attributes do not know how to handle them, I simply use glade to pull out the related controls and then look for the attributes or signals.

3. What is the Registry in Linux?
This test system involves modifying some attributes of linux, such as modifying the desktop and font. At first, I thought it was. the gnome file contains related configuration files. Later, gconf was found on baidu. After gconf-edit was opened with the command, a series of gnome attribute values were saved in it, it is almost the same as the Registry in windows, so it is more convenient to find the gconf development interface.

4. OpenOffice development interface?
This examination system involves modifying the odt document. During the scoring process, you need to judge the examinee's operation results. At that time, you still want to perform full-text matching, later I found that all files in openoffice are zip packages (for example, foo. odt can be directly decompressed after being changed to foo.zip.) The compressed package contains a series of XML files, which suddenly reminds me of the odf protocol. You only need to judge the XML Attribute content.

5. About anjuta
Because I am not familiar with the automake configuration files, many file installations that involve Unexpected Source Code do not know how to handle them through anjuta. For example, I need to install the log folder to a certain location, you can only use shell scripts. Run this script by modifying makefile. am. Anjuta should be able to continue to improve, hoping that the future version will be more powerful. Compared with the previous version, anjuta2.0 has changed a lot and replaced the project. anjuta file. By default, libglade is not used to process the graphic interface.

Think of this. This project includes the server, client, and marking program, which will be used as the linux version of the Computer Rank Examination System in the future. First, it is implemented in Zhejiang Province. I developed 20 thousand lines of code independently. It lasted for a month because I had to manage the LUPA community, but I hope more people will help me in the future. It makes a lot of effort to educate and popularize linux.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.