Installing VLC Media Player 1.1.11 in Ubuntu Natty Narwhal

The default VLC media player that is included with Ubuntu Natty Narwhal is VLC 1.1.9 which is quite old for now as two versions have already been released after that. However, the problem is that people at Ubuntu have not pushed the latest version of the player on Ubuntu Software Center and through the Update Manager.

The point of writing this post is that I have been facing some issues with the older version of VLC, that is 1.1.9 and was unable to upgrade it through simpler means. VLC 1.1.9 has some audio/video syncing problems, especially when you are in a habit of rewinding/forwarding movies. The unsync problems become much pronounced on several instances of seeking. First, I thought that the video clips were corrupt but later I crosschecked with VLC on Windows and found that the culprit was the player on Linux. So here is a manual method of installing VLC 1.1.11 in Ubuntu Natty Narwhal 11.04.

 

Go to your terminal and type the following command:

sudo apt-add-repository ppa:chimerarevo/vlc/ubuntu

Note: This is an untrusted PPA.

This will add the required repository.

Now update the package list index by typing:

sudo apt-get update

Finally type this command after the package list index is updated:

sudo apt-get install vlc mozilla-plugin-vlc vlc-plugin-pulse

And you are done! Open VLC media player and check the version in the about page. Alternatively, type the following command in the terminal:

dpkg -s vlc

 

After the update, the audio/video syncing problems have improved to a great extent. Infact it is unnoticeable at all.

Cheers :)

 

Finding Out Package Information In Ubuntu

When you compile from sourcecode that are usually available in tarballs, there maybe many libraries or packages on which the sourcecode will depend on compiling. All these dependencies are usually mentioned from where you are downloading the sourcecode from.

However, you may have already got those libraries installed on your system and you may download it again. To prevent such situations, it is reasonable to check whether those packages are already installed or not. The method to find installed packages is given below.

For example, if you want to find whether the sudo program is installed on your system or not. Type the following commands in the terminal:

$ dpkg -s sudo

Hit enter and you should see some thing similar to this:

Package: sudo
Status: install ok installed
Priority: optional
Section: admin
Installed-Size: 756
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: i386
Version: 1.7.4p4-5ubuntu7.1
Replaces: sudo-ldap
Depends: libc6 (>= 2.11), libpam0g (>= 0.99.7.1), libpam-modules
Conflicts: sudo-ldap
Conffiles:
 /etc/pam.d/sudo 402488da83015090763d681fffae6340
 /etc/sudoers.d/README 2ec19eb188781dd8e2ff0ad509399497
 /etc/sudoers bb3dd9531a53d7dc6fe26d2e019d7456
 /etc/init.d/sudo 8dd3c1c4fb7582466676fd00d31cdc9b
Description: Provide limited super user privileges to specific users
 Sudo is a program designed to allow a sysadmin to give limited root
 privileges to users and log root activity.  The basic philosophy is to give
 as few privileges as possible but still allow people to get their work done.
 .
 This version is built with minimal shared library dependencies, use the
 sudo-ldap package instead if you need LDAP support for sudoers.
Original-Maintainer: Bdale Garbee <bdale@gag.com>

So the important part of the command here is “dpkg -s PACKAGENAME” through which you can find the information related to the package.

 

6. The Decision Control Structure

When you develop a computer program decisions have to be made on the input given by the user. For example you are developing a computer game so definitely you have to determine what happens when user presses the right or left arrow keys or what happens when one presses a spacebar, or if you are developing a calculator program you need to make sure that you handle errors like division by zero etc. In a nutshell decision making is one of the most important tools of programming.

This post discusses how we implement decision making and use of some operators we discussed in the previous post. The tools we have to implement this technique are the, if…else statements and switch cases. We will implement one program twice, first with the, if else statements and second using the switch cases. The program will take three, first two being the integers and a character which will tell what operation is to be performed on those integers.

Consider the following program


#include <stdio.h>
#include <conio.h>

void main()
{
int num1;//integer to store the first number
int num2;//integer to store the second number
char operation;//character to store the opertation

//prompting the user to input number1
printf("Enter Number 1: ");
scanf("%d",&num1);
//prompting the user to input number2
printf("Enter Number 2: ");
scanf("%d",&num2);
//prompting the user to input operation
printf("Enter the operation: ");
scanf(" %c",&operation);

//checking of operator is a plus sign
if(operation == '+')
printf("\nAnswer: %d",num1+num2);
//checking of operator is a minus sign
else if(operation == '-')
printf("\nAnswer: %d",num1-num2);
//checking of operator is a multiplication sign
else if(operation == '*')
printf("\nAnswer: %d",num1*num2);
//checking of operator is a division sign
else if(operation == '/')
printf("\nAnswer: %d",num1/num2);
else
printf("\nOperation Entered was invalid");
getch();
}

If else statements works on the following syntax:
if(condition is true)
{
execute the code here
}
else
{
execute the code here
}

Well the syntax is easily understood, it works like, if the condition within the brackets is ture then execute the if block otherwise execute the else block , now get into the program above keeping in mind the syntax, we first took the input from the user and one after the other we checked what was the operation if it was a plus sign we told the computer to add the two numbers, else if, it was a minus sign we told the computer to subtract the two numbers until we checked all the four basic operations. if was none of the above we told the computer to print that the operation entered was invalid. It is not necessary to use else and else if with if. We can use single if condition. We used else if in our program thrice, it was to make our program efficient, for e.g. if user entered plus operation, so the first condition will be executed and computer will not go through the other conditions, saving our time. If we did something like this

//checking of operator is a plus sign
if(operation == '+')
printf("\nAnswer: %d",num1+num2);
//checking of operator is a minus sign
if(operation == '-')
printf("\nAnswer: %d",num1-num2);
//checking of operator is a multiplication sign
if(operation == '*')
printf("\nAnswer: %d",num1*num2);
//checking of operator is a division sign
if(operation == '/')
printf("\nAnswer: %d",num1/num2);

This is not an efficient way because if first condition got true there is no point checking for other conditions.There is another way implementing the same code that is much more efficient and increases the code readability, the switch cases.

Consider the following code


#include <stdio.h>
#include <conio.h>

void main()
{
int num1;//integer to store the first number
int num2;//integer to store the second number
char operation;//character to store the opertation

//prompting the user to input number1
printf("Enter Number 1: ");
scanf("%d",&num1);
//prompting the user to input number2
printf("Enter Number 2: ");
scanf("%d",&num2);
//prompting the user to input operation
printf("Enter the operation: ");
scanf(" %c",&operation);

switch(operation)
{
case '+':
printf("\nAnswer: %d",num1+num2);
break;
case '-':
printf("\nAnswer: %d",num1-num2);
break;
case '*':
printf("\nAnswer: %d",num1*num2);
break;
case '/':
printf("\nAnswer: %d",num1/num2);
break;
default:
printf("\nOperation Entered was invalid");
}

getch();

}

 

The input and output statements are the same as they were in the previous program whereas conditional statements are a bit different here. We used the switch case, this is the best way to make decisions when we have to select from a number of choices, for example we have to display a menu to chose from so we can use switch case there to display outputs based on the choice that user makes. In the code above we check which case best suits the operation selected by the user, so we told the computer to switch operations to check which one is selected by the user, one by one we check through the cases. Once we matched the results, code with in that case is executed, then comes the break statement this is something new, this statement tells the computer to leave the switch block, i.e. we have done our job (we found our case there is no point checking out the other cases), if we don’t write that way, i.e. if break statement is ignored and a case gets true, all the other cases after that are also executed, try removing one or more break statements and see the results, then comes the default case, this works when no other case gets true.

I hope that was not so difficult it was just a bit details that made it lengthy. Just try some more examples and operations to completely get into the code, hopefully you will hack it.

Qwerty For Your Thumb Love

This is the first segment of the mega shopping list saga. The QWERTY has always been considered as a serious executive/business phone, up until the birth of social networking. Research In Motion, better known for their Blackberry mobile phones, set a trend to encompass half a decade of dominance. The Blackberry was the master of every QWERTY out there and we’re considering Palm Treo as a major threat as well. But times have changed and phones like the Blackberry 7250 will not cut it in the summer of the year 2011. Even the QWERTY needs to check itself on how well it fares in multimedia deliverance.

There is no better joy than a physical keyboard for a frequent texter or email junky. I would go as far as to say that a web browser feels incomplete without the “F” and “J” right under your thumb tips (something you can’t do with the iPhone). The following is a list of mobiles with short reviews to help you in choosing your QWERTY.

  • On a budget:

We’ve got two wonderful physical keyboard sticking phones for you if you are on a budget. These toys might not give you BES standard encryption, but they surely will satisfy your facebook and twitter trolling natures.

 

Nokia X2-01

 

The X2-01 is £65 sim-free(meaning that it is not locked on a carrier and comes without a sim). It definitely looks its part with a curved back and hard plastic all around it.

A keyboard you can bash on, this QWERTY mobile looks a lot more expensive than it actually is. A VGA camera that produces shoddier pictures than your grandmothers sepia film camera might be a deal breaker, seeing how a 2MP sensor is borderline acceptable. But we doubt you’d really care about the camera if you are paying such a low price for all the features you get. It’s got a great looking QVGA TFT screen, that makes viewing your social feeds and text messages easier; a 3.5mm jack with a capable mp3 player; and S40 UI, a snappy user interface for entry level mobile phones from Nokia with no multitasking and limited 3rd party support. It runs Opera Mini 4.2 as its default web browser but with no 3G or WLAN this phone won’t cut it for anything other than mobile versions of websites.

Not much else can be said about a phone that plans to keep all its promises. Your IMing cravings will be answered by Nimbuzz or eBuddy, both capable multi IM applications. If you can live on EDGE (2.5G) and do not need WLAN then this this un’ will do it.

 

Nokia E5

This sturdy looking slab of a mobile should be your pick if you want social networking on the go, and a capable yet boring looking UI.  Symbian S60v3 used to be a giant in the 2007s. It isn’t now. It has limited number of apps but at £130 sim-free this phone has a lot to offer.

The Nokia E5 has great multimedia capabilities, a fixed focus 5MP camera that gives acceptable results and VGA recording. A great music player with splendid audio quality and a vast amount of format compatibility should keep most audiophiles happy, but the headphones out of the box are a disappointment. Connectivity is completely dealt with, from WLAN, HSDPA and GPS to a competent web browser. Mind you, Opera Mini 6 should still be your choice of web browser (as I am currently using on it). Ovi Maps is still the best map solution out of the box after Google Maps, and with free lifetime walk and drive navigation license.  The only place where it really disappoints is its display. A QVGA TFT screen at around twice the price of the Nokia X2-01 is a disappointment. For some peculiar reason its sunlight eligibility is not as good as the X2-01’s. But people wanting a do it all at a budget price shouldn’t mind this slick and neat package.

 

  • Mid tier

 

Xperia Mini Pro (2011)

This Android 2.3 equipped handset is the best of both world at an almost affordable price. At around £220 sim-free, this latest offering from Sony Ericsson and the successor to last years X10 mini pro is a touch screen smartphone with a lovely QWERTY keyboard. Our time with the handset made us love this phone.  The build quality is good with a chrome plastic feeling border around the slider. The slider itself is robust and not loose at all (unlike the HTC Desire Z, that slider is downright awful, and too loose).

A quick zippy 1Ghz Snapdragon is the heart of this little guy. But do not judge a phone by its size. It is capable of performing everything expected from the latest phones on the market. A huge library of apps  and games await your installing and uninstalling regimes from the Android Market. The camera is definitely not the best 5MP out there, but it certainly gets the job done (For a comparison: Sony Ericsson Elm > Xperia Mini Pro > Nokia N95 > Nokia E5). It has social networking integrated in the firmware, something that makes it different from other Android offerings and it certainly gives the same experience as the flagships from SE, the Arc and Neo V. The browser is capable of flash and pinch to zooming with text reflow and tabbed browsing, we at thetechnofreaks lovvee the simplistic default android browser. Almost as much as Safari :P .

But where this handset falls short is its battery life. Touted to have 340 hours of standby time and 5 hours 30 minutes of talk time, this mobile will need to be charged every night after a hard days work. And with a bit of gaming you can make sure you carry your charger with you everywhere.

This handset should be your first choice if you want a responsive touchscreen and the latest apps with a good crisp HVGA (480 x 320) 3.0 inch LED back lit screen and a good hard bash-worthy physical keyboard for your texting fantasies. Just make sure you have a backup battery or a charger with an outlet nearby. And did I mention XDA-developers jumping on any and all phones. Your favourite ROMs won’t go unnoticed.

 

  • Lots of Quids:

 

Blackberry Bold Touch 9900

Now if you haven’t heard of this handset, you probably don’t want to either. This is the QWERTY keyboard defining handset, and it will certainly make your stomach churn, just by looking at the price. At £550 sim-free, the Blackberry Bold 9900 will certainly break your bank. The QWERTY offers BES and the blackberry data plan should have your BBM (blackberry messenger) and Blackberry Map applications covered. The phone is thin, thin enough to go unnoticed in your pocket. And the keyboard! We just can’t stop tapping on the curved contours of this magnificent and spacious keyboard. If you want your keys to love you and not start a revolution because of your forced typing habits on the touchscreen keyboard these days, then this is the phone for you ( if you can afford it).

From the software point of view it has Blackberry’s OS 7 with liquid graphics (another way to say that the touchscreen is iphonishly smooth). There aren’t too many apps for it and the OS has its restrictions but its useable and old Blackberry users should be at home with the UI. The small 2.8 inch VGA (640 x 480) screen is sharp enough to make even the smallest text readable, but shouldn’t be enough to watch movies on it. And a 1.2 GHz QC processor should be enough to keep the redefined web-kit browser up and running even on the heaviest of website. And the Blackberry trademark trackpad is good enough for you to think twice about smudging your touchscreen. But with a fixed focus eDoF 5.0MP camera, and unsatisfactory 720p video the camera side of things disappoint slightly. When you are paying such a hefty sum of money you should get the best of everything. The music player is above average and music sounds good even with the headset out of the box. Connectivity has you covered with everything you’ll ever need.

The phone sips through the battery and should last you 2 days even on real-time exchange mail and constant bickering with your wife in your office ( we’re assuming you have to be earning a lot to afford this one here).  But we doubt you’ll care about the NFC(Near Fields Communication) support added to this handset and should make pairing with other NFC devices as easy aswaving your phone around. But for its meticulous keyboard, we have to say that there is no better one out there. If it’s a keyboard you want, then this is the phone for you.

You just have to live with this fact though. Nothing is perfect. It is for you to decide whether all these features are worth that sort of money, we would’nt have minded if it was a 100 quid cheaper though. It is still the best QWERTY on the market right now.

thetechnofreaks Shopping List

To buy, or not to buy, that is the question? It’s that time of the year where you can see numerous releases from mobile phone manufacturers all over the place. From the noobs to the mighty nerds, we’ve all got our shopping lists spread out around us. Now what people get confused with are products that they want, and ignore what they actually need. That is why, we at thetechnofreaks have made the effort to make your choices easier, and let you make sure you get the best value for your money.

The lists will be divided into broad categories followed by short reviews. Move along our Reviews section for all the information you need.

The posts that follow will be targeted at particular audiences. Take your pick, according to your budget. Stay tuned :)

 

 

 

5. Getting a bit techie, Dealing with operators.

To work with efficient programming techniques we need to know some basic operators, a list exist categorizing the operators in almost every programming language. Some of the basic operators are as follows

  •  Arithmetic operators
  • Comparison operators/Relational operators
  • Logical operators
  • Compound assignment operators

Arithmetic Operators

Operator name

Syntax

Definition

Basic assignment

a = b

Used to assign values to left hand side of the operator.
Addition

a + b

Adds b into a
Subtraction

a - b

Subtracts b from a
Multiplication

a * b

Multiplies a with b
Division

a / b

Divides a with b
Modulo (remainder)

a % b

This gives you back the remainder when a is divided by b.
Increment Prefix

++a

First makes an increment in a and then executes the statement. Also known as pre-increment.
Suffix

a++

First executes the statement and then makes an increment in a, also known as post-increment.
Decrement Prefix

a

First makes a decrement in a and then executes the statement. Also known as pre-decrement.
Suffix

a

First executes the statement and then makes a decrement in a. Also known as post-decrement.

The code below shows how to use these operators and tries to explain the difference between the increment and decrement operator types.


#include <stdio.h>
#include <conio.h>

void main()
{
int num1=10;//an integer to store the value of number 1
int num2=5;//an integer to store the value of number 2

//adding the two numbers
printf("Sum of two numbers is: %d\n",num1+num2);
//subtracting the two nnumbers
printf("difference of two numbers is: %d\n",num1-num2);
//multiplying two numbers
printf("Product of two numbers is: %d\n",num1*num2);
//dividing two numbers
printf("Quotient of two numbers is: %f\n",num1/num2);

//using mod operator, gives 0 when 10 is divided by 5
printf("Remainder of two numbers is: %d\n",num1%num2);
//the value of num1 is incremented by 1
printf("Pre increment: %d\n",++num1);//pre increment
//you will see that the value remains the same, i.e 11 in this case
printf("Post increment: %d\n",((num1++)+1));//post increment
//after the previous statement was executed the value of num1 was incremented
printf("The changed value: %d\n",num1);
//the value of num2 is decremented by 1
printf("Pre decrement: %d\n",--num2);//pre-decrement
//you will see that the value remains the same, i.e 4 in this case
printf("Post decrement: %d\n",num2--);
//after the previous statement was executed the value of num2 was decremented
printf("The changed value: %d\n",num2);

getch();
}

Only thing that may get complex was the difference between the two types of decrement and increment operators, it is really very simple the post operators only perform its action after the statement has been executed, and pre increment only performs the operation before the statement has been executed. Try doing the following to get a more clearer picture


int num1=10;

printf("Pre increment: %d\n",++num1);//pre increment

printf("Post increment: %d\n",((num1++)+1));//post increment

printf("The changed value: %d\n",num1);

num1 will be incremented to 11 in the first statement, after that 11+1 will be performed and 12 will be printed on the screen, in the third one the 11 will be incremented to 12.

 

Comparison and Relational operators

Operator name

Syntax

Definition

Equal to

a == b

Checks whether a is equal to b.
Not equal to

a != b

Checks whether if b is not equal to a
Greater than

a > b

Checks whether a greater than b
Less than

a < b

Checks whether a is less than b
Greater than or equal to

a >= b

Checks if a is greater than or equal to b
Less than or equal to

a <= b

Checks whether if a is less than or equal to b

Logical operators

Operator name

Syntax

Definintion

Logical negation (NOT)

!a

A Boolean operator that returns true id operand is false, and returns false if operand is true.
Logical AND

a && b

Returns true if and only if both the operands are true.
Logical OR

a || b

Returns true of any one of the operands is true.

Compound assignment operator

Operator name

Syntax

Definition

Addition assignment

a += b

Just as a = a+b, i.e adds b into a and assigns the answer to a.
Subtraction assignment

a -= b

Just as a = a-b, i.e subtracts b from a and assigns the answer to a.
Multiplication assignment

a *= b

Just as a = a*b.
Division assignment

a /= b

Just as a = a/b.
Modulo assignment

a %= b

Just as a = a%b.

Well this was just an introduction of what are operators and what do they do, we will see how do we practically implement these operators hopefully in the next post.

Steve Jobs – An insight into his career

As the world is revolving around the news of Steve Jobs’s resignation, we have found a great infographic showing how the technology revolutionist progressed to become one of the most influential person in the technology world we live in.

[via ColumnFiveMedia]

[via ColumnFiveMedia]

Search Quran Software (from Pakistan) – the only Quran search engine with complete Roman Urdu Translation

Zahid Hussain, a software developer from Pakistan, has developed a Quran Searching sofware that features complete Roman Urdu translation, as mentioned on his personal blog (English, Arabic and Urdu are available as additional languages). According to his personal blog, he works as a system analyst in a private firm and has completed Search Quran Software in about one and a half years. The sofware is available for download free of cost from the personal blog of Zahid Hussain.

Zahid Hussain was also featured in the country’s top television program, ‘Aaj Kamran Khan ke saath’, on 25th August.

Following are the salient features that are  a part of this software:

  • The software is available free of cost and can be downloaded here.
  • Is available in four languages, English, Arabic, Urdu and Roman Urdu (the language of text messages in Pakistan).
  • The software can search for particular Parahs and Surahs.
  • Can directly go to a particular Surah number, Ayat number and Parah Number.
  • Contains a dedicated subject section that contains all the subjects that are discussed anywhere in the Holy Quran.
  • Any topic  discussed in the Holy Quran can be searched by entering queries in English, Urdu and Roman Urdu.
Following images show some features of the software.
“Sabar” query returned this content from the Holy Quran (It contains Ayats that discuss the topic “Sabar”)

"Zakat" query returned this content from the Holy Quran (It contains Ayats that discuss the topic "Zakat")

 

The version we were able to download was Search Quran 2.1. This is a nice effort from the developer of this software and is a commendable effort from him.
More links: