Thursday, April 23, 2009

Blog It!

In most of the cases, developers tend to blog or document the smartest stuff they have developed or found. Yes, we do. But at the same time, the solutions for the silly problems are harder to find, than those for the toughest problems. I think it is a good idea to blog about those silly mistakes we make each day, as they will definitely help someone over there damaging his head with the same issue. People mention it or not, the simple mistakes we make in computing, may be in building a project or some coding stuff, are to a considerable level, common mistakes!
Web 2.0 paradigm shift is becoming more obvious, I should say. I feel I am becoming more an information producer nowadays than being the consumer, and given below is just a proof.

Now we need a better uplink than the downlink, as active contributors to the Internet. Let's blog for the sake of sharing the knowledge and content with the world!

Monday, April 20, 2009

[GSoC 2009] Port AbiWord for Windows to Unicode

It's very nice to see me got selected for GSoC2009. And Abiword is one of the world's best and dedicated Open Source Organizations. I feel really honoured to join the Abi Team. 5 GSoC applicants have been selected for Abiword this time too, as usual (This was the case for the last 3 years).

My Project : Port AbiWord for Windows to Unicode

Project Proposal

Mentor : Mr.Dominic Lachowicz


List of Selected students for Abiword can be found here.

It's great to have a chance of getting a task that we prefer personally. GSoC offers us this opportunity. At this time, I have to consider more on my upcoming schedule and I will be following my project proposal time line for that.

I have to mention the great help offered to me during March and April by the Abiword developers. sum1, Robert Staudinger, Dominic Lachowicz, and Jordi Mas were always providing help and guidelines, whenever required, encouraging me and the other applicants.

Congratz to all my friends from University of Moratuwa who got selected for GSoC2009 and all the selected applicants for Abiword.

Awaiting an exciting summer!
Thank you.

Saturday, April 18, 2009

Crossbuilding AbiWord for Win32 using Ubuntu / Wine

Provided that you have Wine installed on Linux, you can follow these steps to build Abiword for your windows. 

(1) Install mingw. 

On ubuntu you need the packages mingw32, mingw32-binutils and mingw32-runtime 

$ sudo apt-get install mingw32 

 This will install mingw32 with the other two (mingw32-binutils and mingw32-runtime) dependencies. 

(2) Get all the dependencies in place.  

Robert Staudinger has packed them and made them available here

If this file is moved to somewhere else, when you are trying, you can alternatively download it here

Now unpack it in /opt. You will get /opt/win32 as base dir for the win32 stuff. 

(3) At the time of writing, I faced some problem in src/af/xap/xp/xap_Module.h 

The issue is solved here

An update (May 10th 2009): This issue is resolved now in the trunk. 

(4) Now use the commands to finally crossbuild:

1. source /opt/win32/bin/mingw-env.sh Go to to source tree and run 

2. CPPFLAGS="-I/opt/win32/include" ./autogen.sh --prefix=/opt/abiword --host=i686-pc-linux-gnuaout --target=i586-mingw32msvc *** when cross-building with robsta's pack if it demands for libtool, automake, or fribidi, a sudo apt-get install of these three will solve the issue (for Ubuntu). 

3. make 

abiword.exe will end up in src/. You need to copy it to /opt/win32/bin to run it under wine, or alternatively copy all the required DLLs to src/. 

Now you can take the directory containing abiword.exe to your windows machine to run Abiword.exe, which you have built just now!  

The Original Research by Robert Staudinger can be found here.

Facebook? Have a backup somewhere else!

I have seen many friends having interesting notes or even important details about their projects in Facebook. It should always be kept in mind, Facebook is not a safe place to store the important materials at all. There may be some security issues in Facebook. But here I am not talking about them. The problem I see with Facebook is their policy of banning accounts.

Being a super active user is more than enough for an account to be banned. If someone tries to make others aware about his activities or projects by posting several links or wall posts in Facebook groups, it is considered spamming. Having 5000+ friends or being a member of 200+ groups are valid reasons for banning you. In case, if you are banned, you may not get your account back. In that case, all the important data in your Facebook profile will be lost forever, including your notes, photos, friends list, and their contact details.

It is always better to start a blog in blogger or similar free blogging providers and then you can import notes from the blog to Facebook. In this way, you can make sure that your notes are safe, at the same time, they are shared with your friends via Facebook. Same applies to the photos. You can share your photos in Picasa or other photo album services using Facebook.

The moral of this story: We can use Facebook to share, but should have the original material somewhere else safe. Facebook is not a place to store your data!

Thursday, April 16, 2009

Abiword Screenshots

I have recently built Abiword using Wine/Ubuntu and using MSVS2008 apart from the typical Linux build. Since Microsoft Visual Studio build has not been completed yet (The sub menus missing yet, and hence currently under development), it seems cross building is a good option for building Abiword for Windows.


Snapshot 1: Abiword built using Wine, running on Ubuntu



Snapshot 2: Abiword.exe built above is now running on Windows



Snapshot 3: See the difference of Abiword built using Ubuntu (the standard build process), and using Ubuntu/Wine cross building, running on Ubuntu

Building Abiword Using Wine on Ubuntu

--- src/af/xap/xp/Original_xap_Module.h 2009-04-03 18:55:06.000000000 +0530
+++ src/af/xap/xp/xap_Module.h 2009-04-16 12:16:01.000000000 +0530
@@ -52,7 +52,7 @@
// we want to have C linkage for both
// this and for all of our required functions
extern "C" {
- typedef ABI_EXPORT struct {
+ typedef struct {
const char * name;
const char * desc;
const char * version;





After applying the above diff file, Abiword is successfully built using wine, and now happily running on Ubuntu!

More information can be found here.

Wednesday, April 15, 2009

Internationalization & Localization

Internationalization (i18n) - The process of designing a software application so that it can be adapted to various languages and regions without engineering changes.

localization (L10n) - The process of adapting software for a specific region or language by adding locale-specific components and translating text.

globalization (g11n) / Native Language Support (NLS) - The combination of internationalization and localization.

Locale - A set of parameters that defines the user's language, country and any special variant preferences that the user wants to see in their user interface.

Localizability (L12y) - The degree to which a software product can be localized.

Resource - Part of a program which can appear to the user or be changed or configured by the user, and this is the data of the program, opposed to its code.

Core product - The language independent portion of a software product.



Compiled from:
* Wikipedia
* Mozilla Internationalization & Localization Guidelines

Monday, April 13, 2009

Transliteration ~ Google and more ..

Google Transliterator
You may have already used Google's Indic Transliterator to type in the languages [Hindi, Kannada, Malayalam, Tamil, Telugu] using English characters. Transliteration tools, apart from providing the ability to type in Unicode, gives one more advantage. That is, one who can speak, yet can't write in a language can easily type in these languages by using the equivalent characters in English. While transliterating, suggestions are also provided so that we can choose one of them, in case of the confusion.

Google Transliterator can even convert the numbers typed in the Standard Hindu Arabic Numeral System to the local numeric systems specific to those language communities. This shows that Google Indic Transliterator is not just a transliterating utility.


Hindu Arabic Numbers : 0 1 2 3 4 5 6 7 8 9
Hindi : ० १ २ ३ ४ ५ ६ ७ ८ ९
Kannada : ೦ ೧ ೨ ೩ ೪ ೫ ೬ ೭ ೮ ೯
Malayalam : ൦ ൧ ൨ ൩ ൪ ൫ ൬ ൭ ൮ ൯
Tamil : ௦ ௧ ௨ ௩ ௪ ௫ ௬ ௭ ௮ ௯
Telugu : ౦ ౧ ౨ ౩ ౪ ౫ ౬ ౭ ౮ ౯

Update as on 2010 March:
A recent visit to the Google transliterator showed me that now transliteration is possible even for languages not from Indic language family as well, including Arabic, Russian and Amharic (Ethiopian). Hence it should be noted that Google transliterator is no more a mere Indic transliterator. With more features, Google's transliterator stands as a standard online rich text editor at the moment.


UCSC Unicode Real Time Font Conversion Utility
Similar researches are done at University of Colombo School of Computing, Sri Lanka, and a Unicode Real Time Font Conversion Utility is being built. It provides us ways of typing in Sri Lankan languages Sinhala and Tamil, in Unicode. Apart from transliteration, it can also convert the non-unicode Sinhala/Tamil fonts that are mostly used in word processing into unicode, thus providing easy way to convert the stuff that were earlier typed in non-unicode fonts into the unicode representation.

Saturday, April 11, 2009

Use of Unicode in AbiWord - Initial Discussions

This is a mail thread in the unicode mailing list started by one of the Abiword developers during the earliest stages of Abiword.
http://unicode.org/mail-arch/unicode-ml/Archives-Old/UML014/0787.html
This thread contains a huge array of the discussions on the topic.
Even if you are not an Abiword developer, this mail thread is a good one to have a look, since it has many important views of many developers about Unicode applications.

Monday, April 6, 2009

Changes for building Abiword in MSVC2008 [Thanks to sum1]

Index: src/af/xap/win/xap_Win32Dlg_About.cpp
===================================================================
--- src/af/xap/win/xap_Win32Dlg_About.cpp (revision 26019)
+++ src/af/xap/win/xap_Win32Dlg_About.cpp (working copy)
@@ -45,8 +45,8 @@

/*****************************************************************/

-extern unsigned char g_pngSidebar[]; // see ap_wp_sidebar.cpp
-extern unsigned long g_pngSidebar_sizeof; // see ap_wp_sidebar.cpp
+/*extern*/ unsigned char g_pngSidebar[1]; // see ap_wp_sidebar.cpp
+/*extern*/ unsigned long g_pngSidebar_sizeof = 1; // see ap_wp_sidebar.cpp

bool XAP_Win32Dialog_About::s_bEventLoopDone;

Index: src/wp/main/xp/abi_ver.cpp
===================================================================
--- src/wp/main/xp/abi_ver.cpp (revision 26019)
+++ src/wp/main/xp/abi_ver.cpp (working copy)
@@ -41,7 +41,7 @@
#endif /* ABI_BUILD_TARGET */

const char* XAP_App::s_szBuild_ID = ABI_BUILD_ID;
-const char* XAP_App::s_szAbiSuite_Home = ABIWORD_DATADIR;
+const char* XAP_App::s_szAbiSuite_Home = "";//ABIWORD_DATADIR;
const char* XAP_App::s_szBuild_Version = ABI_BUILD_VERSION;
const char* XAP_App::s_szBuild_Options = ABI_BUILD_OPTIONS;
const char* XAP_App::s_szBuild_Target = ABI_BUILD_TARGET;


======================================================================




Update as on October 2009:


When I tried to build Abiword using MSVC 2008, I got this error.

------ Build started: Project: LibAbiWord, Configuration: Debug Win32 ------

Compiling...

ap_wp_sidebar_static.cpp

Linking...

ap_wp_sidebar_static.obj : error LNK2005: "unsigned char * g_pngSidebar" (?g_pngSidebar@@3PAEA) already defined in xap_Win32Dlg_About.obj

ap_wp_sidebar_static.obj : error LNK2005: "unsigned long g_pngSidebar_sizeof" (?g_pngSidebar_sizeof@@3KA) already defined in xap_Win32Dlg_About.obj

Creating library C:\abi-trunk\msvc-2008\Debug\bin\LibAbiWord.lib and object C:\abi-trunk\msvc-2008\Debug\bin\LibAbiWord.exp

C:\abi-trunk\msvc-2008\Debug\bin\LibAbiWord.dll : fatal error LNK1169: one or more multiply defined symbols found

Build log was saved at "file://c:\abi-trunk\msvc-2008\LibAbiWord\Debug\BuildLog.htm"

LibAbiWord - 3 error(s), 0 warning(s)

------ Build started: Project: PluginOpendocument, Configuration: Debug Win32 ------

Linking...

LINK : C:\abi-trunk\msvc-2008\Debug\plugins\PluginOpendocument.dll not found or not built by the last incremental link; performing full link

Creating library C:\abi-trunk\msvc-2008\Debug\plugins\PluginOpendocument.lib and object C:\abi-trunk\msvc-2008\Debug\plugins\PluginOpendocument.exp

Embedding manifest...

Build log was saved at "file://c:\abi-trunk\msvc-2008\PluginOpendocument\Debug\BuildLog.htm"

PluginOpendocument - 0 error(s), 0 warning(s)

========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I replaced C:\abi-trunk\src\af\xap\win\xap_Win32Dlg_About.cpp with this. That gave me a rapid solution to the issue, but which is not the real fix for the issue I faced, of course.

Building Abiword using MSVC2008 Express Edition


Using sum1's suggestions I have succeeded in building Abiword in Windows also.
http://pastebin.ca/1382828

Still some errors in the menu items, that the sub menus are not shown.

I will work on this and rectify this issue.

Sunday, April 5, 2009

Useful links for newbie Abiword Developers and students

If you are a newbie, read this first:
http://www.abisource.com/developers/

If you find a bug or rfe, feel free to use Bugzilla, and report an issue with the relevant information:
http://bugzilla.abisource.com/

In case the issue is already there in the BugZilla database, cast a vote for the issue to make the team aware that the issue is popular and/or important.

The SVN Location:
http://svn.abisource.com/

If you want to contribute to the translation efforts:
http://www.abisource.com/contribute/translate/

If you want to download Abiword as a user:
http://www.abisource.com/download/

Building Abiword for Debian based Linux distributions:
http://abisource.com/wiki/Compiling_AbiWord

To build Abiword on Windows:
Using Visual C++:
Developing AbiWord on Windows using Visual C++

Building AbiWord 2.8 on Windows

If you find any issue as a user or developer, feel free to contact Abi team on irc:
irc://irc.gnome.org#abiword

Joining relevant Mailing lists according to your requirements is always recommended:
To join: http://www.abisource.com/developers/
Mail Archives: http://www.abisource.com/mailinglists/

Thursday, April 2, 2009

Abiword for Windows

Abiword is a free and open source word processing program, written using C++ and for a smaller extent C. It is light weight and adapted for use with the One Laptop Per Child system. Abiword runs on many operating systems, including Linux, Mac OS X (PowerPC), Microsoft Windows, and ReactOS. By maintaining its compact size, low memory consumption, and low start-up delay, Abiword is successfully competing with the other well known word processors.

Abiword for Windows is an ANSI application. Porting Abiword completely to Unicode has been considered for a very long time. Earlier researches have been made to maintain Abiword that can be built for both the ANSI and Unicode API. As with the time the earlier versions of Microsoft have become obsolete so that this project targets to port the existing ANSI application to a Unicode only build of Abiword for Windows.

Different issues faced while using the ANSI build will be addressed while converting Abiword into Unicode API. The Unicode application will require Windows NT and the later versions, and for the earlier versions users have to choose the ANSI stable version back to 2.4.6. This Unicode build will use the Multilingual User Interface feature available since the Windows 2000 operating system.

Abiword for Windows Unicode build will need to be tested using the non-Latin text. Unicode only languages and multilingual support will be achieved through this project, while solving many of the issues that were introduced due to the usage ANSI Controls in UI.

Wednesday, April 1, 2009

svn export

While I was checking out the svn, it failed in the middle with the message:

svn: In directory 'wv\examples'
svn: Error processing command 'readonly' in 'wv\examples'
svn: Can't set file 'wv\examples\.svn\text-base\this-file-crashes-msword.doc.svn
-base' read-only: The system cannot find the file specified.


No ideas yet...

Later just used "svn export" for each file that yet to be downloaded, and downloaded them one by one, and got all those missing files!

How to apply/create an svn patch (for beginners)

To apply an svn patch (your_patch_file.patch) go to the root of your source directory, and place the patch there. (or you can specify the location of the patch with the patch name if it is not placed in the root of the source tree.)
patch -p0 < your_patch_file.patch
Similarly if you have modified the source tree, and want to create a patch for the changes that you made, from the source root:
svn diff > your_patch_file.patch
or giving the files/folders that you need to get the diff of, along with their relative path.
svn diff path1/file1 path2/file2 path3/file3 > your_patch_file.patch

your_patch_file.patch will be created inside the root of the source tree. (You may specify the location too, as usual)

Similarly,
How to get the svn diff between two commits?

svn diff -r 5224:5225 > your_patch_file.patch
gets the commit 5225 for the particular directory.

svn diff -r oldversion:newversion files > your_patch_file.patch
gets the diff between the commits newversion and oldversion.