Wednesday, April 27, 2011

Bye Bye Typewriters, but really ?? are they dead?

Bye bye typewriter ( Rest in peace)

A recent news has generated lots of hype on twitter. The news was:
Godrej and Boyce – the last company left in the world that was still manufacturing typewriters – has shut down its production plant in Mumbai, India with just a few hundred machines left in stock.

Although typewriters became obsolete years ago in the west, they were still common in India – until recently. Demand for the machines has sunk in the last ten years as consumers switch to computers.

But now if we scrutinize the matter, we will find that Typewriters are not yet dead( though they will die sometime very soon) . It is law of nature that Things which will come to the world has to end one day. Yellow bulb is also dying, and there are other products as well which are becoming obsolete. But completely eradicating such things is not easy. Still when ever you will go to any typing school(even to learn typing for computer keyboards) you will get first hands on experience on a typewriter.

Coming back to the basic question "Are typewriters going to have silent death". Answer is YES!! they will die. With the advent of technology, palmtops are the new trend, tablets are becoming popular day by day. In such scenario even desktops will have to fight for its survival, So typewriters have to go. But there would surely be many people on earth who will use them and keep them alive.

Don't worry typewriters will live in our heart, they have given us the qwerty method still used in even tablets and palmtops. We also use the shift key, the idea was borrowed from typewriters. Typewriters are old now and will have to die, we just wish that the contribution of typewriter in advancement of science should be remembered for ages.

Tuesday, April 26, 2011

Ecolibrium : Smart grid technology, A hope for better future

Have you ever wondered, how nicer the world would be if the electricity wastage could be reduced and the saved energy could be transferred to the world in darkness. India is a developing country, so are many other countries in south america, Africa and Asia. We all are thriving, but not everyone. Why not do things smartly, Harit Soni also thought the same.

If his invention would be successful, We would see drastic change in the way we use energy(electricity). At their official site they have mentioned the following solution to current power crisis:
Our solution consists of the following components:
• Intelligent Home Power Monitoring system
..provides consumers with essential data to make smart energy choices
• Integrated Intelligent Grid Monitoring system
..Integrating and tracking energy from various energy sources including grid power
• Analysis and energy forecasting
..Provides valuable information to utility companies in efficient generation and transmission of power

Ecolibrium The smart grid

The basic Idea of Harit is to make Electric grid more intelligent and try to make a smarter planet. While Soni's daring project and brainchild  is not reached to every one out there but it is just started a new revolution. This project is supported by Indian government, and Soni recently won TR35 award. To read more about this project(Ecolibrium) Click Here.

 

Wednesday, April 20, 2011

Olive Launches OliveFluid V W1(Low cost Android phone or is it?)

OliveFluid V-W1

Olive telecom the company behind OlivePad Launched a low end - low cost Android phone.  Looking at the specs and price ratio we do not feel that it will be a super hit in market. You can buy the phone online at 10500 Rs. with old Android 2.1 and 3 Mp camera this phone is pretty ordinary, the only good thing I can see is 3.5 inch capacitive screen. One of the unique feature you can have with Olivefluid is shipped with 6 months free subscription of zenga tv.

You can have a look at technical specifications of phone:



















































Operating SystemAndroid OS, v2.1 (Eclair)
Central processing UnitSTE6715, 468MHz Processor
DesignWeight (Grams) : 117g
Dimensions (mm) : 109 x52 x14.8
MemoryFlash Memory : 256MB
Expandable : MicroSD, up to 32GB
Display FeaturesSize : 3.5 Inch (HVGA)
Screen : TFT Capacitive TouchScreen
Resolution : 320 x 480
CameraCamera : 3 MegaPixel
Video Player & Recording
Media Format SupportAudio : MP3
Video : MP4, 3GP
Photo : JPEG, PNG, GIF, BMP
BatteryRating : 1300 mAH
Talk Time : Upto 240 Mins
Standby Time : Upto 192 Hours
Radio Band & StandardGSM Bands : 900 / 1800 / 1900
3G HSDPA : 7.2 Mbps (900 / 2100)
GPRS Class : Class 12
EDGE Class : Class 12
Connectivity3G : Yes
GPS : Yes
Wi-Fi : Yes
Bluetooth : Yes, v2.0 with A2DP
USB : Yes, v2.0 microUSB
SensorG-Sensor : Yes
Proximity Sensor : Yes
Multi Touch Capacitive : Yes
Special FeaturesEmail : POP/IMAP/Exchange
Digital Compass
3.5 mm Audio Jack
SMS, MMS, HTML Browser
PC Sync Functionality

At first look this phone just looks ordinary, Lets see how it behaves in market. You never know what customers are looking for. Our final verdict for the phone is, this phone at a price of 10K+ is not worthwhile, had it been around 8K than I would have said that this phone is a must buy. You can visit the official page here.

Monday, April 18, 2011

Quality, Quantity and Economy



Many a times, I had discussion with some of friends (individually) about some of the electronic gadgets they wanted to buy and I told them better and cheap alternatives. The motivation of this post was recent argument I had with one of my friend while I was suggesting him an Android phone to buy. My friend wanted to buy a normal priced Android phone Ranging between 12000 to 15000. I told him that you can buy "HTC Wildfire". He went to a shop and and saw it and came back to me that I am going to but it as it is an awesome phone.

At that moment I showed him my mobile "Spice MI300", He saw it and then gave back to me without asking the specs. I asked him what is the thing he did not liked in my phone. He said that it is from Spice ( Spice is know for making cheap phones), I asked again that what is the reason behind such opinion. He said that my brother bought a spice phone for 3000 Rs it was awful.  That was enough to start an argument. While putting forward my arguments I showed him n number of reasons that were enough to state that HTC wildfire is no way better that Spice MI300.

Lets compare the specs of the two models, but before that Let me introduce you to both of the phones.

HTC Wildfire: The HTC Wildfire is a smartphone developed by the HTC Corporation, that was announced on 17 May 2010.

Spice MI300: This is  Commtiva Z71 variant, Those who don't know what is Commtiva Z71 its is the cousin of The Geek's phone one. The same model is re-branded by many top brands like LG and Motorola.

 

Specs*:













HTC WILDFIRECOMMTIVA Z71(SPICE MI300)












































POWER1300 mAh internal rechargeable removable lithium-ion battery
CPU528 MHz Qualcomm MSM7225 ARM11 processor
STORAGE CAPACITYFlash memory: 512 MB
microSD slot: supports up to 32 GB
MEMORY384 MB RAM 

 
DISPLAY240 x 320 px, 3.2 in (81 mm), QVGA TFT LCD
INPUTMulti-touch capacitive touchscreen, digital compass, proximity and ambient light sensors, 3-axis accelerometer
CAMERA5 megapixel with autofocus & LED flash
CONNECTIVITYWi-Fi (802.11b/g), Bluetooth 2.1+EDR, microUSB, 

A-GPS, FM Radio
Quad-band GSM 850 900 1800 1900 MHz GPRS/EDGE and

Dual-band 900 2100 MHz HSPA/WCDMA
DIMENSIONS107 mm (4.2 in) (h)
60 mm (2.4 in) (w)
12 mm (0.48 in) (d)
WEIGHT118 g (4.2 oz)













































POWER1230 mAh internal rechargeable removable lithium-ion battery
CPU600 MHz Qualcomm MSM7227 ARM11 processor
STORAGE CAPACITYFlash memory: 512 MB
microSD slot: supports up to 32 GB
MEMORY256 MB RAM
DISPLAY320 x 480 px, 3.2 in (81 mm), HVGA, LCD
INPUTMulti-touch capacitive touchscreen display, volume controls, ambient light sensors, 3-axis accelerometer, digital compass
CAMERA5.0 megapixel with auto focus and LED flash
CONNECTIVITYWi-Fi (802.11b/g), Bluetooth 2.0+EDR, microUSB, A-GPS
Quad-band GSM 850 900 1800 1900 MHz GPRS/EDGE
Tri-band UMTS 900 1700 2100 MHz (Europe & Asia) or
Tri-band UMTS 850 1700 2100 MHz (North/Latin America, Australia & China) or
Tri-band UMTS 900 1900 2100 MHz (European Orange Boston)
DIMENSIONS114.9 mm (4.5 in) (h)
56.8 mm (2.24 in) (w)
12.6 mm (0.496 in) (d)
WEIGHT114 g (4 oz)


You can see that Commtiva gives a tough fight and in-fact can be declared as winner if you don't go by brand.

Now the major question is why people choose Brand as a factor without doing a good research on what they buy. Wildfire costs 100$ more than Z71. Does that makes it good?  Warranty is same in both. There are other pair of products which have a huge difference in pricing yet Quality is same. You may take an example of Mac-book-Dell pair.

The most prominent product pair with huge difference yet with almost same quality is Linux-windows.

After all Shakespeare said " What's there in the Brands". Once a company becomes a brand they uses its name to generate money. Please before buying a product go through what all it has to offer and is it worth that price. In current world , Price- Quality-Quantity lost its correlation.

 

* source: http://wiki.cyanogenmod.com/


 

Sunday, April 10, 2011

Yet Another Blogger Vs. Wordpress Article

When Internet is filled with plethora of Blogger Vs Wordpress articles which may take ages to read and at the end you will remain totally confused that who will win. Yesterday night I had a hot discussion with Shubham Gupta( author of Techquark). We both by our nature are very rigid, and stand for what we like. Though I like both blogger and wordpress but I took side of Wordpress. In the course of discussion I was unable to convince Shubham  that Wordpress is better. Shubham only had one argument "Tell me one single thing which Blogger can not do and Wordpress can?".


I had so many to tell but I was unable to frame my word to a person who is not completely aware of wordpress. Its really difficult to tell a person that what is better in Wordpress who has only half knowledge of using it. I agree that to "blogger used to guy" initial impression of Wordpress is not great, "I could do that in Blogger too". So I went by gazillions of blogs and posts analysed many of them. So without any further delay, Let the battle commence between Blogger and Wordpress.



Introduction:


Blogger:

Blogger is a blog-publishing service that allows private or multi-user blogs with time-stamped entries. It was created by Pyra Labs, which was bought by Google in 2003. Generally, the blogs are hosted by Google at subdomain of blogspot.com. Up until May 1, 2010 Blogger allowed users to publish blogs on other hosts, via FTP. All such blogs had (or still have) to be moved to Google's own servers, with domains other than blogspot.com allowed via Custom URLs.(Source: www.wikipedia.com)


Blogger's ride was not smooth all the time, even backed by Google, blogger was criticized due to many glitches it had and have. We will discus them in detail.



Wordpress:


WordPress is an open source blog tool and publishing platform powered by PHP and MySQL. It's often customized into a Content Management System (CMS). It has many features including a plug-in architecture and a template system. WordPress is used by over 13% of the 1,000,000 biggest websites.It was first released on May 27, 2003, by Matt Mullenweg as a fork of b2/cafelog. As of February 2011, version 3.0 had been downloaded over 32.5 million times.(Source: www.wikipedia.com)


Wordpress was also not flawless. But Wordpress is always adored by professionals and WebMasters. Lets see why Wordpress is one of the most successful platform in top websites.


We will test both platforms, compare them and finally rate each feature on a scale from 1 to 10. Lets see who will win.







The War:


OwnerShip


Blogger: Being a product of Google may have N number of advantages but when it comes to ownership, bloggers who blog on blogspot have nothing in hand. It is clearly mentioned in Blogspot's TOS:





  1. Google may, in its sole discretion, at any time and for any reason, terminate the Service, terminate this Agreement, or suspend or terminate your account. In the event of termination, your account will be disabled and you may not be granted access to your account or any files or other content contained in your account although residual copies of information may remain in our system for some time for back-up purposes.

  2. Unless expressly authorized in writing by Google, you agree not to reproduce, duplicate, copy, sell, trade, resell or exploit for any commercial purposes (a) any portion of the Service, (b) use of the Service, or (c) access to the Service.



When Google disables your account you have nothing in hand. Just by Googling you can get an estimate of how many blogspot bloggers have temporarily or permanently lost their blogger account, it takes a long process to activate every thing again(even if you are innocent). Here is an interesting article to read.


WordPress: Wordpress on the other hand is an opensource content management system, which you can install on any server supporting php and mysql. Installing on most of the servers are easy using fantastico, even upgrading is very easy. Once installed on your domain you are the sole owner of your blog and your account can not be disabled by any one. For professional bloggers ownership is one of the very important aspects.


Rating:


Wordpress gets 9/10 in Ownership (not given 10 because you may have to comply to TOS of your web server provider)


Blogger gets 3/10 in Ownerhip (3 rating is given due to authors having ownership over content)



Money Matters


Blogger: Blogger is absolutely free, hosted on fast Google servers and which are never down(on papers). Having your own custom domain is as easy in just 10$.


Wordpres: You can have your free Wordpress blog on www.wordpress.com with your custom domain and servers are also quiet good. With 99.99% uptime and Fast servers Wordpress do not lag far behind Google. Self hosted servers are upto you what you choose.


Rating:


Wordpress gets 8/10


Blogger gets 9/10



Branding


Blogger: For all casual and amateur bloggers Branding is not as important as to Professionals. Blogger by default has irksome navbar(you can only remove it by changing style). Even when you have a custom domain, branding is one of the big problems.



In this image you can see "page not found" error of a custom domain with blogger branding.


Wordpress: Again you have complete control here also.


Rating:


Wordpress gets 9/10


Blogger gets 6/10



Theming Capabilities


Blogger: Theming capabilities of Blogger can never come at par with Wordpress. You have very limited options with blogger. though there are very good third party themes available for Blogger but that are mostly copy of Wordpress themes. While some Wordpress themes use jquery and other technologies which make User Interface awesome. Blogger has them but there is limit.


Wordpress: On the other hand in Wordpress have infinite themes. You can make your Wordpress look like twitter( click here to check out). You even can make it as online Magazine or what ever you dream of. Switching between themes is not even 1 pie difficult. You can have 10 themes and can activate any of them with one click. (You can not do that with third party themes in Blogger)


Rating:


Wordpress gets 8/10


Blogger gets 6/10



Gadgets Vs Widgets


Here is a tie, Both Blogger and Wordpress have So many of them. Ease of use are also equal in both. So I can give both a rating of 9/10. Though I can not forget to mention that most of the third party Gadgets have files hosted on their servers, This can be a disadvantage in many ways.



SEO


This is the most important and most confusing thing, I know all the blogspot users will say that Google owns Blogspot and thus they will give the best SEO and rank up in Google. I know Logically that should happen, but this is not the case.


Content is the most important thing, The only thing which is in favor of Blogspot is "Fast indexing", but once indexing is done there are other factors which comes to play and Blogspot can not beat Wordpress in those things.


Wordpress offers plugins which can create a site map, can edit robots.txt, can aid cross linking. So Wordpress has a little upper hand in SEO. Remember one thing Google can never compromise the quality of its searches just to make blogger up in their searches, Content is most important and is the best SEO technique ;).


Rating:


Wordpress gets 6/10


Blogger gets 6/10



What Blogger does not have and Wordpress have?


Ok, Now we are back to the basic question "Tell me one single thing which Blogger can not do and Wordpress can?". I have three things which are not available on Blogger but available on Wordpress


Media Library is complete image,video and audio management system all at single place. Blogger equivalents are Picasa and Youtube. As the files are hosted n your server you have complete rights on your content.


Categories are very different from tags Wordpress have tags(Blogger equivalet is labels) as well as categories. Categories lets a blog have different channels all for different purposes.


Plugins are often compared with gadgets by Blogspot users are very unique feature of Wordpress, you can do any thing with it. Its like a magic wand. You can only know the power of it only when you will use it. As the Wordpress way it




Plugins can extend WordPress to do almost anything you can imagine.



You can compare plugin to a software which extends capability of operating  system. Plugins have the ability to transform the WordPress platform into a separate system of its own. For example, there are certain plugins like shopping cart or membership site plugins that would transform a WordPress blog into a membership site. With some more plugins like payment portal, a simple blog turns into a sales letter.[source]



Where Wordpress lags


Wordpress has serious security concerns, though new versions are highly secure but still they can effect your blog if you do not have a backup. But We have seen very less attacks on some very famous websites, thus we can say that security flaws can be ignored. And as Wordpress is opensource security patches comes instantaneously.



The Verdict


I know any Blogger user/lover will not agree with me despite of any point I will put forward. But Wordpress is for professional bloggers Blogspot is not. Blogspot is best for new bloggers who do not know any thing about SEO, managing traffic etc., Blogger is ready steady go blog management system. Wordpress is much more than that, it is like a clay you can give it any shape you want. You have the total control.  I personally Like Worpress as well as Blogger. But Wordpress out beats handsomely in managing my content.

Friday, April 8, 2011

Buying Guide for iOS Device

Not got your iOS device yet, or looking to upgrade? We're here to help you decide Each iOS device packs in so many great features that it can be tough to know which is perfect for you. This post will help you to buy with confidence.

The iPod touch is the cheapest full-iOS device and boasts many iPhone 4 features at a fraction of the price. It's got the sharp Retina display, fast A4 processor, FaceTime video calling, can record HD video and connects to Wi-Fi networks. For web browsing, listening to music and shooting video, it's on a par with the iPhone 4. However, the iPod touch won't connect you directly to a mobile network. This means you can't make regular calls and can only access the web over Wi-Fi. But once you've bought an iPod touch, there's no contract or regular top-ups to pay for at all. And by using apps like Skype and Fring, you can still make calls over Wi-Fi. The iPhone 4 is arguably the ultimate mobile. It does everything the iPod touch does, but it has a better rear-facing camera and the Retina display feature In-Plane Switching(for improved viewing angles). Yes, there's the antenna issue, but a case solves this. You will be shelling out on a contract or PAYG top-ups for as long as you want to use the phone, though. Remember that the 8GB iPhone 3GS is still available, and it's very able performer. It runs iOS 4 well, but lacks the Retina display and FaceTime calling(since there's no front camera). The battery life and the rear-facing camera are inferior, too. However, it remains an impressive product. Then there's the iPad. You've got the choice of the Wi-FI only model, or you can pay more for a model including 3G mobile connectivity. Both have the A4 processor and a 9.7-inch screen. While neither has a camera, battery life is phenomenal. You can buy iOS devices in a number of places. The Apple Store-online or on the high-street-is the most obvious, and iPhones you buy from Apple aren't locked to a particular network, so you can easily use any SIM card. Many electronics retailers like Imagine and Croma sell iPods and iPads, and the big phone chains offer the iPhone on a variety of networks-although these may be carrier-locked. You can also buy iPhone direct from the networks that offer them, but these too will likely be locked to that carrier.

Buy This Device If -

iPod Touch :

  • You want a music player with cool extras

  • You've got a phone on along-term contract

  • You don't need the web everywhere

  • You want a portable gaming system

  • Your kids want their first iOS device

  • You've got more music than you can fit on an iPhone


iPhone :

  • You want the ultimate pocket web browser

  • You need to make phone calls

  • You'd like a good stills camera in your pocket

  • You want to tap into and post to social networks all the time

  • You need maps and directions at your fingertips at any time


iPad : You plan to watch lots of video

  • You'd like a more desktop-like web experience

  • You want to read books on it

  • You need to work on the move

  • You want to replace your bully laptop


Lastly, don't forget that you can get a second-hand iOS device. Check the Apple Store's refurbished section, or see what eBay has to offer. The Apple Store offers unto 35% discount and all refurbished products come with a one-year warranty. If you are buying from another person, make sure you see pictures of the device you want, and buy from a reputable seller. iPhone are available on pay-as-you-go (PAYG) and contract terms. Because the contract subsidies the cost of the iPhone, you pay less up front for the handset but, depending on the plan, it could end up costing you in excess over the contract. Do your calculations before signing-up. If you've bought a handset on its own, many networks offer SIM-only deals that give you many minutes or annual contract. Finally, some networks offer special iPhone PAYG packages, which provide a certain amount of data when you top up a given sum each month. Whatever plan you go for, make sure it includes a suitable data allowance-500MB per month should be enough for all but the heaviest users. Some deals also include use of certain public Wi-Fi hotspots. When you buy a 3G iPad, you will need a SIM card to enable you to browse the web or check email over a mobile network. BSNL, Vodafone and Airtel offer a range of plans. As an alternative to a 3G iPad, iOS 4.3 is expected to introduce mobile wireless hotspot functionality to the iPhone. This would enable a Wi-Fi only iPad to use your iPhone's 3G connection. It's not currently known if you'll be charged any more on your phone contract for this option. If you don't want to shell out for an iPhone or 3G iPad, there is another way to get online. Three's MiFI is a device that hooks into the mobile network and creates a little Wi-Fi hotspot, which you can connect your iOS device(s) to.

Upgrade or Switch Between iOS Devices If you've got an iOS device and are planning to upgrade it-from an iPod touch to a new iPhone, for example-you can easily transfer all your apps, photos, contacts, settings and more to it. Plug your existing device into your Mac or PC, right click it and choose Back-up. Once that's finished, connect your new device and you can either set it up as a clean start or restore it from the backup you just made. Select the Restore option and iTunes will turn it into a carbon copy of your old device. The only thing it won't transfer automatically is your music, since this will all be in your iTunes library anyway. You can then copy your songs manually or simply sync them automatically. If you then want to sell or give away your old device, remember to wipe your data off it. First, make sure everything's successfully made its way to your new one, then select the old one in iTunes, click the Summary button and choose Restore.

Why is Google's new +1 button Destined to Fail

A few days back Google launched a +1 button, which most are hailing as a rival to the Facebook like button and even Twitter’s retweet button, but for search results. Limited to your Google contacts and chat friends, Google hints at connecting +1 with Twitter, but noticeably doesn’t mention Facebook.



 


Will it be successful in bringing Google into the Social Networking club?
Google says, The +1 button is shorthand for "this is pretty cool" or "you should check this out."



I say its destined to fail.



I think the point is that we use facebook only for social networking. We can safely assume that interaction on facebook is generally informal. But since google's services are widely used for (semi?) professional purposes, it becomes a mess when Google tries to incorporate social networking into its existing services. This was what Google did with Buzz. And failed.
Unless our friends at Google devise some way of completely separating the personal contacts from the professional ones, the social networking ventures will have a high probability of failing. One of the key factors in the success of facebook might have been the fact that it can be completely separated from other forms of communication, not tied up to an existing service.
Again, Google says,



The next time you’re trying to remember that bed and breakfast your buddy was raving about, or find a great charity to support, a +1 could help you out. Just make sure you're signed in to your Google Account.

How many of us want to see their boss's +1's while searching? Or worse, how many want our boss's to see what we have been +1'ing on google search?


 


Another thing that comes to mind is that people will generally "Like"/"+1" once they have visited and viewed the page. Liking a search result based on page title and 3 lines of extract is senseless, and the correct procedure for +1ing would be :


 




  1. Search on Google.com

  2. Click on a result

  3. If u like it, come back to results page and click +1.


Which is obviously very unproductive and time consuming. I know that Google wants to spread this on web pages too, but i guess it is a matter of one simple fact:


"My friends are already on facebook."

It might seem very childish, but it is a very important point. Since +1 will obviously be incompatible(?) with Like, people will not shift unless everyone else they know shifts, and everyone else will not shift until everyone else shifts, which is the classical chicken-egg problem!


Website owners would not shift to a clone of facebook's Like button, unless Google comes up with something drastically new.


To get the button for your web site, use this Page. To enable it in your searches use this
PS: I want to believe that this is another one of those Google's April Fool's Jokes.

Compressing a file by dividing bytes in two parts

Initial setup(upset)


One day I was sitting idle and was thinking of why I can't compress my file after a certain level. So I came up with an Idea that we can divide a byte to two parts and then apply compression algorithm. I know that was stupidity but I tried it. I coded in c and divided each byte of a file into two parts four bits each. To understand what good will happen by doing so you must know about law of probability. Suppose a byte can have 8 bits so there can be 256 different combinations possible from 8 bits, thus it will become harder to find a pattern in the file( and FYI most compression mechanisms find pattern).


So I though that 4 bits will reduce the possible cases to only 16 different combinations which will increase pattern finding capability by 16 times( I guess), while just increasing the file size by two times. I found that though it does help in compression(mostly) but always increased compression ratio. Finally I gave up thinking that file compression is not possible this way, but I learned a good lesson. If 1 Mb file (suppose abc.xyz) is compressed to zip it becomes 0.8 Mb file, while when it is passed through my algorithm it makes abc.psl of file size 2Mb but when it is zipped it will give a 1 Mb(approx.) file.



functions to convert byte to bits and dividing it to two
char*byteToBits(char byte){
unsigned char i;
unsigned char *bits;
bits=(char *)malloc(8);
for(i=0;i<8;i++){
bits[i]=byte>>(7-i);
bits[i]=bits[i]<<7;
bits[i]=bits[i]>>7;
}

return bits;
}

char*byteToTwo(char byte){
unsigned char i;
unsigned char *bits;
bits=(char *)malloc(2);
bits[0]=byte>>4;
bits[1]=byte<<4;
bits[1]=bits[1]>>4;
return bits;
}


New approach


After a while I again started concentrating on files/bits/bytes. This time I experimented on many different files. I had two different ideas in my mind. But before that I will discuss my experiment:



Graph showing video files hexadecimal
graph showing values of flv file of 30 Mb(approx)

This graph is just like all other graphs my initial experiment drew. This graph is having values of count of each value from 0-15. In this experiment I came to know that in general every file has some top contributing hexadecimal values while other just contribute to the very least. Taking top four values will make 70-80%(approx.) of the total file. So we can have an opportunity to reduce the file size by rearranging bits of the file. But for that You have to get out of 8bit=1byte model. Think a file as a large array of ones and zeroes i.e bits, divide this array into four-four bit chunks. You will get an array whose data will always vary from 0-15. Now you will get an opportunity to reduce file size by having some encoding formula by which you can shrink these 4 bits. My first Idea was :




  • To compress 4 bit number the only way was to compress it in 3 bits; if I do so, I can only do this on selected 4 numbers.

  • The total frequency of those select 4 numbers must be greater than total frequency of rest of the hexadecimal(4 bit) numbers.

  • To pack four bits into 3 bits the first bit will be used for distinguishing between others and top 4 frequent hexadecimal numbers.

  • First two bytes of the file will have these four numbers.

  • To represent rest of the numbers we will use 5 bits and first bit will be used for distinguishing.


Now lets start with an example the good old one "The quick brown fox jumps over the lazy dog".


The above line has 44 characters, and when byte 1 byte to two 4 bits number each I got:



5 4 6 8 6 5 2 0 7 1 7 5 6 9 6 3 6 11 2 0 6 2 7 2 6 15 7 7 6 14 2 0 6 6 6 15 7 8 2 0 6 10 7 5 6 13 7 0 7 3 2 0 6 15 7 6 6 5 7 2 2 0 7 4 6 8 6 5 2 0 6 12 6 1 7 10 7 9 2 0 6 4 6 15 6 7 0 10

When I counted frequency and arranged them in decreasing order I got:



6 23
7 15
2 11
0 10
5 6
15 4
4 3
8 3
10 3
1 2
3 2
9 2
11 1
12 1
13 1
14 1

thus I got 88 numbers in total and sum of top four numbers will be 23+15+11+10=59. Thus I got frequency of top four numbers greater than 50% of 88. When I will write compressed file It will be in following format:



67 20 [0]5 [0]4 [100] [0]8 [100] [0]5 [110] [111] [101] [0]1 [101] [0]5 [100] [0]9 [100] [0]3 [100] [0]11 [110] [111] [100] [110] [101] [110] [100] [0]15 [101] [101] [100] [0]14 [110] [111] [100] [100] [100] [0]15 [101] [0]8 [110] [111] [100] [0]10 [101] [0]5 [100] [0]13 [101] [111] [101] [0]3 [110] [111] [100] [0]15 [101] [100] [100] [0]5 [101] [110] [110] [111] [101] [0]4 [100] [0]8 [100] [0]5 [110] [111] [100] [0]12 [100] [0]1 [101] [0]10 [101] [0]9 [110] [111] [100] [0]4 [100] [0]15 [100] [101] [111] [0]10

numbers in square bracket represent bits

thus using this approach I was able to save 30 bits i.e. 3 bytes when huffman encoding failed to do so.  I will post my second Idea and other ideas relating to this type of compression in upcoming blogs.


to be continued....