May 06, 2012

Kathiravelu Pradeeban: "Reading Level" ~ Google gets more interesting!

"Verbatim" and "Reading Level" are two new cool search tools from Google. Verbatim lets us search the exact term as it is, eliminating the spelling corrections, and all the smart features of Google.

Reading Level
"Reading Level" categorizes the search results according to the level of expertise needed in reading the page. Simple and easy-to-comprehend pages are categorized as "Basic", where the advanced and high-standard pages are categorized "Advanced". "Intermediate" stays in between. Highly technical or articles with complex language structures are often categorized as "Advanced".

I searched "Kathiravelu Pradeeban" using Reading Level, and found the below.
Basic - 10%
Intermediate  - 80%
Advanced - 11%

Similarly, searched a few projects that I am interested in.
AbiWord
Basic - 14%
Intermediate  - 83%
Advanced - 3%

OGSA-DAI
Basic < 1%
Intermediate 11%
Advanced 89%

It is pretty reasonable to have the highly complex and technically advanced OGSA-DAI to have more pages classified as "Advanced" and only a tiny bit classified as "Basic". However, AbiWord, the word processor has more contennt classified as "Intermediate". This again is reasonable for an end-reason software product. Google Reading Level is surely an interesting feature.

May 01, 2012

Kathiravelu Pradeeban: Apache Meetup, Kandy and Community Matters!

Yesterday (28th April, 10 a.m. - 4.30 p.m.) we had an Apache Meetup at the Engineering Faculty of the University of Peradeniya. It was an excellent event, which followed the recent Apache BarCamp, Colombo. I presented how to build a new open source community for the audience. The presentation was titled, "Community Matters!!!111" and was based on "Community Matters," the GSoC Mentor Summit discussion that I coordinated.

If the presentation below takes a long time to load, feel free to download it!
Community Matters!!!111
View more presentations from Kathiravelu Pradeeban

April 26, 2012

Kathiravelu Pradeeban: Google Summer of Code 2012 and AbiWord

Being a mentor for the Google Summer of Code with AbiWord for the second time is going to be an interesting experience once more. It was a nice memory going through all the 29 proposals for AbiWord and reviewing them as a mentor. Selected students were announced by Google on 1900UTC, 23rd of April.

The list of accepted students, along with their project proposals as well as their mentors are given below.

1) Tanya Guza - "Improve ODF support"  - Mentored by Hub
2) Kousik Kumar - "Table Improvements" - Mentored by Simon
3) Aaditya - "Implement Rotated Text" - Mentored by Martin
4) Vincent (Zuyin Kang) - "Dialog improvements" - Mentored by Pradeeban
5) Bafna - "Implement and Improve the import and export of math from/to odt, doc & docx formats" - Mentored by Jean
6) Serhatkiyak - "Improving Abiword's OpenXML(.docx) support" - Mentored by Dom
An interesting point to notice is that, since 2006, AbiWord has successfully been participated in all the Google Summer of Codes (2006, 2007, 2008, 2009, 2010, 2011, and 2012). Hence this becomes the 7th consecutive year for AbiWord to participate in Google Summer of Code! I wish the 6 students who got selected a great summer of code with AbiWord, and I hope they will continue to be a long term contributors even after their summer. At the same time, I should also note that, we had to miss a few nice students as we have only 6 slots. Hope they will still continue with their development on AbiWord.

April 23, 2012

Fridrich Strba: Google Summer of Code 2012 - accepted projects for LibreOffice

fridrich.png

Google announced today the accepted students for Google Summer of Code 2011.

The students working on LibreOffice will be:

StudentTitleMentor
Andrzej HuntSmartphone remote control for LibreOffice ImpressMuthu Subramanian
ArturoPLTooling - More and better tests Michael Stahl
Brennan VincentImplementing a Microsoft Publisher import filter for LibreOfficeValek Filippov
Daniel BankstonCalc Performance ImprovementsKohei Yoshida
Daniel KorostilLightproof improvementsLászló Németh
Gökcen EraslanSigned PDF exportStephan Bergmann
iainbJava GUI for Libre-Office Based Android App(s)Tor Lillqvist
Marco CecchettiEnhanced Impress svg export filterThorsten Behrens
Matúš KukanTelepathy for collaborationEike Rathke (erAck)
RafaelNew templates picking UICédric Bosdonnat

Let the summer start immediately and let quality code fall like a spring rain!

April 09, 2012

Hubert Figuiere: On Facebook buying Instagram

hub.png

This morning we learned that Facebook bought Instagram, and that Facebook paid something like 1B$. I'll skip the part where I find that this acquisition is highly overpriced, and I'll leave the speculation of who might have participated into a bidding to the analyst.

But one thing I'm sure is that they didn't buy Instagram for its revenue. What is being said is that Facebook paid 33$ per user, and quite a number of users. But what will they do with that? Simple. Monetize. And this might by the solution to my criticism of Instagram: adding a web frontend to it. A web frontend is IMHO the easiest way for Facebook to track their users. In the announcement Facebook promised to keep Instagram a separate entity, but even the owe anybody but themselves to hold that promise, they can do that and track users using a web based frontend, like all the "Like" buttons to all over the Internet. Similarly I don't see why they should remove the function to Tweet the picture. Quite the opposite, keep it, people click to view the picture, "leave" Twitter to go to that Instagram page, and voila. Checked in.

In the end, it will be a bit more like the Hotel California: you can check out anytime, but you can never leave.

If you don't like that, you can still go and request your account to be removed.

Mandatory Instagram. Deep Cove, BC.

April 06, 2012

Hubert Figuiere: On Instagram

hub.png

Instagram just released the Android version of their application. Instagram allows you to take pictures with your phone, apply some filters, upload it to their service and then have user that follow you comment or favorite them. A sort of Twitter for images.

This led me to rethink why I dislike Instagram.

I dislike Instagram not because of the photographic aspect of applying random filter to random pictures to try to let them look cool, not because it is (was) an exclusive club for iOS users, users that are self entitled and angry[1] as there are also plenty of talented people whose work I have a lot of respect for. No, it is not about that ; well it could be but that would be a very opiniated rant that would make me look like a hater. It is about the technical aspect: it is not the web.

Let's see.

If I go to the main website of Instagram, I get offered to download the app for iPhone, for Android, and beside info about them, their blog, their jobs, all I can do is edit my account. Yes you got that: it is about taking and posting picture, and from there I can't even view anything. WAT?

Now when people share their Instagram picture on twitter, you get a link like this http://instagr.am/p/JAqNexzGZr/. At that URL, you can see the picture, the comments if any, and that's it. You can not decide to start following the person even if you have an account nor can you browse through the other pictures. And to get that URL I had to "share" the image view e-mail or Twitter. There was no other way to get it.

That's exactly where my issue is. One has to use the app on your phone (previously only iPhone - even though it worked with other iOS devices including iPad) to view the pictures and the people. It is not a web application, it is Instagram. Imagine if Facebook or Twitter was like that? It is not like technology is missing. All the browsing and social features can be done as a web application, and modern browser today would allow even the editing part of the picture, and soon the taking a picture part.

And, yes I have an Instagram account, yes I have posted a few pictures from my iPad and from my Nexus One, one having a better camera than the other. Suddenly I got a surge in follower with the Android version released. But what if I wanted to use it from b2g[2]? Even Flickr I can.

Mandatory Instagram:

Notes

[1] read the twitter stream of @AndroidAGram, what he re-tweets is priceless

[2] non-withstanding that the camera capture isn't functional yet on b2g

April 03, 2012

Fridrich Strba: LibreOffice CorelDraw Import filter - the best file-format coverage in the FOSS world

fridrich.png

I just realized that has been a long long time since I last blogged about libcdr and the CorelDraw import filter in LibreOffice. Those that know me well can imagine that it is much more fun to write code then to write blogs. Nonetheless, one serious breakthrough happened this weekend and I cannot prevent myself from climbing on the roofs and shout.

On 20th of March 2012, Corel released a new version of CorelDraw Graphics Suite X6. We got the information from this Wikipedia page and downloaded the evaluation version on Friday. Although it was usual to see the file-format mutate a bit with every released version, this release changed the file-format substantially in what concerns the RIFF chunks. To cut the long story short, we managed to get the last pieces reverse-engineered today and we released libcdr-0.0.6 with support of all 32-bit CorelDraw formats, from version 6 to 16.

The new release tarball was integrated in LibreOffice which became the first and only FOSS application that supports versions 6, 15 and 16 of the CorelDraw file-format. This goodness will be part of our 3.6 release later this year. For those that do not know fear, the feature can be tested in daily builds that will start to appear tomorrow morning here.

I know that the distinguished readership prefers pictures to words. Here is this simple document in CorelDraw X6 format:

Terra in Corel 1  Terra in Corel 2

Here is the same document opened by LibreOffice Draw:

Terra in LibreOffice Draw

And here is the libcdr-generated SVG opened in Inkscape:

Terra in converted to SVG

If you are tempted and think that it might be fun to participate in a reverse-engineering endavour, we have with Valek two project proposals for Google Summer of Code 2012. The first is the implementation of MS Publisher import filter for LibreOffice and the second is to help to improve and extend the Corel Draw import filter I am currently blogging about. Try to apply with LibreOffice and your life will never be the same again.

Be aware though that the application deadline is the 6th of April and you will need to accomplish a simple programing task in order to be eligible. More details in this blog.

March 29, 2012

Hubert Figuiere: Building b2g on Fedora. Field notes - part 2

hub.png

See part 1 if you haven't.

As of this week, some changes in b2g cause more breakage in the build process on Fedora. Plus some various bugs.

First, if when doing the make config-galaxy-s2 you get the following error:

cp: cannot create regular file `../../../vendor/samsung/c1-common/proprietary/etc/mdnie_tune_bypass_mode': No such file or directory

in the B2G directory, do a

mkdir ./glue/gonk/vendor/samsung/c1-common/proprietary/etc

and try again.

Also, make gonk will want to run a pre-build xulrunner in 32-bits

Ideally, the fix would be to actually get a 64-bits xulrunner instead. Patches welcome™ I was told. On your copious-spare-time™.

March 24, 2012

Kathiravelu Pradeeban: GSoC-2012 (The Second Life)


Today we had a Google Summer of Code (GSoC) meetup at the Department of Computer Science and Engineering, University of Moratuwa, 9 am - 3 pm, with multiple presentations and demos. This was the second time I presented the GSoC for the CSE, UoM undergraduates. However, last year the session was held at the IESL auditorium. Hence this year's session was important to all the resource persons, as doing the session at our own department for the very first time. The juniors showed a great enthusiasm, and I am confident that today's session was the best of all the sessions we had so far. 150 heads was recorded as the highest in our GSoC sessions history in today's session.

My GSoC presentation (given above), which went for 80 mins, was themed "The Second Life." We were informed the list of the selected organizations at 12.30 a.m (IST) today, and we had the session at 09.00 a.m. This gave an additional motivation to the students. Not forgetting to update, AbiWord has been selected as a mentoring organization this year as well. I hope to mentor for AbiWord once more.

In a slow network, it may take ages to properly load and display the presentation above. Feel free to download the presentation, in that case.

March 19, 2012

Fridrich Strba: Google Summer of Code at LibreOffice: become famous and maybe rich!

fridrich.png

So, just before the weekend, we received the great news that Google chose LibreOffice as a mentoring organisation for Google Summer of Code again this year. Some of you might remember that last year we had several extremely successful Google Summer of Code projects and that two of our successful students are currently employed working on free and opensource software as a direct consequence of their participation in the program. I had a priviledge to mentor Eilidh McAdam and we implemented a Visio import filter that is one of the flagship features of LibreOffice 3.5. Eilidh is now employed by Lanedo.

This year, we proposed with Valek Filippov two projects related to reverse-engineered file-formats. The first is the implementation of MS Publisher import filter for LibreOffice and the second is to help to improve and extend the Corel Draw import filter that will be part of LibreOffice 3.6 release. Both projects require working knowledge of C++ and a lot of good will. Each of the import filters consists of a standalone library and a glue that plugs the library into LibreOffice. These libraries can be built as system libraries and LibreOffice can use them from the system. The advantage of this approach for a student participating at the development is that there is only a minimum need of recompiling LibreOffice if some substantial part of the glue (that is rather small) changes. Therefore, I encourage all of you who are considering applying with LibreOffice for this year's Google Summer of Code to have a close look at those two projects. As a bonus is that if you are successful, you become famous and eventually rich.

You can have a look at libcdr, the horsepower behind the Corel Draw import filter and at the skeleton of libmspub, that will be the basis of the Publisher import filter. And don't hesitate to become rich and famous with Google Summer of Code at LibreOffice

March 17, 2012

Kathiravelu Pradeeban: Google Summer of Code (The best of both the worlds)

Month of March is so special to me. I was introduced to two great open source projects in March, 2009 (AbiWord) and 2010 (OGSA-DAI).. ♥

Not everyone gets a chance to live........ a second life!
Now, the beauty of open source projects come into play that it gives you a chance to work on something that you are really interested in, in your own way. But not many of us get time to dedicate to an open source project due to our other commitments and as we are busy with our regular work, study, and related activities. The Google Summer of Code (GSoC) gives the best of both the worlds.

Why GSoC?
GSoC is an annual program from Google for the university students of age 18 and more. You will be coding for your preferred open source organization for 3 months. Google coordinates and awards the successful participants. Though open source organizations are run mostly by volunteer developers, Google pays the students with 5000 USD along with a certificate, an awesome t-shirt, and gifts! Hence you can focus entirely on the program during the 3 months time.

3 milestones. 

Some statistics of 2011
Submitted
Accepted

The success rate is pretty high!
Last year, more than 90% of the students passed the mid evaluations, where around 88% passed the final evaluations. The high success rate is because, the mentors and the organization are with the student to provide him assistance and guidance, whenever is needed. 

The passion towards open source and the desire to be an outstanding student are considered to be the major reasons for a student to participate in the Google Summer of Code. Not to mention, while earning the money for the summer.

A computer with the Internet connection, knowledge and experience in the domain, and the motivation are the required to participate. Of course, you should really be interested in contributing to the particular open source organization.

Don't forget to check the
Google Summer of Code™ 2012 Program Timeline


Before you begin..

Technologies

Communicating with the team..
.. and the mentor, over the Internet..

Network Etiquettes

Proper Addressing..over the lists/irc/..

Mailing lists

IRC Etiquettes

Find a mentoring organization..

Find THE right project..    
Once you have found the right organization(s), that matches your interest and expertise, you have to go through the ideas list (e.g: the project ideas of AbiWord).

You can even contribute to the organizations, that aren't selected this year, as most of them still welcome the student contributors. OGSA-DAI had some great project ideas, but wasn't accepted this year as a mentoring organization.
These were the organizations that I had my summer with. The beauty of these organizations is, they are friendly and provide a great learning environment. I was able to become a committer, developer, and mentor for these organizations. I learned open source with these organizations, and they have influenced me a lot positively. Apart from the coding, we always share thoughts and literally the AbiWord and OGSA-DAI communities have given me a colorful second life, which I would love to maintain as a developer, whenever I get a free time from the "first life".

Get to know more about the projects

What makes you special?


Experience

Opportunities..


Apply

Register as a student for GSoC, as the first step. Use the project's wiki for draft proposal, if applicable. Some organizations prefer that, where some discourage it. 

Apply on Google's melange, at the earliest possible, as you can edit it later, till the last minute. Make sure to get the mentors' opinions and improve. Check melange often for the mentors' comments and attend to them. Make sure that you subscribe to the comments on your proposal in the melange site, such that you will receive email alerts for each comment that is made by a mentor/developer on your proposal. Your proposal can only be seen by the orgnization mentors, unless you decide to make it public.

How to impress the mentors/developers?

After the submission..

Got Selected? Community Bonding Period!!!

Don't Panic. You have one more month, just to mingle with the developers and the code base. Mentors are there to help you! Keep touch with the developers and users. Learn the project by going through the code base and documentation such as coding styles and coding guide lines. e.g: OGSA-DAI coding guidelines. This will help you understand the project idea more. Come up with a design and start with simple hacks.

Coding

Finally comes the coding - the easiest task of all. Commit often, if you are given committership. In AbiWord GSoC projects are usually given a branch in the public svn, which will be merged to the trunk, upon the successful completion of the project. In OGSA-DAI, based on the project, it is either committed to the trunk directly or given a branch. These two projects give committership to the students. However, some organizations/projects do not give committer access to the students. In such cases send daily patches otherwise.

When committing or sending the patches, make sure to include meaningful Commit messages. Get feedback from the mentor(s) on your commits or patches frequently. Keep the community updated. Committing or sending patches daily would be a good approach.

Plan for the mid and final evaluations early, with the mentor. This will help you reach the target successfully. You might also need to revisit the project goals if required, during the milestones.



Conclude/Continue

Pencils Down Date - to stop the coding. Still you can refactor and improve the code, fix any last minute bugs, and work on finalizing the documentation. This is follwed by the firm pencils down date, which literally finishes the Google Summer of Code. 

Whatever coding or related job done on your project after the firm pencils down date will not be considered part of your summer of code, and will be considered a volunteer work on the project. Get a tarball of all the diff files to submit to Google. Successful submission of the tarball along with the successful final evaluation ensure your success in the Google Summer of Code.

Focus on becoming a committer if not already given committership. Keep contributing to your project.



A few links
This blog post has gone a bit longer, since I tried to include all the information in a single post. Wish you all the best.

Kathiravelu Pradeeban: Google Summer of Code 2012

Google summer of code
View more presentations from Kathiravelu Pradeeban.
We are having a series of GSoC awareness sessions, including the yesterday's session we had at the University of Peradeniya, and the upcoming session at the University of Jaffna on the 7th of January, 2012. These events focus on discussing GSoC and FOSS. Attached herewith is the latest version of the presentation I prepared to introduce GSoC 2012 to the students. Feel free to download and distribute, if the slow network prevents you viewing the presentation here.

As a mentor from the AbiWord community, I have come up with the slides based on our experience with the Google Summer of Code. This presentation is also influenced by my experience as a three time Google Summer of Code participant, with AbiWord (2011 as a mentor and 2009 as a student) and OMII-UK (2010 as a student). Special thanks to Martin Sevior and the AbiWord community for their valuable input at several times, in shaping this presentation up. 

Make sure to have a look at the Google Summer of Code 2012 project ideas from AbiWord.

The presentations in this blog require Shockwave Flash Plugin to display correctly. If you couldn't see it correctly, make sure you have the required plugin enabled. Feel free to drop a comment should you require further information.

March 14, 2012

Kathiravelu Pradeeban: Google Summer of Code Mentor Summit 2011

Google Summer of Code Mentor Summit
Google invites the mentors for a two day unconference over a weekend to discuss about the Google Summer of Code, the respective projects, FOSS in general, or whatever that is applicable for the set of geeks. Google Summer of Code Mentor Summit is an interesting event hosted by Google and the sessions are scheduled by the attendees themselves. Google pays for the flight and the stay for the two nights (Friday the 21st and Saturday the 22nd of Oct/2011), providing dinner with style for the two nights. The mentor summits are held at the Google Headquarters (Building 43), CA 94043, USA. The event schedule is completed only at the day of the summit, as an ideal unconference! [Have a look at the Mentor Summit 2011  schedule with the parallel unconference tracks]. 

AbiWord at the Summit
As a mentoring organization, AbiWord has been mentoring students for Google Summer of Code since 2006 - for 6 years consecutively, since the program was announced in 2005. In 2006, Martin Sevior represented AbiWord in the mentor summit [Read more on his experience at the mentor summit 2006]. I was, as a mentor from AbiWord for 2011, was really glad to represent AbiWord in  the summit for 2011. This was the second time, AbiWord being present at the summit. This year we had 4 students who successfully completed their summer, among the 5 who had their summer with AbiWord [Read more on my thoughts on Google Summer of Code 2011].


Stay at California
This year, the summit was held on 22nd of October the Saturday and 23rd the Sunday. "WildPalms" and "Domain" were the hotels organized by Google for the stay for the two nights. Most of the mentors stayed at WildPalms, Sunnyvale, CA, where some of them stayed at Domain, as rooms in WildPalms filled up. 2011 was the biggest summit ever with around 360 participants, where it was around 200 last year, mentioned Carol. Wild Palms is a silent and simple hotel. It reminded me the structure of the typical hostels - but I like it. We had shuttles to and from Google. We also had shuttles connecting Domain hotel, for them to join the dinner at Wild Palms.


Scheduling the unconference sessions
The sessions were scheduled and held at different rooms at the Google Headquarters, in parallel tracks. Initially, everyone was given 30 seconds to introduce themselves and their session, to begin with. Each session spans for an hour. A location was picked from the available 16 rooms. Once introduced their sessions, each one writes down the proposed session in a paper, and posts that on the white boards available, which had a table drawn with "Time Intervals" against the "Location". Once everyone introduced and posted their sessions, everyone is given the option to vote for their preferred session. The voting is interesting. We move along the white board, and pick a session of interest for each time frame, and mark it with a circle. Once this is done, the circles are counted and considered a '+1', and the sessions are relocated to fit the size of the room, according to the interested audience. Some sessions had exceptionally huge preference votes, and were scheduled to be held at Tunis, which has room for 200. Other rooms fit the audience from 10 to 20.

Community Matters!!!111
I [my user profile in the wiki] proposed and coordinated the unconference session titled "Community matters", the Saturday 1.30 - 2.30 at "Algiers". We discussed how and why a community matters the most, how to build a community, the challenges faced, and overcoming them. The session notes can be found in the wiki [Needs credentials to access the wiki page].

I have blogged with the session notes for the wider audience [Read "Community Matters!!!111" in this blog]. However, Google Summer of Code mentors can access the wiki to read more about the Mentor Summit 2011. All the session notes are posted to the wiki.


From Sri Lanka
It was a long journey to Sunnyvale from Colombo! I traveled from Colombo (CMB) to Dubai (DXB), and to Los Angeles (LAX), followed by a local flight to San Jose (SJC). A cab from San Jose to Wild Palms is relatively cheaper (~38$), than from San Francisco (SFO). SJC is known as the airport of the Silicon Valley. I stayed one more night (Sunday night), since my flight was on Monday noon 12 pm. This was my first trip to the new world (Americas). It was a great experience seeing darkness at 3 pm in the sky of the north pole.

Mentor Summit
The summit went really well, starting with a warm welcome from Carol Smith, at "Tunis". I got the chance to meet many folks from many organizations, and listen to their interesting and crazy experiences. Everyone had at least a single interesting experience to share, during the tea, breakfast, or lunch. 2011 was the first year for many organizations (~50) in Google Summer of Code, and (the mentors from those organizations whom I had a chat) were impressed to hear the successful involvement of AbiWord in Google Summer of Code. I met Fridrich representing LibreOffice at the summit. It was really great to meet someone whom I have talked to, over the AbiWord IRC.

Haiku
Meeting the Haiku community was remarkable. Haiku is an MIT licensed open source operating system inspired by BeOS. We thought of a possibility to propose a project co-mentored by AbiWord and Haiku for Google Summer of Code 2012 - "Haiku port for AbiWord". There was also a discussion on this during GSoC 2009 too, which we couldn't make it at that time. Scott from Haiku also pointed out that AbiWord used to run perfectly on Haiku during the early days (well before I joined AbiWord at 2009). We have to go back to the history of AbiWord source code and get it back to build and run, which ceased to build. As we are more into gtk, we have never looked much into this yet, I feel. The relevant discussion can be found at abiword-dev mailing list. Refer to the Haiku FAQ to learn what Haiku is and what it is not.

Catroid
All the 4 mentors from the project Catroid were present at the summit. They were doing interesting demos with their Catroid project running on Android, over the corridors during the breaks. It was their first year at Google Summer of Code and Catroid is really excited as a young organization to participate in Google Summer of Code. By default, Google invites two mentors from each project, along with a waiting list to allow more interested mentors in first-come-first-served. Catroid was really lucky to have everyone around! :)


Marketing and Open Source
An interesting session on "Marketing and Spreading the word about the project/community", followed the session "Community Matters", in the same room (Algiers). How localizers help to widen the user community was discussed. The mentor from PostgreSQL mentioned that they have allowed independent local user/dev communities to own the site in their languages (French, Japanese, ..) Social media engagement (twitter, facebook, dzone) to spread the word of the community and project releases were discussed.

Student Salaries
The other two sessions I attended on the first day were on "Humanitarian FOSS", with the participation from OpenMRS, Sahana, and Ushahidi, and "Student Salaries". "Student Salaries" discussed about managing the GSoC's payment. It had a few controversial suggestions followed by a healthy discussion, whether each student should be paid equally, or based on their geographical location, or by the outcomes - a final outcome of the discussion was to propose a reward for the outstanding students - may be a GSoC Student Summit. 

Around Google
We took a group photo with all the mentors around, at the end of the first day. We also move around the Google Campus and also visited the Google Store. A room full of chocolates from Goolge, as well as from the mentors allover the globe was awaiting us throughout the summit! ;). The welcome desk was full of Google TShirts and give aways from Google and from the mentoring organizations - specifically stickers from the organizations. I took a few photos around the Google Campus. Feel free to view them in my Facebook album.

The Second Day
I attended the sessions at Tunis, the second day. "Non-profit infrastructure for software freedom" with the views from Software Freedom Conservancy, Free Software Foundation, and Apache Software Foundation, gave some insights in the non-profit infrastructures. "Fund raising 101" by Cat from Google provided some basic hints on successfully getting the open source project funded.

Wrapping Up!
A final speech from Carol ended the summit in a vote of thanks manner. Wait - No! Mentors were asked to provide their suggestions of improvement after her talk. Some encouraging, interesting and also funny comments were thrown, with room full of laughter and applauses. One interesting and usual suggestion was to have the summit at Europe next year. "I love you guys, but, sometimes, I hate you guys," replied Carol.

The Google Summer of Code Mentor Summit was surely a remarkable experience for everyone who attended. I would like to thank Google and Carol for organizing the Google Summer of Code as well as the summit, on behalf of the AbiWord team.

Kathiravelu Pradeeban: Google Summer of Code awareness session

Google summer of code 2012
View more presentations from Kathiravelu Pradeeban.
Yesterday we had an awareness session for Google Summer of Code (GSoC) at the Engineering Faculty of the University of Peradeniya. This event focussed on discussing GSoC and FOSS. It is an interesting fact that we have visited the University of Peradeniya, after exactly 11 months, for the very same event - Google Summer of Code awareness session. Our previous session was held at the science faculty, on 17th of Jan, 2011.

Attached herewith is my presentation, introducing GSoC 2012 to the students. This slides are based on my experience as a three time Google Summer of Code participant, with AbiWord (2011 as a mentor and 2009 as a student) and OMII-UK (2010 as a student).

In slow network connections, the presentation might take a bit longer to load. In that case, please feel free to download the presentation for your future reference.


Update: Pls find the latest revised version of this presentation at 

March 13, 2012

Hubert Figuiere: Building b2g on Fedora. Field notes

hub.png

Yesterday I tried and successfully built b2g on Fedora 16 x86_64, targeting the emulator. These are my notes on how to do it as the instructions to setup the build environment are very Ubuntu centric.

The prebuilt binaries expect to be on a 32-bits system. So we are gonna need to install 32-bits packages. Also there is a requirement to have adb to boostrap (it is built afterwards). Fortunately you can skip installing the SDK for the bootstrap and use the Fedora package android-tools that provides adb.

The packages you need, that will also pull the proper dependencies are:

To run qemu:

You also need the usual requirements to build Firefox as well as git. Install these using yum.

Then follow the build instructions to build on QEMU.

Enjoy !

(dont forget part 2)

March 12, 2012

Hubert Figuiere: The inconvenience of air travel

hub.png

What is it with airline (and governments) making air travel inconvenient? I don't travel much compared to some other people I know (never got elite status on any airline, and barely got enough miles to get a cheap flight to France), and I never encountered serious issues when flying. But still.

Luggage

Over the last few years a new extortion scheme has appeared: luggage check-in fees. Yes you read it: the airline have decided to charge you a fee to check luggage in. What I don't get is why do they charge you for the inconvenience, which benefit them as with less luggage in cabin they have a more streamlined boarding and de-boarding. That I don't get it. This was started with US based airlines to supposedly compensate for their loss of revenue (it got worse after that), and because Air Canada innovates in air travel, they followed suit. Also the policy being inconsistent, code sharing and other stuff make things even more confusing.

Now I plan cabin luggage only. Not always easy, but utterly more convenient and there is no risk to get the suitcase lost (hello Air Canada) or damaged (hello Air France). I end up being able to bring more gear and inconvenience the airlines even more. I get to learn to pack light.

Food and beverage

Not only you now get charged for food in North America on flights (including long one) but airports are inconvenient to bring your own food or get food (not even asking quality at that point). Case in point, my flight to Toronto from Vancouver left from gate C51 in Vancouver. There, there is no food. You have to walk through the whole terminal to get something. And I have seen other instance of that in other airports. Not mentioning the security theater that decided that carrying a bottle of water was dangerous.

Security theater

Simple put I always go through the metal detector in the same "uniform". And 33% of the time (whichever airport, it is not even dependent on the checkpoint) I get to have the machine beep because of my belt. They probably don't get to recalibrate the machines often which does not inspire confidence in them operating the X-Ray body scanner.

Nickel and diming

If you are tall like me, you have to suck it up or pay. No more emergency exit row, front row and so on. Yep, they charge you for legroom: Air Canada used to be nice with that and Air France being dicks. Now they are just equal opportunities. I'm sure airlines would charge extra for accessibility if they legally could, like they have try to do for overweight people.

The only thing I get is Air Canada charging 3$ for the headphones. Bring your own, that's fair, as they are standard.

March 11, 2012

Kathiravelu Pradeeban: Building AbiWord 2.9.0 on Ubuntu 10.04 / 64 bit from Source

Short and sweet information on this can be found from AbiWord wiki. This post just deals with a few commonest errors found in building AbiWord, when it goes wrong.

As we are happily moving towards the release of AbiWord-3.0.0, many developers are joining the effort. With the announcement of Google Summer of Code-2011, many students too are interested in joining the project. This guide targets to help anyone to build AbiWord on Ubuntu 10.04/64 bit. This is still applicable to many other linux distributions too, though it is tested on Ubuntu. Unlike the usual building guides, this one is going to follow the worst-path -- assuming every failed cases, for a complete novice.. :)
So, as mentioned in the AbiWord's wiki page, let's start with installing autoconf.
sudo apt-get install autoconf

pradeeban@pradeeban:~/programs/abiword$ sh autogen.sh Can't exec "libtoolize": No such file or directory at /usr/bin/autoreconf line 189.
Use of uninitialized value in pattern match (m//) at /usr/bin/autoreconf line 189.

configure.in:130: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.in:131: error: possibly undefined macro: AC_PROG_LIBTOOL
autoreconf: /usr/bin/autoconf failed with exit status: 1
Running ./configure --enable-maintainer-mode ...
configure: error: cannot find install-sh, install.sh, or shtool in "." "./.." "./../.."
==========================================================================================
OK. We need libtool installed!

sudo apt-get install libtool

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

NOW!
pradeeban@pradeeban:~/programs/abiword$ sh autogen.sh
.............................
checking pkg-config is at least version 0.9.0... yes
checking whether gcc understands -Wall... no
checking whether gcc understands -Wextra... no
checking whether gcc understands -Wsign-compare... no
checking whether gcc understands -Wpointer-arith... no
checking whether gcc understands -Wchar-subscripts... no
checking whether gcc understands -Wwrite-strings... no
checking whether gcc understands -Wmissing-noreturn... no
checking whether gcc understands -Wunused... no
checking whether gcc understands -Wpointer-arith... no
checking whether gcc understands -Wshadow... no
checking for libpng... no
checking for libpng14... no
checking for libpng12... no
checking png.h usability... no
checking png.h presence... no
checking for png.h... no
configure: error: `png.h' not found, install libpng or specify CPPFLAGS to include custom locations

As we can see, we will be installing each of the dependencies one by one, if we follow the same steps like this.
But we actually need not to!
pradeeban@pradeeban:~/programs/abiword$ sudo apt-get build-dep abiword
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Note, selecting libwpd8-dev instead of libwpd-dev
Note, selecting libxslt1-dev instead of libxslt-dev
The following NEW packages will be installed:
  build-essential cdbs cvs debhelper diffstat dpkg-dev fakeroot fdupes g++ g++-4.4 gettext html2text intltool intltool-debian libaiksaurus-1.2-0c2a
  libaiksaurus-1.2-data libaiksaurus-1.2-dev libaiksaurusgtk-1.2-0c2a libaiksaurusgtk-1.2-dev libasio-dev libatk1.0-dev libboost-date-time-dev
  libboost-date-time1.40-dev libboost-date-time1.40.0 libboost-dev libboost-regex-dev libboost-regex1.40-dev libboost-regex1.40.0 libboost-serialization1.40-dev
  libboost-serialization1.40.0 libboost1.40-dev libbz2-dev libcairo2-dev libdbus-1-dev libdbus-glib-1-dev libdirectfb-dev libdirectfb-extra libenchant-dev
  libexpat1-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgconf2-dev libgcrypt11-dev libgdome2-0 libgdome2-cpp-smart-dev libgdome2-cpp-smart0c2a
  libgdome2-dev libglade2-dev libglib2.0-dev libgnutls-dev libgoffice-0.8-8 libgoffice-0.8-8-common libgoffice-0.8-dev libgpg-error-dev libgsf-1-dev libgtk2.0-dev
  libgtkmathview-dev libgtkmathview0c2a libgucharmap2-dev libice-dev libicu-dev libidl-dev libidn11-dev libjpeg62-dev liblink-grammar4 liblink-grammar4-dev
  libloudmouth1-dev libmail-sendmail-perl libncurses5-dev liborbit2-dev libots-dev libots0 libpango1.0-dev libpixman-1-dev libpng12-dev libpopt-dev libpsiconv-dev
  libpsiconv6 libpthread-stubs0 libpthread-stubs0-dev libreadline-dev libreadline6-dev librsvg2-dev libsm-dev libsoup2.4-dev libssl-dev libstdc++6-4.4-dev
  libsys-hostname-long-perl libsysfs-dev libt1-dev libt1-doc libtasn1-3-dev libwmf-dev libwpd-stream8c2a libwpd8-dev libwpg-dev libwps-dev libwv-1.2-3 libwv-dev
  libx11-dev libxau-dev libxaw7-dev libxcb-render-util0-dev libxcb-render0-dev libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev
  libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxml2-dev libxmu-dev libxmu-headers libxpm-dev libxrandr-dev libxrender-dev libxslt1-dev libxt-dev
  link-grammar-dictionaries-en orbit2 po-debconf quilt x11proto-composite-dev x11proto-core-dev x11proto-damage-dev x11proto-fixes-dev x11proto-input-dev
  x11proto-kb-dev x11proto-randr-dev x11proto-render-dev x11proto-xext-dev x11proto-xinerama-dev xtrans-dev xz-utils zlib1g-dev
0 upgraded, 140 newly installed, 0 to remove and 3 not upgraded.
Need to get 60.4MB of archives.
After this operation, 269MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
 
Now again,
pradeeban@pradeeban:~/programs/abiword$ sh autogen.sh
.......................................
checking for libpng... yes
checking for PNG... yes
checking jpeglib.h usability... yes
checking jpeglib.h presence... yes
checking for jpeglib.h... yes
checking for jpeg_read_header in -ljpeg... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for DEPS... yes
checking for GTK214... yes
checking for GSFGI... yes
checking for PLUGIN... yes
checking for OPENDOCUMENT... configure: error: Package requirements ( libgsf-1 >= 1.12 redland >= 1.0.10 rasqal >= 0.9.17 ) were not met:

No package 'redland' found
No package 'rasqal' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables OPENDOCUMENT_CFLAGS
and OPENDOCUMENT_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Let's fix the redland RDF dependency issue by installing it.
pradeeban@pradeeban:~$ sudo apt-get install librdf0-dev

again, pradeeban@pradeeban:~/programs/abiword$ sh autogen.sh Now it builds fine!
......................
config.status: creating plugins/ots/xp/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

Configuration:
  host                  x86_64-unknown-linux-gnu
  dynamic binary        yes
  static binary         no
  platform              unix (embedded: no)
  toolkit               gtk
  debug                 no

Optional features:
  menubutton            no
  printing              yes
  spell checking        yes
  status bar            yes
  emacs keybinding      yes
  vi keybinding         yes
  clipart               no
  templates             no

Optional dependencies:
  gtk2 > 2.14           yes
  gnome-vfs             no
  gio            yes
  gsf-gio               yes
  goffice               yes

Builtin plugins        
Plugins                 opendocument

Now type `make' to compile.

pradeeban@pradeeban:~/programs/abiword$ make
"make" goes fine too.
Let's "make install" now!
pradeeban@pradeeban:~/programs/abiword$ make install
...................
test -z "/usr/local/share/abiword-2.9/ui" || /bin/mkdir -p "/usr/local/share/abiword-2.9/ui"
/bin/mkdir: cannot create directory `/usr/local/share/abiword-2.9': Permission denied
make[6]: *** [install-uiDATA] Error 1
make[6]: Leaving directory `/home/pradeeban/programs/abiword/src/af/xap/gtk'
make[5]: *** [install-am] Error 2
make[5]: Leaving directory `/home/pradeeban/programs/abiword/src/af/xap/gtk'
make[4]: *** [install-recursive] Error 1
make[4]: Leaving directory `/home/pradeeban/programs/abiword/src/af/xap/gtk'
make[3]: *** [install-recursive] Error 1
make[3]: Leaving directory `/home/pradeeban/programs/abiword/src/af/xap'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/pradeeban/programs/abiword/src/af'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/pradeeban/programs/abiword/src'
make: *** [install-recursive] Error 1


If this permission issue arises, pls change the write permission of usr/local/share, usr/local/bin, usr/local/include, and usr/include/lib. That will make abiword-2.9 ending up in the above directories respectively.
Again,
pradeeban@pradeeban:~/programs/abiword$ make install
Now it goes fine indeed!

Now let's just run AbiWord from terminal and see whether it runs!
pradeeban@pradeeban:~$ abiword 
abiword: error while loading shared libraries: libabiword-2.9.so: cannot open shared object file: No such file or directory

Typical linking issue.
pradeeban@pradeeban:~$cd /lib
pradeeban@pradeeban:/lib$sudo ln -s /usr/local/lib/libabiword-2.9.so

Now again,
pradeeban@pradeeban:~$ abiword

YAYYY! AbiWord-2.9.0 is running!!!

you also can debug AbiWord using gdb.
pradeeban@pradeeban:~$ gdb abiword


However, my apologies for posting this lengthy post for a simple task. Just followed the worst case to cover all the student queries regarding building AbiWord-2.9.0 from trunk using Linux on terminal.

Kathiravelu Pradeeban: Community Matters!!!111

Google Summer of Code Mentor Summit 2011
We had several interesting unconference sessions and talks at the Google Summer of Code Mentor Summit 2011. I proposed and coordinated the unconference session titled "Community matters", the Saturday 22nd of October 1.30 - 2.30, at the room "Algiers". We had around 12 active participants from multiple organizations, representing AbiWord, Apache, and more.
 
The session notes are recorded in the Google Summer of Code wiki, which needs the log in credentials to access. Hence I summarize the notes again for the wider audience. These notes are from the thoughts of the mentors from the communities involved in the discussion, and they might reflect the communities involved (Hence the points, may of course, disagree to each other to some extend). I represent AbiWord, and hence my views are biased towards the culture of the AbiWord community, which I consider the best of all. ;)

What is a community 
Issues in building a community (and solutions)

March 09, 2012

Hubert Figuiere: CSUN 2012 conference

hub.png

Last week I was in sunny San Diego, CA at the 27th CSUN accessibility conference, part of the Mozilla delegation along with Eitan and Marco. So was a very enlightening event. I'm quite new to accessibility technology and what I saw is an even greater reliance on technologies, for the good and the better.

Beside the usual important work on web accessibility, there was also in multiple occasions discussions about repurposing tools for accessibility need. One concrete example is Google Goggles. This app for Android always seemed to me to be a gadget, but in fact it has proven to be a pretty convenient tools for things like reading bank notes (the US dollar notes don't have braille, unlike the Canadian one). Or face detection in a cell phone camera to take a picture: the framing guided by voice.

Another use was Google own Google+ hangout[1]. Google hangout is for live conversation using sign language. There is in fact a lot of work done to make the video fluid and good enough for that. Video fluidity was also an argument presented by the Apple marketing manager when talking about iOS and FaceTime. Some fantastic stuff.

Android accessibility is a different story. It seems that there is a large difference between 2.3 and 4.0 in term of support, where 4.0 (Ice Cream Sandwich) is going way further. One of the major change is that now accessibility is required for the Android Google Marketplace lock-in. No more stripped down like it was on the Asus Transformer running 3.2. It is unclear however if the skinning that Samsung Touchwiz or HTC Sense UI will be required to be accessible: as it is now, HTC Sense UI actually is forcing to root the phone and have Cyanogen Mod installed in order to be accessible. Also I had a chance to see Eitan's work in Firefox for Android accessibility.

Things I saw: a demo of Windows 8 on a tablet with IE 10. They have accessibility built into with touch discovery and gesture, and video subtitle and captions. I also happen to have tried for the first time a Windows Phone 7 phone and saw a second one on the plane (bound to SEA). iOS devices seems to dominate and the reason is that their approach to accessibility from the ground up is probably the best on the market for non market-specific devices. And they also support bluetooth Braille readers.

It was good to meet with everybody, Ryan, Jenisson, Laura, Kevin, Sina, Victor, Carol, Matt, Richard, Matt, Eitan, Marco, Rainer, Steven, Henny, Denis, Sylvain, Arnaud, TV, Naomi, James, Alice and the rest of the Google team, and many other fantastic people I possibly forget.

I felt so much energy in that conference. So many good things happening. So many to come.

Notes

[1] yes, I also trolled them at the end about the name policing and Nymwars, I had too, and some people thanked me for that

February 26, 2012

Ben Martin: The Nokia N9: Going for a spin

In short, I now have a Nokia n9, and setup a scratchbox for it, and compiled & installed abiword, clawmotia, unison, and libferris for and on the device. If that didn't enlarge your page down key, the longer version now follows ;-)

FWIW my impression of the device is very positive. Hardware wise the biggest issue I have is the inability to add more storage to it. A high gb microsd slotted in would make things a whole bunch nicer, mainly for using the device as a music box on the road. The speed of interaction is very nice, and the swipe interface is very easy to get used to. Just flick an app away to minimize it or flick from another screen edge to close it.

gstreamer works quite nicely for viewing network streams, though there is a deadzone bar on the logical "bottom" of the screen (left of screen in portrait mode). I noticed this bar in abiword too, so I assume it is an issue with going fullscreen for non Qt native apps.

There isn't much to show for unison, as I tend to drive that from the dekstop/laptop end of the connection. Getting it on the device is always a matter for first compiling ocaml and installing that into the scratchbox.

One very pleasant surprise is how snappy clawmotia runs on the n9. Startup time is significantly less than on the n900 and the screen operations like swiping the main controls left to get to the jog shuttle page is now at an acceptably smooth speed. I'll have to work up a video of this in action to show the speed of things...



I got libferris compiled for the n9 too. Using boost::spirit for some of the parsers has dropped one compile time dependency away. I did make both ferris and ferriscreate able to compile in glib2 only mode. You loose one or two apps by doing this, but it also makes the footprint smaller so that I can use it with QML apps without needing to pull in gtk2 from a third party repo just for those apps in ferris itself. Mainly some capplets, gfcreate, and the gfcp and other graphical coreutils reimplementations are lost in building this way.

And what is not complete without a screenshot of things on the device? Sorry for the quality of the picture, I need to work out lighting for some device shots a bit better than this adhoc quick shot. Just to tap into the ferris power a tiny bit I decided to mount an XML file as a filesystem and fcat directly into it.. A few of the fun things I plan are a QML client for index/search using the customized maemo index backend in libferris and using the mounted pulseaudio and mounted gstreamer to implement yet another audio player for the device. The index+search in both these apps should be blisteringly fast, given that I could index an NFS mount with 10x the data I could hold on an n810 and search as you type in real time...



Abiword proved to be the harder thing to compile for the n9. It seems GTK2/3 has fallen off the device so I got gtk2 from a third party repository. The downside is that the app doesn't run entirely fullscreen and has pretty much no finger friendlyness from gtk2 itself. Oh yeah, the virtual keyboard doesn't come up on text entries in gtk2 either. I might be compiling and installing gtk2 incorrectly on the device, so this complaint about device interaction might be my own fault?

I then got libwv and libwmf, following the dependency rabbit down the white hole. Of course my abiword compile has full ODF support in it too! The below screenshot is of one of my sample ODF+RDF documents with the content that links to RDF shown in purple. For more info on RDF in abiword see the abiword talk video from lca 2012.



More fun an games to follow, and I'll post a link to a repo with the debs once I work out where I'm going to host the 100mb odd of files. Not all those are for the device, some are mainly for scratchbox such as the dev packages and full ocaml compiler debs.

February 09, 2012

Fridrich Strba: FOSDEM 2012 - How to make the best of it and become LibreOffice developer

fridrich.png

I'm going to FOSDEM, the Free and Open Source Software Developers' European Meeting

FOSDEM 2012 is just round the corner and, as you might know, LibreOffice will have a DevRoom this year too. And, as it was already publicized, your servant and Eilidh McAdam of libvisio fame will attend too. The goal of this event will be to help you to become a LibreOffice developer, by helping you to get your first contact with the code from inside.

How to prepare for the event?

In order to give as many community members the possibility to speak, the presentations will not take more then 15 minutes each. But we will be there for one-to-one contacts and hacking goodness. If you are interested in contributing to our new Visio import filter, or the upcomming Corel Draw and MS Publisher filters, here is what you can do:

  1. Find a bug that is bothering you in the current Visio import filter, or some simple feature that the importer currently does not support
  2. Check out the following libraries:
    • master branch of libwpd (git clone git://libwpd.git.sourceforge.net/gitroot/libwpd/libwpd)
    • STABLE-0-2-0 branch of libwpg (git clone -b STABLE-0-2-0 git://libwpg.git.sourceforge.net/gitroot/libwpg/libwpg)
    • master branch of libwps (git clone git://libwps.git.sourceforge.net/gitroot/libwps/libwps)
    • master branch of libvisio (git clone git://anongit.freedesktop.org/libreoffice/contrib/libvisio), and
    • master branch of libcdr (git clone git://anongit.freedesktop.org/libreoffice/libcdr)
  3. Build them as system libraries and install them in the same order.
  4. Then build LibreOffice according to these instructions. The important thing is to use those system libraries that you just built. To do so, be sure you added to the configure flags
    • --with-system-libwpd
    • --with-system-libwpg
    • --with-system-libwps
    • --with-system-libvisio
    • --with-system-libcdr

With this kind of build, you will be ready to make the most from your Brussels weekend. Nevetheless, you can drop around at our IRC channel #libreoffice-dev channel at irc.freenode.net for more information and ideas.

Starting to do it instead of planning to do it ...

... is the best way to enter the FOSS development. That is why your servant and Eilidh will be around to hold your hand with debugging and finding way to implement your favourite features. We will answer your questions about the library design. We will point you to the place in the code where your bug might linger. And for more complicated stuff, we will debug it with you.

Don't expect us to give you a fish, but we will certainly teach you how to catch it by yourself. And in the same token, you will become a contributor inside a community of smart people that is fun to hang and hack with.

See you in Brussels the 4th and 5th of February 2012.

February 04, 2012

Hubert Figuiere: OpenPhoto

hub.png

A while back, Jaisen Mathai decided to start OpenPhoto, a project dedicated to provide a Free Software hosting solution for photos, to liberate the users from the claws of hosting services like Flickr, Picasa, etc.

This is an idea I have been mulling for a long time, so much that I even started on my own, but it didn't go very far. So when I found out about OpenPhoto, my curiosity got picked. It seemed to fullfill the same goals so I decided instead to look at it.

My first task was to get it to run. The catch is that from the start it was designed to run off Amazon Web Service and their SimpleDB. Not something I wanted. So I started writing the needed code to support MySQL and local filesystem to store the photos. And that's how it started. Then I implemented support for importing metadata from the pictures, automatically, something that I have seen missing in several of the competing services.

The OpenPhoto project is part of WebFWD, Mozilla's Open Innovation program. And it was one of the first project to make use of Mozilla's excellent BrowserID.

The source code is available on github. Feel free to download it, install it, tinker with it. Pull requests are more than welcome. If you don't feel like installing it, you can still go to openphoto.me for the hosted version.

And since I like "dogfooding", I'm running my own instance.

February 01, 2012

Hubert Figuiere: We need a Gnome computer

hub.png

tl;dr we need a Gnome computer.

This is not about choice, it is about freedom.

A hardware platform that would be libre, that would run a libre OS, based on Gnome, Linux and GNU.

A hardware platform whose software stack would be vertically integrated for a maximum user experience: working out of the box, as advertised.

And for those who think it is about choice, think again. Choice is dealing with a bazillion different hardware configuration, drivers, etc. Dealing with more poorly written drivers (usually from hardware vendors) or proprietary (hello GPU driver) or even buggy firmware.

Next will come the portable devices: tablet, phones, etc.

January 31, 2012

Fridrich Strba: LibreOffice CorelDraw Import filter - don't despise the humble beginnings

fridrich.png

You might still remember some of my blogs about our new and shiny MS Visio import filter in the upcoming LibreOffice 3.5.0.

But what about 3.6.0? Is it going to be an exciting version too? Well, the answer depends on what kind of things excite you generally, but for sure, there will be a lot of goodness as usual to make the best free office suite even better.

In my free time, I have been working for some time already on the next graphics import filter for LibreOffice. This time it will be a CorelDraw import filter. The horse-power is a library, libcdr. In the same way as libvisio, libcdr reuses the API of libwpg and thus is easily pluggable into LibreOffice reusing all the ODG generator classes of the current writerperfect module. The importer is currently part of the git master tree.

You might be already shouting: "Where are the screenshots?" I know that a picture speaks louder then hundred words, and so here you are served:

Shapes in CorelDraw 7

Simple and more complex shapes in CorelDraw 7

Shapes in LibreOffice Draw

The same shapes imported into LibreOffice Draw.

As you can see, it is an initial implementation, which cannot but get better. If you want to participate in this adventure, you can drop around at our IRC channel #libreoffice-dev channel at irc.freenode.net where a community of smart and friendly developers can direct you.

Stay tuned for more nice pictures as this project advances.

January 21, 2012

Hubert Figuiere: Firefox accessibility

hub.png

Since I joined the accessibility team at Mozilla I took on one of the task that was in need to be solved: bringing back accessibility in Firefox on Mac as it has been lagging behind.

Marco already wrote about how things are ramping up and started filing more bugs on what is broken in the build I provided.

With the quick release cycle, I can't really commit on which Firefox version this will be in, but the code is current in Nightly, aka Firefox 12, except that on Mac we don't build with accessibility enabled yet.

January 08, 2012

Ben Martin: RDF, Abiword and Relations

Abiword now has growing GUI support for editing RDF in ODF documents. Much of this support compliments what is available in Calligra for RDF handling. There are some areas where Calligra has more features and some areas where Abiword now does. Hopefully both will continue to have a large and growing shared feature base.

As some folks will know, ODF allows one or more RDF/XML files to be shipped in the ODF file, and for that RDF to be linking to the document content from the content.xml file. This means that you can explicitly say that a 1/2 inch bolt is from a particular maker and was procured on the 3rd of January 2012 by going to their office at geolocation ?x. Handy when you are reading the document a year down the line and want to know which office you bought the bolt from and the exact length of its thread.

Looking at the below image, one can see the purple underlined pieces of text. Each of these has some RDF associated with it. The citation to Dan Brickley has both contact and location RDF associated with it. Looking at the toolbar, towards the right side you see an "R" to start a change tracked document, and the "RF" button. Sorry about the images there, I draw at the 3 year old level so my icons are not quite polished shall we say. Anyway, the "RF" button selects this reference to an RDF item. So if you are between the "am" in the purple "James" then the whole word will be selected with this button. The ">" and "" buttons then allow you to move to the next and previous reference to the selected RDF item. As you notice another purple James later in the document, this is the second and only other reference to him and you can move between them using these buttons.



These purple links I call "RDF links", which is a bit of a play on hyperlinks or bookmarks. Behind the scenes they are implemented using xml:id values and pkg:idrefs to those from RDF.

A feature added in the last days is the ability to capture and navigate by the relation between two RDF links. This is currently done by selecting a "source" link and then clicking another rdf link and setting the relation to the source. So in the below screenshot I am saying that Mark foaf:knows James. You will also notice the "Find by Relation" option which I can then use to see the people that mark foaf:knows. In the spirit of the foaf definition, I have made this a symmetric relation. So there is no stalking, or "following", if James knows Mark then Mark knows James. Asymmetric relationships are also possible, like son, child, or contains. I am hoping to add this feature to Calligra too in the future as the relations between RDF objects is one of the more powerful features that can be offered by using RDF in a document.



Note that the prev/next RDF item buttons work with relations. If I pick mark and navigate to the James he knows then I can "next" from that james to select the second reference to James. This is one recurring theme to RDF in ODF, that RDF objects like contacts can be cited or linked zero or more times in the text content of the document.

As mentioned above, the converse is also true, and the Dan Brickley text has two logical RDF objects linked to it; Dan's contact information and his location. Handling this multi-object for a single site is a little tricky and in this editing will create a window with both the semantic objects in it to let you edit the RDF abiword knows about. Note that this dialog is actually backed by two (or more) SPARQL queries;



If you are not squeamish about your triples then the "Show RDF" option for an RDF link will let you get right at them and edit away as shown below. There are a few technically cool things about this dialog: firstly the "Restrict to RDF Link" combo box lets you select one or more RDF links that the triples will have to be associated with, and secondly abiword makes sure any edits you make are properly linked to the RDF link you right clicked on. What I mean by this last bit is if you right click the RDF link "alice33" add a new triple "uri:alive myvocab:likes uri:bob" then abiword will add the triple "uri:alice pkg:idref alice33" for you. This is sort of having abiword do what you mean in that you want the new triple to be associated with the link but don't necessarily want to have to explicitly say it all the time. By choosing to edit the RDF for the link you have already explicitly said once that you want these things to be linked. This also applies if you change a subject, uri:alice to uri:amanda will update the pkg:idref values for you. Keep it linked, keep it valid.



Going one level deeper, the above dialog is actually a subclass of a restricted RDF model created using SPARQL. The SPARQL model is read only, and the subclass, RDFModel_XMLIDLimited handles mutations by creating a wrapper object which takes care of the automatic triple relinking mentioned above. Those still awake might like to see the abiword trunk code for src/text/ptbl/xp/pd_DocumentRDF.cpp.

This is part of an ongoing mad hacking sprint that is leading up to a talk at LCA 2012 which starts in a week. Many of the things I mention here are not in trunk yet, and only tested on Linux/GTK+3. Those in Ballarat in a week might like to pop in to the talk given my Martin and myself on Friday the 20th.

January 02, 2012

Fridrich Strba: Take a decision to enter FOSS in 2012

fridrich.png

So, the year changed again and with it come quite often new decisions. Some swear to work out the superfluous kilos, pounds, or whatever standardized measure your country uses, gained too fast during the festivals. If it is your decision, it is for sure good for your body and I wish you success that goes beyond the act of subscribing to a local gym (and never appearing there after first month).

But this could be also a nice time to take a decision that you were procrastinating with for too long. That one is good for your intellect and programming skills (even though you don't consider yourself a programmer yet). What about starting to contribute to a Free and Open Source Software project (FOSS)?

Sounds interesting? So I have one for your. It is having a big and growing community. It can accomodate all levels of skills. And the impact you will have is multiplied by the wide addoption of the product itself.

Well, you must have guessed right by now. I am speaking about the LibreOffice project, your natural entry point into the marvelous world of the FOSS.

Whether you are expert or beginner programmer or C++ is sounding Chinese Traditional for you, just find a way to join channel #libreoffice-dev channel at irc.freenode.net in order to meet other developers and visit our Easy Hacks for ideas where to start.

I promis you that a year from now, you will not regret that you have started. Although, it is quite probable that you will pour a tear over an unused year-pass from the local gym.

December 29, 2011

Kathiravelu Pradeeban: AbiWord and Google Summer of Code - 2011

AbiWord has been accepted as a mentoring organization for Google Summer of Code 2011. It should also be noted that AbiWord has also been a mentoring organization in the Google Summer of Code for the years 2006, 2007, 2008, 2009, and 2010 too, making this time the 6th consecutive year. As a developer/mentor/past-student of AbiWord, I thought of sharing the presentation that I prepared to assist students getting into Google Summer of Code and AbiWord here.

GSoC 2011 AbiWord
Have a look at the project ideas from AbiWord. List of selected mentoring organizations can be found here.

Update: Pls find the latest revised version of this presentation at 

December 15, 2011

Kathiravelu Pradeeban: My Summer of Code so far

3rd to 21st of April was an intermediate period trying to find alternate ways for windows build, where 16th of April I successfully cross-built using wine. However I dropped the idea of MinSYS/MinGW build in the middle, as I found cross-building pretty cool. 21st of April, the best news, yes, I got selected for the Google Summer of Codes!

My mentor immediately wished me and the other Summer of codes participants also wished me at IRC. Abiword is a nice place to have the Summer of Codes, where we are considered regular developers, and not just students.

27th of April, uwog created gsoc2009unicode branch for me, and helped me setting the password using ssh. 4th of May I did my first commit, which fixed the cross-building. So that commit was actually the patch I developed for the minor change to enable cross-building during the application period.

19th of May, I started to commit the changes I made to the code, and the new classes. Jordi Mas' initial effects on this project were a good reference for me. 23rd of May, the coding period began officially.

Now we have completed a month, expecting a nice mid term evaluation.
Have a nice time with Abiword.

November 15, 2011

Fridrich Strba: 7th ODF Plugfest in Gouda

fridrich.png

For those that might care, your servant will be attending this week the ODF Plugfest #7 in Gouda (Netherlands).

I will have on Friday a short presentation of the best free and open source library for parsing Microsoft Visio Documents. The other exciting thing is that after more then 6 years of common collaboration I will get to meet personally one of my libwpd co-maintainers, Johannes Marcus Maurer also know as "uwog".

What an exciting time before us!!!

Hubert Figuiere: YouTube HTML5 - part 2

hub.png

I may I sort-of praised Youtube and HTML5, allowing me to view some of the YouTube content without having Flash, and in Firefox since Google supports WebM, to some extent.

Here come the time to give some tips.

Enabling HTML5

Given the how buggy is the HTML5 implementation of YouTube, particularly with playlist and users, it is a two step process.

First, you have enable the HTML5 beta: the page will tell you the status. If it is enabled or not, what are the capabilities. If you use Firefox, you need Firefox 4 that supports the new WebM open format.

Second, to fix the UI issues, you have to use Cosmic Panda, the new UI. You enable it from that page.

At anytime you can return to these pages and revert your selection. Also you have to do that per browser - to be honest, since I'm not logged in, I can't really be sure if it sticks for the user.

Embedding

If you are embedding Youtube video with <embed>, then you are doing it wrong. This is unfortunately what a lot of plugins for CMS to. You need to use the new <iframe>. For that, when you go to the video page, click share, then embed and you'll have the snippet of HTML to paste. This will embed the video properly, using HTML5 if the viewer supports it, with the fallbacks to the usual way if needed.

Fridrich Strba: LibreOffice Visio Import filter: the goodness soon on your desktop

fridrich.png

It has been a long time since I last time blogged about the LibreOffice Visio import filter. My silence did not prevent a pretty cool code from falling gradually into our git repository. To the point where now we are working on the last 5% of features that normally take the 95% of development time. But, let us see what happened since my July blog:

First of all, Eilidh was busy as a bee and, in the second half of the Google Summer of Code, implemented support of stylesheets, stencils and basic text. She also debugged and fixed quite a number of imperfections that Valek found. Frankly speaking, this Google Summer of Code was by far the best from my point of view. We managed to achieve a very good fidelity of import only in about 3 and half months. Impressive.

During the LibreOffice HackFest weekend in Munich, I had a time to add a support for uniform splines in libvisio and to implement the actual import in text on the side of LibreOffice.

The next highlight was the fact that the whole team met in Paris during the LibreOffice Conference 2011. It was delight to meet in person Valek and Eilidh. There is even a photo witnessing this meeting:

The Team at LibreOffice Conference 2011 in Paris Valek, me and Eilidh from left to right

This conference was not only an occasion to know each other a bit better, but also to improve and add some new features to libvisio. During boring parties full of non-developer talk, we withdrew with Eilidh to some corner and improved together the text import: paragraph and span properties, text box properties, etc. Later on, Eilidh added initial support for line markers (aka arrows). Recently we implemented emulation of the last Visio primitive that we did not handle before - Infinite Line.

For those that have big piles of Visio documents on their disks, but cannot read on their favourite Linux distribution: Your pain is coming to an end. The LibreOffice Visio Import filter will be part of LibreOffice 3.5 release, which will be the next major release early next year.

And since images speak louder then thousands of words, here are some pics to illustrate our achievements:

OrgChart.vsd in Visio OrgChart.vsd in Draw  
OrgChart.vsd in Visio OrgChar.vsd in Draw You can see the achievement by comparing with the pictures from my June blog

DNetwork.vsd in Visio DNetwork.vsd in Draw  
DNetwork.vsd in Visio DNetwork.vsd in Draw Compare with the picture from this libregraphicsworld.org article.

Calendar.vsd in Visio Calendar.vsd in Draw  
Calendar.vsd in Visio Calendar.vsd in Draw This picture shows a good mix of the complicated features likestencils with NURBS, text fields, gradients, stencil text, etc.

If you are impatient and cannot wait anymore, just grab one of the daily builds uploaded by our tinderboxes here and enjoy all that goodness on your own.

November 14, 2011

Hubert Figuiere: geglmm 0.1.6

hub.png

I just pushed out of the door Geglmm 0.1.6, the C++ bindings for GEGL. Nothing very special, they just needed an update.

.tar.bz

November 13, 2011

Hubert Figuiere: libopenraw 0.0.9

hub.png

I just did a quick release for libopenraw 0.0.9. It just include a few fixes and enhancements cherry-picked from master. There is much more going into master including a serious API breakage. If you package libopenraw in a distro, I encourage you to pick this one up.

NEWS - tar.bz2 - gpg signature

October 29, 2011

Hubert Figuiere: New adventures

hub.png

Today was my last day on iWork™. I'd like to thanks my team for these last two years and wish them the best, it was fantastic.

Monday will be the beginning of new adventures, at Mozilla. I'll be in Toronto the first week, but will be based in Vancouver.

October 16, 2011

Hubert Figuiere: Punk rock languages

hub.png

Excellent write-up about why C has won the language battle: punk rock languages

Also, if you know C and C++, read the Deep C (and C++) PDF deck of slides, and become surprised (or not).

October 13, 2011

Hubert Figuiere: RIP Dennis M Ritchie

hub.png

It is hard to write eulogies about people you have never met. Dennis M Ritchie's work has influenced me a lot in my tech field. UNIX and C were two of the main projects he worked on and two of the things from which I have been making a living. If it wasn't for them, I may not be working in software engineering.

Dennis M Ritchie sadly passed away today at 70.

The Economist has a good summary of Dennis Ritchie work. The article is from 2004, before iPhone, iPad and Android, which are the most popular consumer products that are based off UNIX.

I spent my professional life either fiddling with operating systems like AIX, BSD, iOS, Linux, MacOS X, Solaris, based on or derived from UNIX, or writing software in C, C++, Objective-C. Thank you Mr Ritchie for your invaluable contribution to computing.

October 12, 2011

Ben Martin: Semantic Revolutions

I thought a fun little scenario for RDF in ODF would be to bounce information from Evolution, through abiword, to calligra, and then drag it back into evolution again. So information goes from ical to RDF, crosses the clipboard as RDF inside of an ODF file with linked text, and then is dragged back into ical format again. I notice a little timezone bug in there, but on the whole things work as one would expect.

September 28, 2011

Tomas Frydrych: MeeGo’s Dead, Long Live Tizen!

tf.png

So finally Intel admits what anyone with anything more than superficial knowledge of the platform knew for a long time — MeeGo is dead. I am not surprised at all, I have always expected that MeeGo would not live to see its second birthday, but the waste of human effort is dispiriting.

I am not holding my breath for Tizen either, there is a definitive leitmotif here that yet another change of name cannot but accentuate (HTML5 is all good and well, but there is heck lot more to creating a usable platform for a single device category, never mind multiple categories at once, and MeeGo did not get even near). I suspect the success of Tizen will largely come down to what Intel’s partners can bring to the table, but the very fact none of them want to give it a go alone leaves me feeling skeptical — I would not be at all surprised if we get Episode 4, or, more likely, the final curtain, within 18 months.

September 23, 2011

Martin Sevior: Neutrinos travel faster than light?

msevior.png
Wow. This is sensational news if true. Really, really astonishing stuff with massive implications for Physics and our understanding of the nature of reality.

The full paper is on the archive server now.

http://arxiv.org/abs/1109.4897v1

This blog post interprets the paper.

It is a very nice measurement. The experiment, OPERA, measures the centroid of the "Probablity Density Function" of the time of time of flight from the CERN accelerator to the Gran Sasso Laboratory in Italy.  (This in itself is pretty amazing since the neutrinos are detected after travelling through 730 km of solid rock!)

Of couse there are two fundamental systematic uncertainties one must take into account. The first is the measurement of the difference between the time of neutrino creation at CERN and the time of measurement in Italy. The second is the distance between CERN and the detector.

The time difference was obtained by synchronized atomic clocks with greater than 1 ns precision. There is now a massive industry based on precison measurements of distance. This is the world-wide GPS system which allows measurement errors in positions of the order of centimeters. Its extremely hard to see how they could have screwed these up. For example the April 7th, 2009 L’Aquila Earthquake in Italy resulted is an easily identified 7 cm shift in position. (See below.)




The biggest uncertainty is establishing the original time structure of the proton beam that created the neutrinos. The proton pulse is of the order of 10 microseconds in width. The measured effect is a 60 nano-seconds shift from expectations with a 7 nanosecond uncertainty. That means they've established the centroid of their proton pulse width to a precision of better than one part in one thousand. Since they have recorded 16,000 events they have sufficient statistics to do this. The question is whether they've correctly determined the shape in time of the original proton beam.

This is determined from the proton beam intensity which is continuously montored. They compared the this to the measured time profile in their detector.   The measured original proton beam intensities as a function of time are shown below. The CERN SPS has two extraction profiles which are easily distinguished.



The observed time structures of the events recored in Italy are shown below. The red lines show the superimposed average time structures of the proton beams with and without the flight time to Italy.


By eye the original time structure of the CERN proton beam appears well reproduced in the detected neutrinos.

After a full blind-analysis they find that their neutrinos travelled (60.7 ± 6.9 (stat.) ± 7.4 (sys.)) ns faster than light over the same distance.

The first uncertainty is the statistical precision of the measurement. The second is their estimate of the systematic uncertainty.  Their systematic uncertainty was obtained by a quadratic sum of 12 potentional sources of error. The largest (5.0 ns) was the calibration of the detector that measures the time of the proton beam extraction at CERN.

Overall their measurement gives:

(v-c)/c = (2.48 ± 0.28 (stat.) ± 0.30 (sys.)) ×10-5

This is consistent with an earlier but less precise measurement from an experiment in America with the Fermilab accelerator:

(v-c)/c = 5.1 ± 2.9×10-5

But substantially different from the neutrinos detected from Supernova 1987a which gives a limit on the anti-neutrino velocity difference of:

|v-c|/c < 2×10-9

So what happens now? There are two other high statistics long-baseline experiments in operation in Japan (at the KEK laboratory where I do my CP-violation experiments) and an updated experiment using the Fermilab accelerator in America. You can be certain that both experiments will do their best make the most precise measurements of the neutrino velocities they can. If all three agree what then? Well we will have to wait to see if they do.... As I said this is a most incredible result.

One final point about this. If the neutrinos from SN1987A had had the increase in velvocity over photons measured by the OPERA experiment they would have arived 4 years earlier than the light...


(All images are reproduced from http://arxiv.org/abs/1109.4897v1)

September 20, 2011

Ben Martin: Copy and Paste with Semantics...

Copy and Paste now preserves RDF between both Calligra and abiword in both directions. This lets you select some text in a document in either application, copy it, and paste it into the other application and have the RDF that is associated with that part of the document go along with the text you selected.

In the below screencast, the document that Calligra is editing has some contact and event information stored in RDF. The three people in the first sentence all have contact information associated. As you can see, the RDF sidepanel in Calligra lets you know about this as the cursor moves around. James has his phone number captured in RDF which the edit dialog shows. If I select one or more of these contacts and "Copy" them to the clipboard, Calligra creates an ODF file with embedded RDF in it and offers that on the clipboard.

Abiword is happy to accept that ODF content and when you paste it into a document you can see that the RDF links are preserved, and that there are 7 RDF triples associated with James. Of course, you want full disclosure of this information, so clicking show RDF lets you examine and edit those RDF triples.

Copy and Paste of RDF from Calligra to Abiword from Ben Martin on Vimeo.



I put a little trick in going the other way just to spice things up a little bit. The multi.odt file that I have open in abiword has two RDF links in scope at the Wing-B link. RDF is associated with the whole paragraph and explicitly with the link itself. In particular, the uri:widetime is associated with the paragraph while the uri:wingb is associated with the RDF link itself. Once I grab that RDF link and copy it to the clipboard, again an ODF file is offered (as well as text and rtf), and again Calligra is more than happy to accept an ODF file on the clipboard. Notice that when I show all the RDF in Calligra both the widetime and wingb RDF triples have now become part of the document.

Copy and Paste from Abiword to Calligra from Ben Martin on Vimeo.



I made some changes in both calligra and abiword to get this to happen. Changes to the former were quite small. You'll have to grab trunk from both applications if you want to play along at home. The code is committed in both trees.

September 17, 2011

Hubert Figuiere: Too much choice

hub.png

In front of a grocery store on Commercial Driver during Italian day. Vancouver, BC - June 5th 2011

Mamiya C-220, 105mm, Kodak Ektar 100.

flickr - 500px

September 15, 2011

Fridrich Strba: LibreOffice Visio import filter on libregraphicsworld.org

fridrich.png
For those that could be interested in my shameless self-promotion, there is some news about the LibreOffice Visio import filter at libregraphicsworld.org web site, accompanied by a fine interview with two fine hackers. So, click and enjoy the wonderful screenshots in a preview of the happiness LibreOffice 3.5 will bring you.

September 09, 2011

Hubert Figuiere: Vacation time

hub.png

The Frenchman waiting for the perfect wave...
(picture by somecanuckchick)

Today I took surf lessons with the Surf Sister in Tofino, BC. It was fun, I would do it again, but I'm sore, proof that I really need to get my ass off and get in better physical shape.

September 01, 2011

Ben Martin: Abiword RDF Drag and Drop

Now that abiword has low level RDF support I thought I'd make it simpler to get some data into the document's RDF. The initial support lets you drag contact and calendar entries from Evolution into your document as shown below. Notice that a new RDF Link is created for you and when you choose to right click that link and "Show RDF" there are many RDF triples that have been created by the D&D action.

Abiword RDF Drag and Drop from Ben Martin on Vimeo.


I think these sort of user interface additions help to make using RDF quick and easy, even for those who don't know or care what it is and where it gets stored in the document. Abiword can load and save RDF in both it's native abw files and ODF formats. You can of course convert between both without loosing the RDF ;)

I plan to add D&D in the other direction later on, so you can pickup a person from a document or an event. Similar to how many email clients let you import ics calendar files into your local Calendar. Having RDF in ODF lets you share content, style, and semantics, all in a truly open format single file.

Oh, and the code should hit svn trunk real soon now.

August 29, 2011

Hubert Figuiere: I hate hardware

hub.png

My Linux server rebooted spontaneously and then decided to kernel panic.

Running memtest off a bootable Gnome 3 Live USB system:

Diagnosis: dead RAM stick. With only one stick, memtest even crash on test 6, while the other just pass.

The good news is that the motherboard support single channel. The second good news is that it is lifetime warranty. Requested a RMA.

The bad news: I might have to return both as they are paired leading to eventually a longer downtime. :-/

August 28, 2011

Hubert Figuiere: A case for braces

hub.png

I am one of those who believe C and C++ should have made curly braces mandatory.

Recent version of gcc and other compiler emit a warning when you have the following:

if(foo)
  ;

It does it because you could do something like

if(foo);
{
  // do something for foo
}

And this is likely a bug. But imagine the following case:

if(foo)
  DEBUG_MESSAGE("foo");

Now you have DEBUG_MESSAGE() defined as a macro that is empty in non-debug (you don't want these for your users). Then you end up with the warning for the situation above when doing your builds. There would be no problem had you written it this way:

if(foo)
{
  DEBUG_MESSAGE("foo");
}

Also another case:

if(foo)
  if(bar)
    do_bar();
else
  dont_foo();

Do you see the bug? That's right, the code is wrong: dont_foo() is executed in the else case for if(bar). Had you put curly braces it would have been clearer of what is happening. Like that:

if(foo)
{
  if(bar)
  {
    do_bar();
  }
}
else
{
  dont_foo();
}

Also if you find this a bit too hard because of the many like, can write with that style of bracing:

if(foo) {
  if(bar) {
    do_bar();
  }
}
else {
  dont_foo();
}

The opening brace at the end of the opening statement.

Another case:

if(obj)
  obj->data->foo = 1;

Now you know that data can not be null and want to catch it when testing. So you add one line:

if(obj)
  DEBUG_ASSERT_NOT_NUUL(obj->data);
  obj->data->foo = 1;

Oops. Did you realize this is wrong? Mistakes happen. Mistakes can be prevented. Curly braces would have prevented it.

Note: in the code above you should still ensure that obj->data is not NULL before dereferencing, but that's a different subject, for another time.

Bottom line, don't be lazy. Make the use a curly braces mandatory in your coding style. If your compiler has a warning for that, enable it.

Hubert Figuiere: Picnurbia

hub.png

Part of the 125th anniversary festivities, Picnurbia at the just finished 800-block of Robson Street for Viva Vancouver.

Vancouver, BC - August 16th 2011

Flickr - 500px

August 19, 2011

Hubert Figuiere: Dear Google,

hub.png

Dear Google,

Who are you to tell me how I should write my name?

You could have managed than one swiftly. You didn't. You got feedback, you answered with worse policy. Your policy is so bad that it won't even be enforceable fairly, as you still have you own employees with fake profile, or exempt celebrities.

You created some great product and in that case you f***ed it up real hard.

You disable my profile, goodbye[1].

PS: Get a clue: read My name is me

PPS: even people using their real names get rejected - language warning over there.

Notes

[1] as of now I'm still on notice. Not changing it

August 18, 2011

Ben Martin: RDF Low Level Interaction in Abiword

I've recently mentioned creating and jumping to the RDF Links (xml:id to RDF bridging) in Abiword. I also had a work in progress dialog to allow SPARQL Query execution. Things are moving along quite nicely and the RDF subsystem continues to get stronger with a Triple Editor and updates to the SPARQL dialog shown below and execution support.




Shown below is the new RDF Editor dialog. The file menu allows you to import and export RDF/XML files into the document. The Triple menu has the same actions as the toolbar; new, copy, and delete. Shown at the bottom of the dialog is the total number of RDF triples for this document. Clicking on a cell in the table lets you edit it and you can use the existing URI prefixes if you like, for example rdf:type instead of the full URI. I have to allow configuration of those prefixes yet.

When you select some text in Abiword you can use Insert/RDF Link to create a new RDF link for that text. This is much like making a bookmark, hyperlink and other items.

The context menu for an RDF link allows you to edit the RDF associated with link. That window is shown below. There can be many RDF links in scope at any location in the document. Consider the case where a paragraph has RDF linked to it and a sentence and word does too. So when you bring up the RDF editor window from the context menu of an RDF link you get a combo box letting you select which links you want to see the RDF associated with.

By default the editor shows you all the RDF Links that are in scope where the cursor was located when you opened the dialog from the context menu. In this case widetime is an RDF link for the whole paragraph and wingb is for three words at the end of the paragraph. The dialog shows you the triples that link the subjects to this location: those with ?subject pkg:idref widetime. Selecting a different RDF link from the combo box restricts the triples shown to be only those associated with the RDF link you have chosen.

I decided to make the dialog automatically link any new triples you create or edit to the RDF link you have specified in the combo box. If there is more than one RDF link shown then the first link is used for new and updated triples.

This allows you to select some text, create an RDF link, right click the link and "Show RDF" from the context menu and start adding and editing triples and Abiword will automatically associate all those shown with the RDF link you have selected. Yay, full, low level RDF support with a GUI ;)

In case you have forgotten the scope of an RDF link in the document, the RDF editor will select the scope in the main document when you select a triple in the editor. I might make that functionality have a toggle button in the toolbar instead of making it happen automatically all the time.


One of the plugins that comes with Abiword is the "AbiCommand" which gives you a console interface to Abiword. You can start it from the shell using:

$ abiword --plugin AbiCommand
...
AbiWord command line plugin: Type "quit" to exit
AbiWord:>

I have added some new RDF commands to the AbiCommand plugin which allows fairly good interaction with RDF from the command line. The context-model commands allow you to set and interact with a submodel of all the RDF in the document. For example, only the RDF that is associated with a given xml:id. All updates to RDF happen via a mutation object. So you first use rdf-mutation-create, then add/remove as desired and complete things with rdf-mutation-commit. For those who are still reading now, see pd_DocumentRDF.h in the C++ source code and you'll notice createMutation() in the model, with add(), remove(), commit() and rollback() methods. The new commands in AbiCommand are shown below:

...RDF subsystem...      

Where a function reads RDF, it will try to use the RDF context model if it is set
Otherwise the entire RDF for the document is used.
An RDF context is obtained using rdf-set-context*
and cleared with rdf-clear-context-model

rdf-import <src> - load all RDF from an RDF/XML file at <src> into the document
rdf-export <dst> - save all document RDF to an RDF/XML file at <dst>
rdf-clear-context-model - RDF can at times use a context model which is a subset of
all the RDF associated with the document.
This command clears that and uses all the RDF again.
rdf-set-context-model-pos <pos> - Use a context model with the subset of RDF
associated with the given document position
rdf-set-context-model-xmlid <xmlid> [readxmlid1,readxmlid2]
- Use a context model with the subset of RDF
associated with the given document xml:id value
rdf-context-show-objects <s> <p> - Show the object list for the given subject,predicate pair
rdf-context-show-subjects <p> <o> - Show the subject list for the given predicate,object pair
rdf-context-contains <s> <p> <o> - True if the triple is there.
rdf-context-show-arcs-out <s> - Show the predicate objects associated
with the given subject
rdf-get-xmlids - Get a comma separated list of the xml:ids assocaited
with the current cursor location
rdf-get-all-xmlids - Get a comma separated list of all the xml:ids
rdf-get-xmlid-range <xmlid> - Show the start and end document position associated
with the given <xmlid>
rdf-movept-xmlid-start <xmlid> - Move the cursor location to the start of the range
for the given xml:id value
rdf-movept-xmlid-end <xmlid> - Move the cursor location to the end of the range
for the given xml:id value
rdf-uri-to-prefixed <uri> - Convert full uri to prefix:rest
rdf-prefixed-to-uri <uri> - Convert prefix:rest to full uri
rdf-size - Number of RDF triples for context
rdf-mutation-create - Start a RDF mutation for the document
rdf-mutation-add <s> <p> <o>- Add the given triple to the current mutation
rdf-mutation-remove <s> <p> <o>- Remove the given triple in the current mutation
rdf-mutation-commit - Commit current RDF mutation to the document
rdf-mutation-rollback - Throw away changes in current RDF mutation
rdf-execute-sparql - Execute SPARQL query against RDF context
rdf-xmlid-insert <xmlid> - Insert xml:id for current selection
rdf-xmlid-delete <xmlid> - Delete the xml:id from the document


Some examples of AbiCommand interaction are shown below to give a little idea of use. These are using the multi.odt from my plugtest github repository.

load       /tmp/multi.odt

rdf-export /tmp/output.rdf
rdf-import /tmp/extra.rdf

rdf-set-context-model-pos 1006
rdf-export /tmp/1006.rdf

rdf-set-context-model-xmlid wingb
rdf-export /tmp/wingb.rdf

rdf-clear-context-model
rdf-export /tmp/all.rdf

rdf-get-xmlid-range wingb

rdf-execute-sparql "prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix foaf: <http://xmlns.com/foaf/0.1/>
prefix pkg: <http://docs.oasis-open.org/opendocument/meta/package/common#>
prefix geo84: <http://www.w3.org/2003/01/geo/wgs84_pos#>

select ?s ?p ?o ?rdflink
where {
?s ?p ?o .
?s pkg:idref ?rdflink .
filter( str(?rdflink) = \"wingb\" || str(?rdflink) = \"widetime\" )
}"


load /tmp/multi.odt
movept +27
selectstart
movept +4
rdf-xmlid-insert foo
save /tmp/updated.odt

load /tmp/multi.odt
rdf-context-contains uri:wingb rdf:type http://www.w3.org/2002/12/cal/icaltzd#Vevent
rdf-context-show-objects uri:wingb rdf:type
rdf-context-show-subjects rdf:type http://www.w3.org/2002/12/cal/icaltzd#Vevent
rdf-context-show-arcs-out uri:wingb



August 14, 2011

Hubert Figuiere: The dog whisperer

hub.png

If you bring a toy that sqweek at the Boston Terrier meetup, you are sure to get a herd of these little daemons. Hadden Park, Kitsilano, Vancouver, BC - July 18th 2010

August 08, 2011

Hubert Figuiere: Censorship?

hub.png

Yesterday, I sent an email to Shoppers Drug Mart, a large pharmacy retail chain here in Canada. My complain was solely that they sell cigarettes (in British Columbia). Yes you read it right a pharmacy sell cigarettes. Does that shock you? It does shock me.

I was expecting either no reply at all, or some boiler plate reply, but I think they really exceeded my expectations in term of BullC.

Here is the reply, verbatim:

Hello Hubert,

Thank you for writing to us. The entire philosophy of our company is based on the understanding of care and concern for all of our customers. Our promise is to provide superior customer satisfaction beyond expectation. Shoppers Drug Mart receives a tremendous amount of advice from a wide spectrum of advocates, each with their own value systems, about the many products that a drug store sells. Their assumption is that consumers need to be protected from themselves. Shoppers Drug Mart's position is that it will not allow itself to become the cultural or moral censor for any legal product. The fact that we sell a product does not constitute any endorsement on our part of that product.

One of the great underlying perils of merchandising and retailing, regardless of diligent testing for possible hidden, offensive, or unintended messages, it may be interpreted that a product is unsuitable for the general public. To refuse to sell a product that one takes issue with would clearly be a form of censorship on our part which is a position we will not take.

Tobacco is typically displayed behind the counter, so it is not accessible to children. We hope that you can appreciate our position as a responsible retailer, which is to offer a wide variety of products and services to the many customers we serve.

Thank you for your feedback. We will continue to monitor your concern and make any necessary adjustments.

Regards, Amber Shoppers Drug Mart / Pharmaprix Customer Service

That's right, you read it well. They consider banning the sale of cigarettes a form of censorship, and they hide themselves behind the legality of the product. At least I would have taken "we do it for the money" as a valid reason. But censorship?

August 03, 2011

Ben Martin: RDF Linking in Abiword

Another minor step forward in the quest to make the RDF facility in ODF more useful to document authors... Abiword can now create links to RDF and you can jump to these links in a similar manner to how bookmarks work. The upside to using RDF links over bookmarks is that you can associate meaning with the RDF links. So for example, the text "Barry" can be associated with his vcard and possibly normal work geolocation.

Making a new RDF link is just like inserting a bookmark:
And the "Go To..." dialog now offers RDF links as first class citizens. I did a little tweaking to this goto window while I was at it; moving things into a paged configuration and abstracting out some common code into utility functions.

On the API front, there are now STL like iterators for the RDF and that theme will be present in the query results engine and perhaps also in the arcsOut() API. Speaking of querying, the window for SPARQL is coming along. I'll start working on the actual query execution shortly. Notice that the RDF triples are shown with namespaces in effect so you get something more readable.

As I mentioned in my previous post, the purple links can be turned on and off to highlight parts of the document with RDF associated. Using a special menu item you can pull up the SPARQL query dialog with a preformed query to show just the RDF associated with the current cursor location.

I admit that some of this is quite low level, for example directly inspecting the triples for the cursor position. But full disclosure isn't a bad thing right? I syndicated this to planet KDE because Calligra handles RDF too. Hopefully posts about RDF are interesting to hackers regardless of the desktop platform :)

July 19, 2011

Ben Martin: Abiword & RDF Gusto

I recently blogged about updating Calligra to improve its RDF support and bring back support for viewing and editing location information using Marble. A computer loves RDF because it is nice and verbose and allows low level unambiguous expression of semantics in a format that a machine can work with. For a human however, some might find having long descriptors, schemas and the like just to say "meet me at the Mall" a little tedious. One of the many challenges that I see for office applications wanting to offer RDF to the user is making it visible in a subtle way.

Abiword can now colour code parts of the document which have RDF associated with them and tell you how that association is formed, and how much RDF is linked at any point. In the below, the purple text has some RDF associated, and the purple "Mark" I have the mouse pointer on so it shows the bubble text letting you know how the RDF is attached and how much of it there is.

In the future I of course want to let you know more; is the RDF location, contact, event, or related to another domain. It would also be nice to highlight RDF only for types. So, for example if you are interested only in the times that trains leave then highlight departure logistics in bold red. The computer knows what you mean too, so might also want to offer a menu button to check if the train is on time or not.

Being able to highlight like this is a good start because it allows users who are unfamiliar with the document the chance to know exactly where there might be RDF "hiding".

July 18, 2011

Hubert Figuiere: Lion's Head

hub.png

The Lion's head seen over the Capilano reservoir in North Vancouver, BC - June 4, 2011

Mamiya C-220, 105mm f3.5, Ektar 100 - 1/125 f16

flickr - 500px

July 08, 2011

Fridrich Strba: LibreOffice Visio import filter - round shapes are beautiful

fridrich.png

Some might be wondering why the Visio import filter project is so quiet. But the answer is easy: we were busy as bees adding new features.

You might remember my blog about the bounding box of an elliptical arc. It is because Eilidh added the support of elliptical arcs into libvisio. And then we discovered that LibreOffice did not support elliptical arcs in the path at all, just ignored them. Fortunately, there was this patch of a hacker extraordinaire, Thorsten that was used to teach LibreOffice some sane behaviour.

Eilidh implemented further the conversion of gradient fill and with this and the support of elliptical arcs, this Visio document:

Marketing.vsd in Visio

looks in Draw pretty well:

Marketing.vsd in Draw

You will realize that we do not support text in Visio documents yet, but be assured that it is now our top priority feature. It is also worthy to note that the above-mentionned document is actually a document in Visio file-format 6 (used by Visio 2000 and Visio XP). We refactored libvisio the way that our support of both version 6 and 11 is equivalent. Moreover, we implemented two-pass parsing of Visio documents which allows us to draw shapes in a correct order and position them accurately.

In the same line, Eilidh implemented reading of NURBS, which is pretty tedious since the conversion must be done by approximation, since neither ODF, nor SVG support this kind of non-uniform rational basis splines. For the while, we are approximating them with 50 lineto segments for one spline, but it is our intention to use a serie of smooth cubic splines to achieve as much visual similarity as possible.

The libvisio library now is able to position correctly any point even if it is in a rotated shape that is part of a group rotated differently, which also might be part of another group with a diferent transformation. This allows us to load this Visio document:

Halloween in Visio

in Draw this way:

Halloween in Draw

You can see some graphic problems. The missing shapes are polylines that we will very soon correctly support. Nevertheless, this could be another one of my "we all love ODF, but ..." blogs, because some of the visual glitches are given by the fact that OpenDocument Graphics (ODG) file-format is suboptimal for representing more complex drawings. One is not even able to specify fill-rules or rules of polygon clipping. Clerly, this SVG inside XHTML version, converted using the vsd2xhtml tool, that is part of the libvisio library, is much closer to the original:

Halloween - SVG in XHTML

So, a bottom line is that the project is well alive and kicking. We even tagged the second alpha release and the tarball is now what LibreOffice master build is using. So, if you build your LibreOffice yourself, you will be able to enjoy the fruits of the work or Eilidh's hands and — why not — even start to contribute to this cool and interesting project.

Stay tuned for more news soon ...

June 23, 2011

Hubert Figuiere: Sitting on the curb

hub.png

On Commercial Dr, Vancouver during Italian day. Vancouver, BC - June 5 2011

Taken on Kodak Ektar 100 w/ Mamiya C-220 TLR 105mm f3.5

flickr - 500px

June 20, 2011

Fridrich Strba: Bounding Box of an SVG Elliptical Arc

fridrich.png

We all love ODF, the best and the most vendor-neutral file-format in the Universe and its surroundings. But for sure, we have some spots where we would prefer it to be somehow less cumbersome. My favourite spot is the need to compute the bounding box of the path element when one writes the draw:path into an OpenDocument Graphics file. Without proper svg:x, svg:y, svg:height, svg:width and svg:viewBox values the path will not be correctly placed.

Computing bounding boxes is not so complicated work when everything is a polygon (which is the case in the internal model of basegfx module), but it becomes a bit more complicated if an application wants to generate paths including elliptical arcs.

I hit this problem about a year ago when I was working during my hackweek on an improvement of libwpg. I tried first to implement the bounding box of an elliptical arc the lazy hacker way, by googling for what other people did. And to my surprise, there is a huge vacuum in what concerns computation of a bounding box of the "A" element of an SVG path. So, I settled for the lazy hacker's plan B: I abandoned the idea by saying I will handle it later, in the first moment, and by implementing a suboptimal solution in the second time. But, since Eilidh did some spectacular progress last week in handling elliptic arcs, my lazyness became the bottle-neck of the progress. So, it was time to remember those nice times when I was warming the benches of the University, dust off my knowledge of mathematical analysis and analytical algebra (or the lack thereof), and try to compute the bounding box of an elliptical arc myself.

And for the purpose of people that might be as lazy as me, I decided to fight my lazyness the second time to give Uncle Google the opportunity to spit out something meaningful, when someone asks it about "Bounding box of an elliptical arc". Here are the notes:

Compute extremes using parametric description of ellipse

Let us start from this parametric description of an ellipse:

x(theta) = cx + rx*cos(theta)*cos(phi) - ry*sin(theta)*sin(phi)
y(theta) = cy + rx*cos(theta)*sin(phi) + ry*sin(theta)*cos(phi)

where cx and cy are the coordinates of the centre of the ellipse, rx and ry are the radii and phi is the x-axis-rotation.

To compute the bounding box of the whole ellipse we need to find for which value of theta the above mentioned functions reach the local extremes. It means where the first derivatives of x and y according to theta are zero. We will get this two equations:

0 = -rx*sin(theta)*cos(phi) - ry*cos(theta)*sin(phi)
0 = -rx*sin(theta)*sin(phi) - ry*cos(theta)*cos(phi)

which give us two solutions for x:

theta = -atan(ry*tan(phi)/rx) and theta = M_PI -atan(ry*tan(phi)/rx)

and two solutions for y:

theta = atan(ry/(tan(phi)*rx)) and theta = M_PI + atan(ry/(tan(phi)*rx))

Compute the center of the ellipse

Since we know now the values of theta describing the extremes of our ellipse, we can compute the x and y values of the bounding box of the whole ellipse. Just to do that, we still need to know the coordinates of the center of the ellipse, cx and cy.

The computation of the center of the ellipse is pretty well described in the Appendix F.6.5 of the SVG standard and does not need to be reproduced here. Just note that for this we need the coordinates of the starting point of the arc that correspond to the end point of the previous path segment.

Determine the bounding box of the whole ellipse

Compute the xmin, xmax, ymin and ymax using the values of theta for the local extremes and the newly computed cx and cy coordinates. Like this not only we will know the bounding box of the whole ellipse, but we will also know which value of theta corresponds to maximum and which one to minimum. This knowledge will be later valuable for determining the tightest possible bounding box of a given elliptical arc.

Tightest possible bounding box

By calculation of the bounding box of the whole ellipse, we now know the rectangle that will contain the ellipse and thus our elliptical arc too. Nonetheless, this rectangle is too big for our arc. So, the next thing is to trim it down so that it becomes the tightest possible rectangle that will still contain the whole arc.

For this task, we will use the polar coordinates rather then the cartesian ones. The principle is that if any of the points corresponding to xmin, xmax, ymin or ymax of the whole ellipse, lie on the arc they will be be the extremes of the arc too. Nevertheless, if for instance the point ymin does not lie on the arc, the new ymin will be the minimum of the y coordinates of the starting and ending points. In the same way, if the point xmax does not lie on the arc, the new xmax will be the maximum of the x coordinates of the starting and ending points. Whether an extreme does or does not lie on our arc is something trivial to see once the arc is drawn, to determine it programatically will require some efforts.

First, we will compute the coordinates of the points where the whole ellipse touches the bounding box using the parametric description of the ellipse and the values of the theta that we found out in the previous steps. And for determination whether they lie or not on our arc we will use their position in polar coordinates. We will thus need to compute the angles with the x-axis of the lines going through the center of the ellipse and our extreme points. In other terms, we will compute the angle between vector (1,0) and vector (xextreme-cx, yextreme-cy).

The formula for computing the angle between two vectors is known and mentioned inter alia as formula F.6.5.4 of the SVG standard. Generally, the expression to calculate the angle between a vector (ax,ay) and a vector (bx,by) is:

(ax * by > ay * bx ? 1.0 : -1.0) * acos( (ax * bx) + (ay * by) / ( sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by) ) ).

But since we already know that the first vector is (1,0), we can simplify it:

(by > 0.0 ? 1.0 : -1.0) * acos( bx / sqrt(bx * bx + by * by) ), which could be eventually simplified to atan(by / bx), but this expression has a potential division by zero and the code would have to handle those border situations in a special way.

Once we know the angles of the extremes, we still need to calculate the angles of the starting and the end points or our arc using exactly the same formula. So we get angle1 corresponding to our starting point and angle2 corresponding to the endpoint. It is necessary to normalize all angles so that they lie in the interval of [0.0, 2.0*M_PI).

In case the sweep flag is 0, the angles are decreasing when the ellipse is drawn. But, for the computation of bounding box the direction of rotation is irrelevant and only complicates the situation. So we swap the angles if the sweep flag is not set. In this way, we can just check for the absence of the extreme points on our elliptical arc, rotating from angle1 to angle2. Nevertheless, we have another difficulty with the fact that the angle of 0 radians is the same as the one of 2*M_PI radians. This passage through the 2*M_PI / 0 border is not very easy to handle directly. That is why we swap the points in case where angle1 > angle2 and will not look in this case for absence of the extreme points on the arc, but for their presence on the complement arc that would close the ellipse.

And as my teachers used to say: "Grey is the theory, but green is the tree of life," here is what it looks like in a plain C++:


#include <algorithm>
#include <cmath>

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

inline double getAngle(double bx, double by)
{
  return fmod(2*M_PI + (by > 0.0 ? 1.0 : -1.0) * acos( bx / sqrt(bx * bx + by * by) ), 2*M_PI);
}

void EllpArcBBox(double x1, double y1,
                 double rx, double ry, double phi, bool largeArc, bool sweep, double x2, double y2,
                 double &xmin, double &ymin, double &xmax, double &ymax)
{
  if (rx < 0.0)
    rx *= -1.0;
  if (ry < 0.0)
    ry *= -1.0;

  if (rx == 0.0 || ry == 0.0) {
    xmin = (x1 < x2 ? x1 : x2);
    xmax = (x1 > x2 ? x1 : x2);
    ymin = (y1 < y2 ? y1 : y2);
    ymax = (y1 > y2 ? y1 : y2);
    return;
  }

  const double x1prime = cos(phi)*(x1 - x2)/2 + sin(phi)*(y1 - y2)/2;
  const double y1prime = -sin(phi)*(x1 - x2)/2 + cos(phi)*(y1 - y2)/2;

  double radicant = (rx*rx*ry*ry - rx*rx*y1prime*y1prime - ry*ry*x1prime*x1prime);
  radicant /= (rx*rx*y1prime*y1prime + ry*ry*x1prime*x1prime);
  double cxprime = 0.0;
  double cyprime = 0.0;
  if (radicant < 0.0) {
    double ratio = rx/ry;
    double radicant = y1prime*y1prime + x1prime*x1prime/(ratio*ratio);
    if (radicant < 0.0) {
      xmin = (x1 < x2 ? x1 : x2);
      xmax = (x1 > x2 ? x1 : x2);
      ymin = (y1 < y2 ? y1 : y2);
      ymax = (y1 > y2 ? y1 : y2);
      return;
    }
    ry=sqrt(radicant);
    rx=ratio*ry;
  } else {
    double factor = (largeArc==sweep ? -1.0 : 1.0)*sqrt(radicant);

    cxprime = factor*rx*y1prime/ry;
    cyprime = -factor*ry*x1prime/rx;
  }

  double cx = cxprime*cos(phi) - cyprime*sin(phi) + (x1 + x2)/2;
  double cy = cxprime*sin(phi) + cyprime*cos(phi) + (y1 + y2)/2;

  double txmin, txmax, tymin, tymax;

  if (phi == 0 || phi == M_PI) {
    xmin = cx - rx;
    txmin = getAngle(-rx, 0);
    xmax = cx + rx;
    txmax = getAngle(rx, 0);
    ymin = cy - ry;
    tymin = getAngle(0, -ry);
    ymax = cy + ry;
    tymax = getAngle(0, ry);
  } else if (phi == M_PI / 2.0 || phi == 3.0*M_PI/2.0) {
    xmin = cx - ry;
    txmin = getAngle(-ry, 0);
    xmax = cx + ry;
    txmax = getAngle(ry, 0);
    ymin = cy - rx;
    tymin = getAngle(0, -rx);
    ymax = cy + rx;
    tymax = getAngle(0, rx);
  }  else {
    txmin = -atan(ry*tan(phi)/rx);
    txmax = M_PI - atan (ry*tan(phi)/rx);
    xmin = cx + rx*cos(txmin)*cos(phi) - ry*sin(txmin)*sin(phi);
    xmax = cx + rx*cos(txmax)*cos(phi) - ry*sin(txmax)*sin(phi);
    if (xmin > xmax) {
      std::swap(xmin,xmax);
      std::swap(txmin,txmax);
    }
    double tmpY = cy + rx*cos(txmin)*sin(phi) + ry*sin(txmin)*cos(phi);
    txmin = getAngle(xmin - cx, tmpY - cy);
    tmpY = cy + rx*cos(txmax)*sin(phi) + ry*sin(txmax)*cos(phi);
    txmax = getAngle(xmax - cx, tmpY - cy);


    tymin = atan(ry/(tan(phi)*rx));
    tymax = atan(ry/(tan(phi)*rx))+M_PI;
    ymin = cy + rx*cos(tymin)*sin(phi) + ry*sin(tymin)*cos(phi);
    ymax = cy + rx*cos(tymax)*sin(phi) + ry*sin(tymax)*cos(phi);
    if (ymin > ymax) {
      std::swap(ymin,ymax);
      std::swap(tymin,tymax);
    }
    double tmpX = cx + rx*cos(tymin)*cos(phi) - ry*sin(tymin)*sin(phi);
    tymin = getAngle(tmpX - cx, ymin - cy);
    tmpX = cx + rx*cos(tymax)*cos(phi) - ry*sin(tymax)*sin(phi);
    tymax = getAngle(tmpX - cx, ymax - cy);
  }

  double angle1 = getAngle(x1 - cx, y1 - cy);
  double angle2 = getAngle(x2 - cx, y2 - cy);

  if (!sweep)
    std::swap(angle1, angle2);

  bool otherArc = false;
  if (angle1 > angle2) {
    std::swap(angle1, angle2);
    otherArc = true;
  }

  if ((!otherArc && (angle1 > txmin || angle2 < txmin)) || (otherArc && !(angle1 > txmin || angle2 < txmin)))
    xmin = x1 < x2 ? x1 : x2;
  if ((!otherArc && (angle1 > txmax || angle2 < txmax)) || (otherArc && !(angle1 > txmax || angle2 < txmax)))
    xmax = x1 > x2 ? x1 : x2;
  if ((!otherArc && (angle1 > tymin || angle2 < tymin)) || (otherArc && !(angle1 > tymin || angle2 < tymin)))
    ymin = y1 < y2 ? y1 : y2;
  if ((!otherArc && (angle1 > tymax || angle2 < tymax)) || (otherArc && !(angle1 > tymax || angle2 < tymax)))
    ymax = y1 > y2 ? y1 : y2;
}

June 18, 2011

Hubert Figuiere: On upgrading blogging software

hub.png

After some time on Advogato which was social before the time in 2001, I decided in 2004 to host my blog. First on my own server on my DSL line, then later, before moving across the country, on a paid hosting. While I progressively relinquished the burden of administering the server itself, I still have kept full control of the blog software and the associated data. This is not something that just everyone can do as it has a set of implication from security to sysadmin.

The software was at first Nitlog written by software hacker extraordinaire Dave Coombs when at Niti. It served its purpose and was minimalistic by design. No database but flat files to edit. Works great of you access to the file system to post. Later, I moved Dotclear, a French blogging platform, GPL licensed, written in PHP. This was around the time when Movable Type licensing changed and the early day of Wordpress. The main motivation for moving to Dotclear was the built-in admin interface and a few other tidbits. I could have fixed Nitlog but lazyness prevailed as it seemed to be a rather large change given its design.

Dotclear 2.0 has been out for quite a while now and I have been thinking about upgrading. It isn't until very recently that I actually gave it a try. While the migration process seems to be seamless, importing directly from the database after a fresh installation, there are a few issue I consider important that needed addressing. First it broke the URLs. Doctlear 2 changed the way the permalink URL are made and the choice isn't as flexible as in Wordpress. While I can understand the benefit of the change, and while it is also addressed using a plugin – plugin that would redirect old to new – it is a bit disappointing. But that's not all. The URL for the RSS feeds have also changed. I'm sure I could implement something to redirect, but also, with the previous change in the URL structure, the fee will have new IDs for the post, causing wreck and havoc on aggregators where all the articles in the feed will be considered as new. And that's not acceptable in my point of view.

When I moved from Nitlog the URL were so different that I managed to keep the old one working with a clever check in the index and never migrated the articles to the new software. The RSS just didn't include these so everything was good.

Now here are the options:

In any case, only the first solution involve not rewriting a theme.

June 17, 2011

Fridrich Strba: LibreOffice Visio import filter - shaping up the baby

fridrich.png

Maybe you were asking yourself what happened in the Google Summer of Code Visio Import filter project since last week. But even if you did not ask yourself this necessary question, here is some update about the baby:

The focus this week was mainly on shaping the baby up. Eilidh added to her blog a photo and an "About" line and then she got exhausted and decided to rest by coding. And it is like this that she implemented polylines, ellipses and circular arcs.

And since the images speak louder then any words, enjoy the look:

Microsoft Visio LibreOffice Draw
Visio Page 1 Draw Page 1
Visio Page 2 Draw Page 2
Visio Page 3 Draw Page 3

For those interested in some technical details, or even for those that desire to give hand, the code of the libvisio library is living here. And as usual, for any question or encouragement, feel free to join our #libreoffice-dev irc channel at irc.freenode.net, ping tibbylickle and pat her back, if she is not lost too deep inside her Emacs.