My blog has been moved to ariya.ofilabs.com.
Showing posts with label kde. Show all posts
Showing posts with label kde. Show all posts

Tuesday, May 31, 2011

on the story of browser names

future = browser?

One of the early graphical web browser that got really popular was Mosaic, developed at National Center for Supercomputing Applications (NCSA). Some folks from the team, along with SGI founder Jim Clark, decided that it's worth a venture and formed a company, originally called Mosaic Communication and then later renamed to Netscape Communication.

Netscape's flagship desktop product was a much more advanced web browser than Mosaic. Jamie Zawinski coined the name "Mozilla", as it was supposed to be Mosaic Killer (Mozilla = Mosaic + Godzilla). At the later stage, the final browser was widely known as Netscape Navigator. For browsing the web, obviously you need a navigator.

Parallel to that, another company called Spyglass licensed the technology from NCSA and produced a web browser, Spyglass Mosaic. It is fun to see the same theme here (probably even slightly coincidental), typical Hollywood movies always portray the naval ship's navigator using his spyglass for some sort of observations.

Then came along Microsoft. It licensed Spyglass Mosaic, called it Internet Explorer, and distributed with Windows. The browser war has just started. I mean of course, the name war. Why would you stop at navigating (and using spyglass) if you can continue exploring?

On the other side of the planet, KDE slowly emerged as the attractive supplement to the otherwise boring Unix desktop. Internet technologies became the centerpiece of the early version of KDE, thus its developers grew a set of applications from e-mail program, newsgroup reader, IRC client, and (surprise) a web browser. There was no free-software-friendly modern and capable web rendering engine back then, thus a bunch of brave young hackers initiated the adventure of (re)writing one, under the name KHTML (which was itself a replacement of the original attempt, khtmlw).

From this KDE camp, the ultimate web browser (which actually could serve other tasks as well, e.g. file manager and document viewer) was popular as Konqueror (indeed, those were the days where KDE stuff was named K-this or K-that). History showed how Age of Discovery was not about navigation and exploration only. After all, who would not want to repeat the glory of "I came, I saw, I conquered"?

When Apple decided that it must give the best browsing experience for Mac (and could not just rely on Microsoft for its Internet Explorer), they took KHTML, ported it to Mac, improved it, and later released it as an open-source project called WebKit. Apple's proprietary web browser, which is powered by WebKit (till today), was announced by Steve Jobs as Safari. Already conquered a land? Might as well enjoy it with a little bit of safari and collect exotic pictures. Shall we?

Just like in your favorite comic books, the world is however multiverse. Netscape lost the browser war, Mozilla became an open-source project and its Firefox browser (formerly Firebird, and formerly Phoenix) remains as the icon of freedom, independence, and community. Opera, originally a Telenor research project, was something that came all the way from Norway, has loyal followers and remains dominant in the embedded space. Google even joined the fun and launched WebKit-based Chrome (and Chromium). All these three are excellent web browsers, they just don't have the names which fit the story of navigation, exploration, and so on.

As the closing, here is a side twist. In its early WebKit days, how did Apple engineers name the code branch of its ported Konqueror's KHTML? Alexander.

Saturday, April 23, 2011

camp kde 2011

Camp KDE 2011 was a fabulous experience. First of all, there is definitely something with me and Camp KDE. The previous one was in San Diego and at that time I was there working for Qualcomm. This year it is San Francisco, right after I moved to the Bay Area.

Videos of the sessions have been published. I contributed two talks there, one is about the (usual) graphics stuff with Qt (video, slides). The other one is a series of demos of web technologies (video, slides).

There are some interview videos as well. If you watch Wade and me, you can spot a little guy there. Pay attention to his shirt :)

The venue can't be better, it's in the center of Japantown. Even better, the weekend after is the Cherry Blossom Festival.

cherry blossoms

Since I don't live in a big city anymore, it's also fascinating to be able to spot a cozy cafe right between all the big buildings. Right in Japantown, we found YakiniQ which serves a must-try sweet potato latte!

latte & croissant

All in all, it was a blast for me. Beside catching up with the people I met before, finally I got to meet folks I only know through our online interaction.

Kudos to the Camp KDE organizers! See you in 2012.

Saturday, March 19, 2011

camp kde in 2 weeks

My first Camp KDE experience was when it was held in San Diego, which was also interesting since at that time, I just moved there.

Just like the planets align themselves, apparent my move to the Bay Area is matched with this year Camp KDE in San Francisco. This time, it is co-located with Linux Foundation Collaboration Summit. For more info, just check the official site: camp.kde.org.

The schedule for the tracks has been finalized, there will be various talks around KDE on Mobile, PIM, and of course Qt. I myself will have two presentations: Introduction to QtWebKit and Efficient Graphics with Qt: Beautiful and Blazing Fast.

See you there!

Saturday, January 01, 2011

X2 from Ofi Labs: wrap-up 2010

X2It got started when I needed a new home for my examples. It has even a nice logo.

sensor

accelerometer viewer for Maemo 5 (Nokia N900).

bouncing ball, where the gravity affects the movement of the ball.

box of marbles, where the gravity affects a bunch of colored marbles.

combining accelerometer and network to do inter-device marbles transfer.

motion and orientation for web applications.

web-based version of marble box.

widgets

morphing clock, where the transition between the digital and analog version is a kind of morphing effect.

qpalette viewer so you know which color is which one.

graphics

fast approximation of Gaussian blur to create a blurry drop shadow.

command-line capture tool to save maps from OpenStreetMap, MapQuest and Ovi Maps.

simple tool to list all chunks inside a PNG image.

webkit & javascript

file processing, including using jslint, in command-line using JavaScript.

play Canvas-based game as normal desktop app.

offline, command line beautifier for JavaScript code, utilizing Qt Script.

another variant of the beautifier, this time using V8.

minimalistic editing widget for JavaScript code, with custom syntax highlighting.

white background is boring? just try some color inverted web pages.

detect the closest link to ease following it on a touch device.

Canvas pixel manipulation for plasma effect.

network

simple proxy server for HTTP, in 100 lines.

tracenet: trap all network requests+replies to show them with Speed Tracer.

filterproxy: another variant of the proxy server with added URL filtering feature.

Monday, December 13, 2010

the art of repository access

team

What will occur when a software team is working on a project? How to tackle the change control?

The first and foremost obvious approach is simply giving full access for everyone. This is what typically happens in a group of friends working together on a cool project, a school assignment, a short hackathon, an early prototype, or any other collaborative efforts.

While this approach is very democratic (all developers are created equal), it is not very scalable. It works on a small and agile team, mainly because everyone knows each other. Once the team grows beyond a certain limit, the overhead of the communication makes it impossible to continuously get a full picture of what is being work on by whom.

Usually this problem is minimized by having somebody responsible for each module, essentially putting some organizational hierarchy in the project. However, a slight problem in the communication (which happens quickly, we're talking about engineers here) is enough to provoke a situation where conflict occurs due to a certain check in which carries over the problems and bugs from one module to another (Law of Unintended Consequences).

Another approach, certainly an evolution from the first one, is limited commit access. This particularly works well if there is a dedicated army of maintainers, whose job is to review incoming patches, give feedback, check them in. Usually this approach is very beneficial for the new members of the team, because they can learn what works and what does not work (since they are indirectly guided by the maintainer).

Quality control is definitely easier since all patches will be always filtered. Limiting the damage due to a broken commit is also not difficult since the repository can be frozen while the disaster mitigation team carries out the work.

This approach however falls apart if there is not enough maintainers and/or the rate of submitted patches increases. The symptoms are easy to spot: patches stay far too long in the queue, a maintainer has no time to do his own development, bad patches sneak in due to the time pressure, etc.

Keep in mind that due to its implicit (often also explicit) social stratification, it is important to take into account what everyone thinks about the approach. There should not be someone who feels left behind because only certain chosen guardians have the ultimate privilege access the repository. When such a situation is not tackled early on, it would grow latently and explode at some point in the future.

If there is a worry like that, then another (slightly reversal) evolution is inevitable: full access to everyone, as long as the patch is reviewed. The gut of this approach is basically "Let's trust each other, but let's also watch each other's back". Thus, inherent code review becomes mandated as well. Everyone is free to check in his patch directly to the repository, as long as some other competent fellow has looked at it and gave the green light. In fact, this should be called "brotherhood repository access" except that it may sound too exclusive and mystical.

Sometimes the system is also setup as far as rejecting the commit (e.g. from the server-side) when the log does not contained something like Reviewed by: Joe Sixpack. This is of course not always necessary, it may even require a consensus from everyone, under the pretext of preventing accidental check in.

This last approach may still not work in some situations. For example, if the team is global and located in different time zones, then coordinating the review becomes challenging (distributed control system may alleviate the problem). When code review is not a encouraged culture, counterproductive dead lock can be depressing. Also, because it is based on mutual trust, it breaks down when some people do not play by the same rule. In short, the approach depends heavily on the strong and committed communication between the team members.

In the end, the repository access approach must be evaluated on a case by case basis. Of course, in some places, no approach will work to satisfy everyone. In that case, consider again that technology can't and won't solve every social problem.

What kind of repository access do you have in your group? Which one do you prefer and why?

Wednesday, October 13, 2010

on JavaScript engines

If you are using a modern browser, likely you already have the (arguably) most widely deployed scripting environment: JavaScript engine (or ECMAScript, if you insist). There are many things you can do with it (just look at tons of cool web apps out there). However, since it is contained in the browser, there are also things the embedded JavaScript engine can not do for you.

If you are using KDE, you also have two excellent JavaScript engines: KJS and Qt Script. You can embed either of them (i.e. KJSEmbed) and make your application scriptable. In a not-so-strange twist, they both relate (distantly) to each other via JavaScriptCore, WebKit's default JavaScript engine, because long time ago Apple forked KJS and used it as the base for JavaScriptCore, and Qt Script (for version 4.6 and 4.7) also uses JavaScriptCore as the back-end.

If you are interested in learning, using, and/or dissecting other open-source JavaScript engines, have a look at JavaScript Engines: How to Compile Them I wrote for our Sencha blog, which covers Mozilla's SpiderMonkey, WebKit's JavaScriptCore, and Google V8. The instructions should work on the supported platforms, including ARM, in case (just like me) you want to have and carry around every JavaScript engines in this planet on your Maemo-powered Nokia N900. That is fun.

As the closing, just remember, "Ask not what the JavaScript engine can do for you — ask what you can do for the JavaScript engine".

Saturday, March 20, 2010

morphing clock

As I promised before, here is a fresh X2 example. Those who attended Bossa Conference 10 and followed my talk are lucky to have seen it for the first time there. In fact, this example is ridiculously simple that I am not surprised at all if somebody has done this ages ago.

Let's start with a screen capture, or two:

Basically the above shows an analog and digital clock running on my Nokia N900, hardly a shock. However, the fun part is when you switch the clock from analog to digital and vice versa. Check out this video, or watch directly on YouTube, courtesy of Signor Portale from Nokia/Qt, showing the morphing on Nokia 5800:

The trick is simple. Actually it's not even generic enough, meaning that you can't morph from an arbitrary path to another arbitrary path. However, for this clock use-case, the gross approximation is good enough. First, we need to convert the path into a polygon, which is done easily via QPainterPath::toFillPolygon() function. Then any line segment in the polygon longer than a certain tolerance is further split into smaller segments. As I claimed above, the result is not perfect, i.e. it does not approximate the original path into line segments with equal length. But hey, it is good enough for this animation purpose (unless your user has ueberhuman eyes).

The target path needs to be sliced into segments as well. Since we have only two types, circle (for the analog clock frame) and solid block (for the hour and minute hands), it is easier to special-case both. The secret is to have the same number of segments as the source path. The following figure shows the digit '7' and a circle, each splitted to 28 line segments. Small dots indicate the start and end points of those segments. The animation is now a matter of doing tweening, or linear interpolation, between each segment.

The flaw of this trick is when the source path contains holes inside it, e.g. for digits like 0, 4, 6, 8, and 9. Again, we are cheating here for the sake of keeping the code simple, so I leave the code as it is. Doing a more advanced, better handling for those cases is left as a motivational exercise for the perfectionist readers. Another bonus puzzle: find out why 503 ms is the morphing time (hint: find the same number in Qt source tree).

The code is in the X2 repository, check the sub-directory widget/morphingclock. You need Qt 4.5 or later. It is not long at all (surprise!), sloccount reports 191 lines of code. A morphing-clock plasmoid is also underway, just be patient.

For the sake of completeness, let me mentioned Dali Clock (even in Canvas and JavaScript version) from the famous Jamie Zawinski (jwz). It is similar, however Dali Clock just morphs the digits of the digital clock.

Also, if you just prefer a normal (but old-fashioned!) digital clock with the flipping effect, check the digiflip example I did back then. You already have it if you install Qt 4.6 for Symbian.

Last but not least, I'd like to mention my "special thanks to Delta Airlines for such a long (but safe) flight to Brazil so I had the chance to write this example while I was bored", but then I was told by the Trolls that this kind of intro line can't be funny anymore.

Monday, February 15, 2010

new laptop, free yourself!

The other day, I couldn't resist buying the el-cheapo Athlon 1.6 GHz-powered Acer Aspire 5532 in BestBuy for $330. With its 15.6 inch screen, seems that it is quite a nice bargain. It comes (of course) with Windows 7 Home Premium, but after slapping openSUSE 11.2 DVD I got from the last Camp KDE (must be from Will, thanks dude!) and a bunch of keystrokes, a few hours later the machine happily runs the shiny KDE 4.4. Sound was not a problem, even WiFi was easy to get it working (hard to believe that after all these years, NetworkManager still does not work for me, maybe my bad karma). The included radeonhd driver is good enough for its Radeon HD 3200 (RS780M chipset), but for the sake of testing, I did install ATI fglrx 7.4 10.1 and, voila, I got flawless KWin desktop effects. Even proprietary stuff like Opera, Skype, and Flash plugin faced no serious problem as well.

Time for some fun hacking! :)

Obligatory click-to-enlarge desktop snapshot follows:

Monday, January 18, 2010

camp kde: day two (sunday)

Again, just track all the tweets and blogs to know what happens in Camp KDE in almost real-time. For more pictures, check out KDE Events Pool at Flickr.

In one of the talks today, Romain "Frankenstein" Pokrzywka showcased KDE 4 on Windows. Though he blogged about it recently, it is definitely interesting to see a live demo, especially things like Plasma running (and crashing, occasionally) on Windows, and that some apps are really usable already. Well, who knows? In the not so distant future, it is definitely easier to convince Window users like Joe Sixpack to start using KDE apps.

Romain

Sunday, January 17, 2010

camp kde: day one (saturday)

Showing up at this year's Camp KDE feels a bit weird. First of all, because I do not need to travel at all since I already moved to San Diego some time ago. In addition to that, while I was still with Nokia (Qt), usually I could only attend conferences only if I have something to present. It is a great relief not to worry about my own talks and just enjoy the event.

There were few talks today. As you can guess, you can pretty much follow them if you keep an eye on #campkde tweets and/or follow Planet KDE these days.

Prof Bourne on Open Access to Data

The keynote was from Professor Bourne, he had a presentation about open access to data, in particular in the field of science (in his example, pharmaceutical sciences), such as the initiatives with protein databank, Public Library of Science, SciVee. I fully agree with his opinions in this matter, especially since they resemble some of my observations when I was doing my graduate research years ago. In particular, "publish or perish" could potentially destroy the sharing spirit of researches. I do believe that competition is good, but I also do strongly believe that science is about sharing.

I hope more people will show up tomorrow. The sunset here is so fantastic, you just have to experience it yourself.

(almost) sunset at Lake Miramar

To be continued (to day 2).

Wednesday, December 30, 2009

"i" for innovate

As I have hinted before, somehow I aimed to move to some sunny place in California. Well, lucky as we could be, after days of experiencing the transient stage (with tons of good and bad experiences, what a roller-coaster), we slowly settle in San Diego, (arguably) a beautiful place to live. The proof is the following picture, basically I can enjoy watching sunset from our balcony every day when the weather permits (it does usually).

sunset from the balcony

Few weeks ago, I started a new position within Qualcomm Innovation Center Inc., specifically in the new Web Technologies team. This center is a wholly-owned subsidiary of Qualcomm, one of the top 10 semiconductor sales leaders last year. The official party line of Qualcomm Innovation Center is best understood by what our president, Rob Chandhok, has expressed once: focus on such important open source initiatives as Linux and Webkit, and on open source operating systems such as Symbian, Android and Chrome.

Qualcomm

Of course, faithful followers of my blog can quickly point out that this whole thing is just a cover-up for the real motive: the strong desire to live in a perfect symmetry :)

the best juice on earth

In addition, to convince you that the alignment of the planet has been planned for this, surely you know (perfectly) where the upcoming Camp KDE will be held?

See you in 2 weeks. Happy 0x7da!

Thursday, March 12, 2009

bias

Readers of my blogs might notice the remark "heavy corporate bias" [1] which was the most interesting comment after I showed the result of JavaScript benchmark test. Interesting? Because I work for Nokia [2] and none of the product shown in that benchmark result is from Nokia.

Of course I am not stupid. It is just because I am paid to hack on QtWebKit [3], right? It does not matter if I never pushed QtWebKit to replace KHTML or KJS. It does not matter if I never (God forbid) bad-mouthed or insulted KHTML, KJS, KOffice, or any other KDE sub-projects, or any of its developers. It does not matter if I (and other KDE developers and ex-developers here in Qt Software) give our best [4] to ensure that the latest Qt release plays well with KDE 4.x.

I guess some people are just hostile, not matter what I do. The greatest lessons of it are (1) I try to be active again in KDE, despite Real Life (tm) would make it a difficult task (2) I will post more food pictures, apparently these did not annoy people enough :-)

On a slightly unrelated side note: after all these (tough) years, "biased" is probably not really my thing (those who know me well, please speak up!). I use all major browsers on an almost equal basis. Of all three phones I use since I start working for Nokia, none of them are Nokia ones. I enjoy working on QtWebKit, yet I like the simplicity and easy-to-follow KHTML. My home machine runs (the beautiful) KDE 4, my work desktop is still with (the trusted) KDE 3. I am a proud vim user but hardly recommend it to novices. My main debugging tool is still gdb but everyone knows how I praise VS integrated debugging. I like and use git (rebase) with passion, still I believe mercurial patch-queue rocks. I contributed a lot to KOffice but I am a great fan of Jody Goldberg and Michael Meeks' work on Gnumeric and OpenOffice.org.

If you come to me [5] and tell me how bad my code is, likely I will buy you a drink. And I am usually still the one who hates my code most.

[1] The phrase "heavy corporate bias" starts to become an insider joke here among my fellow Trolls :-)
[2] The disclaimer in my blog explicitly states do not necessarily represent the official view of my employer.
[3] If you fail to see the connection, Chrome and Safari are powered by WebKit as well.
[4] We are still human^Troll, and there are only 7 days a week.
[5] Nokia employees may not enter the contest.

Tuesday, March 03, 2009

didn't have a choice but to lift you up

QTimeLine is a nice class to control animation [1], used among others in Plasma::Animator. There are some curve shapes available for the timeline, from a linear one to some easing combinations. Though linear gives a rather standard movement effect, using easing often can give a better touch. This makes sense, as everything is our daily life usually moves not in a linear movement, due to e.g. inertia and gravity.

Which brings me to another point. At least for me, the ease in and out curve shapes do not feel as natural as they could be. The solution is to create a custom timeline. This becomes the latest graphics example in our Qt Labs blogs. Basically I use the logistic function (again [2]) for a nice S-shape curve. You can even adjust the sharpness of the S-shape. From the animation (click the Show Panel or Hide Panel button), you might see that the starting part of the curve gives you the feeling of overcoming the inertia of the panel and the friction of the panel to the desktop, while the last part of the curve makes you think as if you release the push force and let the panel slides by itself.

Time to make this as the default curve shape for Plasma? :-)

[1] For Qt 4.6, a new animation framework is planned which is supposed to give a much more flexible animation control.
[2] I used it for the genie effect before.

Wednesday, January 14, 2009

lima golf papa lima

Sebastian just announced that Qt 4.5 will be also available under LGPL 2.1. Yes, it's the Lesser General Public License (check the FAQ). It means a good change for KDE as well.

One small step for Qt Software, one giant leap for mankind...

Monday, November 03, 2008

Summer of Code 2008 Mentor Summit

Squeezing the time between the busy schedule, with other three Trolls (Simon, Thiago, Olivier), I attended the Google Summer of Code 2008 Mentor Summit at Googleplex in Mountain View. On the KDE side, we also met Jason and Leo. On the second day, the mentors and the organizers had two group pictures, one in the staircase and one in front of the big Android statue. The six of us from KDE also took a nice picture with the Android background.

My general impression of the summit: it was awesome! The venue was great, the talks were interesting, the food was nice, the snacks were abundant, and of course the opportunity to try out Toto E200 - the infamous 14-button toilet - was priceless. Surely the organizers did a very good job!

What is also great from Mentor Summit is the chance to meet great people. Since at Qt Software we switched from Perforce to Git, it was nice to be able to talk and discuss matters with Shawn Pearce. He happens to work on Google Android these days, unsurprisingly Android project is of course using git. Still related to Android, there were two talks about it: the story behind and the application development. Also of a great interest is Gerrit, the Python-based code review tool used Android development. According to Shawn, Gerrit is an improved fork of Rietveld, a similar tool written by Guido von Rossum. The mystery of both names is solved if you check out this Dutch architect.

I myself was so glad to be able to have a short chat with one of my personal legends, Sam Lantinga, the man behind the fantastic libsdl. He works for Blizzard and likely you know the game he is working on, as it is called World of Warcraft. As for libsdl itself, the new adventure is SDL for iPhone (which is one of its SoC projects). When finally it is released, I can't wait to see how many SDL-based games will be then available on iPhone. Plus, if you write an SDL-based application, now you have an interesting fast-growing target market as well.

I also followed a discussion from the 12-year old Dmitri Gaskin. He is the youngest mentor, he is actually too young to participate as a student (the age cut-off is 18). If you are a fan of Google Tech Talks, surely you are aware of his jQuery talk. So we discussed about JavaScript unit test, it involved a lot of coding from his side. I am not a jQuery expert so I just gave my opinions based on my little knowledge on the JavaScript engine in WebKit. I am eager to see how the unit test framework would evolve.

At the end of the summit, many of us were exhausted. But of course, we look forward to having the next-year mentor summit!

Android meets KDE guys


Saturday, August 02, 2008

quattro quattro uno

In case you live under the rock and miss Thiago's latest blog post, Qt 4.4.1 was just released. This is just a few days after KDE 4.1 was announced and close to three months after Qt 4.4.0 was out.

This patch release adds tons of bug fixes to the 4.4.0 release. For the WebKit team inside Trolltech Nokia's Qt Software Unit (by team here it means a group of developers you can count with one of your hand, and still not everyone works full-time on WebKit), beside the usual feature development (like Phonon-based media and Netscape plugin support), we did spend a lot of time fixing important bugs, as evidenced from the 4.4.1 changes.

On to Qt 4.4.2 and KDE 4.2. The latter would be ten percent of the ultimate answer to life, the universe, and everything...