About Programming Life During GSoC

During this three-month programming life, what I have worked on is the project aimed to integrate Cloud Input in ibus-libpinyin. Although what I am responsible for is only a small part of the great project, I still benefit a lot from this project.

Since coding, I have got connected with GLib, GIO and libsoup.

GLib provides core application components for libraries and programs written in C. It provides the core object system used in GNOME, the implementation of the main loop, and a full set of utility functions for operating strings and common data structures.

GIO provides a easy-to-use VFS API that sits at the right level in the library stack, as well as other generally useful APIs for desktop applications (such as networking and D-Bus support).

Libsoup is an HTTP client / server library for GNOME. It uses GObjects and glib main loop to integrate well with GNOME programs.

I have learned some of components already in a short time, like String Utility Functions in GLib, GIOStream in GIO, and SoupMessage, SoupRequest and SoupSession in libsoup.

In this project, my mentors have introduced these tools to me, and then I choose some of components which I think is useful at first and learn that by Reference Manual pages. By reading these tools’ cases,  I wrote small examples to learn these components better, and have learned how to use them, such as how to visit HTTP by SoupSession either Sync or Async, and how to get the request result through I/O.

After a brief understanding of their usage,then I have concepedt design under the mentor epico’s guidance. What I mainly involve is the candidates part, so I build the Class CloudCandidates. At the beginning,  the deep learning of the project is critical, especially the other candidates part of inheritance,  their function and members. Secondly I should concept new Class CloudCandidates which is used to process and select candidates from Google and Baidu pinyin API according similar candidates’ classes.  Thirdly,  Storing the new candidates(refers to cloud candidates), and display that in lookup table. During this part, being familiar with the parameters of request-send and the data structure of result-get also counts. Of course, knowing the candidates caller is quite useful. The last but not the least, seleting the valid cloud candidates.

Of course, I have met a lot of challenges in this coding period. When the difficulty of understand code came to me, I turn to mentors for help or list and refer to the outline of relationship in classes. Sometimes good effect didn’t come to me as expected, I’d like to change codes and assert that in smaller parts to detect effect in order to identify the wrong parts. After all of these trials, I preferred to turn to mentors for good advice. Till now, the biggest challenge is changing sync to async for its advantages.

There’s no denying that, from getting contact with the project to building new class and apply my thoughts into it gradually, I have knew to what the better code style is and how to build new rational class on pre-existing code. Beside, by hands-on learning, I can distinguish details between synchronization and asynchronization, and so on. All these will be of great benefit to my future coding life, I think. Without exaggeration, GSoC is quite exciting, fun, inspiring and cheering, for me.

 

On my personal part in the project, there is still room for improvement. So I’d like to polish it sequentially later on. For example, the parsing part in step 3 should be general and efficient. The part of access to the network may can use GIO tools instead of libsoup.

Here is my project link. Welcome any correctionhttps://github.com/lianna07/ibus-libpinyin.

This is the original rendering.
This is the settings’ part of cloud input candidates.
This is the result of cloud candidate’s part. (Currently, the second candidate  is the cloud one)

发表评论

电子邮件地址不会被公开。 必填项已用*标注