Sunday, 17 July 2011

Adding Systemd to Gnome/kde



 A still of Kde Desktop

Haven't been doing a lot of work of-late, sighhh... out of ideas really !!!!

I had earlier assumed, using systemd/launchd as an external dependency, or copying its working across all startup scripts and application, I came across an interesting discussion on the gnome mailing list, but my mentor thinks that, it would not be viable/ unfeasible. So that, idea is pretty much ruled out. Anyone genuinely interested in following the topic can read this interesting conversation by Lennart, the creator/maintainer of systemd, here :-


http://mail.gnome.org/archives/desktop-devel-list/2011-May/msg00427.html


My mentor feels that it would be better to augment and improve the existing kdeinit, kded, etc. scripts. Currently kdeinit and kded call and start other scripts and applications by serialisation, if we parallise, more and more events, it would reduce the startup time, we would have to let them do stuff asynchronously and let the modules report back when they're finished setting up stuff. On my part, I would have to edit most if not all the scripts. On my part, I have been asked to have a look at what takes the longest during launch. Maybe I should try adding just a lot of debug output to kdeinit that shows how long each operation takes. To start with, I should just call utime() between the various methods called in kdeinit, and print out the difference between them. I should look at the timings of all the scripts and how much script is spent on each process, and then, we parallise some particular scripts that take most time.


Using the debug* files here: 
 well, first I should probably find out what uses time during launch, if kded starts instantly, it isn't worth wasting time on making it launch stuff in parallel

 

Sighhh... So Much to DO ....       o_O
 

Wednesday, 6 July 2011

Adding Meta Tags to your Blogger Blog

What are meta tags and why should I add meta tags to my Blog ?

Meta tags are the magic words that tells the search engine (google/ yahoo/ bing...) bots about, the keywords and tags in your content, it tells the search engine what your blog is about, so that your blog get emphasised on those keywords. Adding meta tags is an important factor in Organic search engine Optimisation (SEO). Meta tags allows search engines to index your web pages more accurately. In other words, Meta tags communicate with the search engines and tells more information about your site and make your webpages index correctly and accurately.

For Example :-
As you can see in the above screenshot, " hacks, help, tips and tricks for open source learners and hackers " is the meta tags description which I added to my blog.

Unfortunately Blogger doesn't have a add Tags feature so, this is how you can add Tags to your blog on blogger :-

(1). After signing in to your blog, go to Design.
(2). Choose edit HTML option.
And now check for these lines in codes :-

<head>
<b:include data='blog' name='all-head-content'/>

Now add the following code to your html code, below the above lines :-
 <meta content='DESCRIPTION HERE' name='description'/>
<meta content='KEYWORDS HERE' name='keywords'/>
<meta content='AUTHOR NAME HERE' name='author'/>







<meta name="keywords" content= " humour, pictures, jokes, Template, Competition, tutorial, hacks, tips, tricks" />
<meta name="description" content="A cool Blog on college Life and Stuff, Quizzing, Dramatics, football and stuff" />
<meta name="author" content="Aaditya Chauhan" />
<meta name="ROBOTS" content="ALL" />
  
Replace the red portion with your tags and description and the green part with your name.


That's it ! You have successfully added the metatags to your blogger blog. You can check out your tags description, when you see your blog on Google.

Sunday, 3 July 2011

Switching from Gnome to KDE

I recently, switched from Gnome to KDE, for the sake of my project and even though I was reluctant in the beginning, I would now have to admit, that it was totally worth it .KDE is strikingly different from gnome, and I find it very similar to Microsoft Windows, in some ways. To start-with, I found Kdm pretty boring so may be the recent talk in the kde community to replace Kdm with Lightdm is well placed. But the rest of the desktop environment was nice and refreshing. Here is a simple procedure to switch from gnome to kde.

Just follow the simple steps :-

(1). Go to System ---> Administration ---> Synaptic Package Manager.
(2). Search for kubuntu Desktop.

 (3). Select the package and install the package.


It would be a, not so huge 117 MB to Download. So just sit back and relax, it took 34 minutes to download on my system.

(4). Now it would start installing, it would again take some time, to install.


Some time in between the download it would ask you, if you would like to keep gdm or switch to kdm, I would say, you should stick with gdm. And you are through to use it.

So enjoy, using kde and don't forget to give your valuable feedback at community.kde.org/  !!!!!!

Technorati Tags: , , ,

Sunday, 26 June 2011

JPEG Compression Algorithm

Who knew, that the file format we daily use to store our images, is not just a file format, but also a state-of-the-art compression technique. It has been a common day-to-day experience for every multimedia enthusiast, that the same png image when saved in the jpeg format, results in smaller size, i.e. the image gets compressed. The degree of compression is adjusted, allowing a selectable trade-off between storage size and image quality. JPEG typically achieves 10:1 compression with little perceptible loss in image quality. The term "JPEG" is an acronym for the Joint Photographic Experts Group which created the standard, it is the most common format for storing and transmitting photographic images on the World Wide Web.

The image compression techniques is of 2 types :-
(1). Lossy
(2). Loss-less.

It is the Lossy technique that is more preferred, as it gives better compression ratios, for very little loss in clarity.
The compression is often achieved by leaving out non-important data parameters, and focussing only on important parameters, like :-

(1). color-space transformation matrix :-
The image is converted into a RBG colored matrix and also a gamma channel determing the brightness of the respective color. This kind of a color space conversion creates greater compression, without any perceptual change in image quality.The compression is more efficient because the brightness information, which is more important to the eventual perceptual quality of the image, is confined to a single channel. This more closely corresponds to the perception of color in the human visual system. The color transformation also improves compression by statistical de-correlation.

The various steps involved in the conversion of an image into jpeg format, is :-

(2). Down-sampling
(3). Block-Splitting
After Sub-sampling each block is split into 8*8 blocks.
(4). Discrete cosine transform
Next, each 8×8 block of each component (Y, Cb, Cr) is converted to a frequency-domain representation, using a normalised, two-dimensional type-II discrete cosine transform (DCT). Before computing the DCT of the 8×8 block, its values are shifted from a positive range to one centred around zero. For an 8-bit image, each entry in the original block falls in the range [0,255]. The mid-point of the range (in this case, the value 128) is subtracted from each entry to produce a data range that is centred around zero, so that the modified range is [ − 128,127]. This step reduces the dynamic range requirements in the DCT processing stage that follows. (Aside from the difference in dynamic range within the DCT stage, this step is mathematically equivalent to subtracting 1024 from the DC coefficient after performing the transform – which may be a better way to perform the operation on some architectures since it involves performing only one subtraction rather than 64 of them.)

(5). Quantisation
The human eye is good at seeing small differences in brightness over a relatively large area, but not so good at distinguishing the exact strength of a high frequency brightness variation. This allows one to greatly reduce the amount of information in the high frequency components. This is done by simply dividing each component in the frequency domain by a constant for that component, and then rounding to the nearest integer. This rounding operation is the only lossy operation in the whole process if the DCT computation is performed with sufficiently high precision. As a result of this, it is typically the case that many of the higher frequency components are rounded to zero, and many of the rest become small positive or negative numbers, which take many fewer bits to represent.

(6). Entropy encoding :-
It is basically a step where we apply Huffman coding/algorithm on the redundant information bit.

sighhhh.......... you would have never thought that these many steps take place, just while saving the image.

To reconstruct the image from these mathematical Data, an entirely opposite data transformation takes place, i.e. the encoded Data passes through the decoder, the inverse discrete fourier transform takes place, and so on and so-forth.

Technorati Tags: , ,

Thursday, 23 June 2011

Decoding GSOC

I applied for a position in this year's Google Summer of Code. Though frankly, prior to this year's GSOC, I had very little experience of Open source Software development, still I thought may be I should give it a shot. GSOC is a annual event that takes place from April to August, in which students code for various Open Source Organisations and Google pays them for it. If you complete your project, you get $5000, certificate and Google Goodies. The Theme says, flip bits not burgers. The whole event is based on getting more students familiar with Open Source.

I applied for Abiword this year, the very first organisation that appears in the list of participating organisations. AbiWord is a free word processing program similar to Microsoft® Word. It is suitable for a wide variety of word processing tasks. What makes Abiword special is its cross-platform characteristics. It runs on Windows, Linux and OSX too. Sadly I didn't get selected, but a Chinese friend of mine, 26 year old Phd student from Chinese Academy of Sciences, ChenXiajian got selected, who will complete the project, I applied for, Hyphenation Support in Abiword. Meanwhile, I made a lot of good friends in the Abiword Community. Even though I didn't get selected, but my friend Divyanshu Bandil, did get selected, in Ascend, where he will make a parser and compiler for ascend in python, due to its BSD licensing freedom. I also requested him to share his valuable experience, on how to get selected in GSOC. And even though he is very busy, trying to meet Deadlines, but he did spare some time, and shares his account.

By Divyanshu Bandil

After getting my proposal selected for GSoC 2011, my friend asked me to share the experience on his blog. So here are some tips for future aspirants.

1. Ignore the hoopla - The first impression you get about the program is that you have to be too skilful and a 'supercoder' for getting selected. You tend to think that the other guy who got selected is a magician in coding and carries all the algos at the tips of his hand. Though it is necessary to have some amount of experience in programming (hey! you already have that or why else would you be applying then?) and it helps if you have knowledge of basic data structures and some algorithms. But the fact is GSoC is more of doing a project and learning on the way. So believe me if you have the will to learn and work hard than nothing can stop you from getting selected.

2. Get your act together - I hope I have got you motivated enough to work forward. First of all ask some basic questions from yourself. What type of organisation/software you would like to work for? Which programming language you are comfortable to work with? Which is the the platform you would to interested to develop for?etc. You need not be too decisive but its good to have a general idea about the nature of the project you would be interested to work on.

3. Bond with the org - Based on the above answers choose two or maximum three organisations you would be interested to work for. Join their mailing lists and IRC. Chat with the members of the community. Discuss about the project idea you would like to work on. Try to contribute to the code by solving a bug or maybe adding a small feature. This improves your chances of getting selected by helping you to showcase your capability. The idea is to know the community and show that you will be able to work for them.

4. Writing the proposal - Once you have discussed about the project and are confident enough in its implemention, next step is to write your proposal. Most organisations provide a template for writing a proposal. However there are some things you should always mention in your proposal. First of all write a small abstract of the project. Provide some implementation details of the idea. Also provide a tentative schedule you will follow. Add some bits about your prior experience in programming. Its good to provide links to any project you have worked previously. Also submit your proposal early which leaves time enough to get it reviewed. Subsequently, you will be able to remove any loopholes in your implementation and make your proposal better.

After submitting your final proposal, just keep your fingers crossed!

Thanks a ton Divyanshu, for sharing your experience, with others. I hope it would be very useful to the future aspirants, in-case you have a question just fire away.

Technorati Tags: , , , , , ,