Saturday, 22 June 2013

HOW TO CONVERT ANY VIDEO TO MP3 USING VLC MEDIA PLAYER

HOW TO CONVERT ANY VIDEO TO MP3 USING VLC MEDIA PLAYER

Using Video converter is the best way to go about this, but if you do not have any, 
then there is no need to worry.
VLC media player supports converting any video to MP3.
This is how to do it:

* Download and install VLC media player in your laptop.
* Now run VLC to get this interface.
 
VLC interface
*Click Ctrl+R or simply go to Media and select Convert / Save...
  In the interface that appears, press the Add button to add a video file of choice.
  After adding the video, press the Convert / Save button.
Press the Add Button to select a video then press Convert / Save

*In the next interface, specify the location to save the resultant MP3 file. 
  Give the file a name and add a .MP3 extension.
  Change the Profile from the default to Audio -MP3 as in the picture below.
  Then click on the Settings button next to the drop down for the Profile.
Specify the location and name of the file and add .MP3 extension, then change profile to Audio -MP3
*In the next interface, ensure that the encapsulation is .wav and click Save.
Ensure that the encapsulation is .WAV and click save
*Click start to begin converting the file. 
  You should get an interface like the one below.
Let VLC stream the video without pressing any key until streaming is done.
*Let VLC stream the video while converting it to an Audio file.
 Do not press any key on VLC at this point.
 When VLC is done Streaming, just go to the destination file and play your new 
 audio file. 
 That is it.

Enjoy yourselves.

Friday, 14 June 2013

C++ Basic Game

A basic C++ game to generate a random number between 1 and 100

In this simple game, the program generates a number between 1 and 100. The user is then prompted to make a guess of the generated number.
If the guess is higher than the generated number, then the program informs the user that the guess is higher.
If the guess is lower then the generated number, then the program informs the user that the guess is lower.
If the guess is correct, then the user wins.
The user can only make a maximum of 6 guesses after which the program exits.

One can then adjust the game to suit their needs.

#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;

int main ()
{
int secret, coin, count = 0;
int i;
//Makes a call to the Random function
srand(time(0));
//Generates a random number between 1 and 100
secret = (rand() % 100) + 1;
i = 0;
while (i < 10000) {
srand(time(0));
coin = rand() % 2;
if (coin == 0)
count = count + 1;
i = i + 1;
}
//Initializing variables to use.
int secretn;
int guessn = 0;
int maxguesses = 0;
cout << "A secret number between 1-100 has been generated...\n"<<endl;
while (guessn < 6)
{
cout << "Please enter your guess?\n";
cin >> secretn;
if (secretn == secret)
{
cout <<"Congratulations!!!\nYou guessed right.\nNumber of guesses="<< guessn<<endl;
guessn = 6;
maxguesses = 1;
system ("pause");
}
else if (secretn >= secret)
{
cout << "Your guess is higher than the generated number...\n";
guessn++;
}
else if ((secretn <= secret))
{
cout << "Your guess is lower than the generated number...\n";
guessn++;
}
}
if ((guessn == 6) && (maxguesses == 0))
{
cout<<endl;
cout << "Too many guesses!!!\nThe game will exit now,please try again."<<endl;
system("pause");
}
return 0;
}

Thursday, 13 June 2013

A simple C++ program to calculate the area of a triangle using Heron's formula.

In this example, I assume that you know the Heron's formula and I only provide the code to implement it.
If you have a question, just post it as a comment and I will get back at you.

#include<iostream>
#include<math.h>
#include<conio.h>
using namespace std;
int main()
{
//Declaring the variables
double a,b,c,sum1,sum2,sum3,p,area;

//Getting the values from user and setting conditions.
cout<<"Please enter the First side of the triangle:\n";
cout<<"a=";
cin>>a;
 if (a<=0)
     {
        cout<<"The length can neither be Negative nor 0!!!\nPlease start all over again.\n";
        system("pause");
        return 0;
     }
cout<<endl;
cout<<"Please enter the Second side of the triangle:\n";
cout<<"b=";
cin>>b;
 if (b<=0)
     {
        cout<<"The length can neither be Negative nor 0!!!\nPlease start all over again.\n";
        system("pause");
        return 0;
     }
cout<<endl;
cout<<"Please enter the Third side of the triangle:\n";
cout<<"c=";
cin>>c;
 if (a<=0)
     {
        cout<<"The length can neither be Negative nor 0!!!\nPlease start all over again.\n";
        system("pause");
        return 0;
     }
 cout<<endl;
 //Working out the area and setting other conditions.
sum1=a+b;
 if(sum1<=c)
     {
        cout<<"Invalid side specifications!!!\n(a+b>c...Please input correct side specifications.)";
        system("pause");
        return 0;
     }
sum2=a+c;
 if(sum2<=b)
     {
        cout<<"Invalid side specifications!!!\n(a+c>b...Please input correct side specifications.)";
        system("pause");
        return 0;
     }
sum3=b+c;
 if(sum3<=a)
     {
        cout<<"Invalid side specifications!!!\n(b+c>a...Please input correct side specifications.)";
        system("pause");
        return 0;
     }

p=(a+b+c)/2;
area= sqrt(p*(p-a)*(p-b)*(p-c));
cout<<"The area of the triangle is:\n"<<area;

_getch();
return 0;
}

Monday, 10 June 2013

How to secure your files in your laptop or Desktop

The unfortunate thing for all users of the Windows operating system is that the only way to
secure any file is by HIDING it.
This can be done by:
1. Right click on the file of choice.
2.Choose properties.
3.Select the Hidden check box.
4.You are done.

The major problem with hiding the file is that anyone with BASIC computer knowledge can 
gain access to it.

To ensure Maximum protection for the file, ENCRYPTION is the best way to go.
It not only protects your file with a password, but it also encrypts it ensuring that even the toughest 
password cracking software cannot break into it.

ALCA File Encryptor is just one of those software and it's major features include:
1. A beautiful and simple to use interface.
2. It encrypts all kinds of files: Documents, zip,songs,
   video....etc
3. It is quick even when handling large files.
4. It is symmetric and uses the same password both for
   the encryption and decryption.
6. It allows users to use different encryption passwords 
   for different files.
7. It comes with a visual demonstration on how to use it.
   You can also view it at: Visual demo for ALCA file encryptor
    
8. And many more.

If you have a problem with securing your files, ALCA File encryptor is the way to go.
Just post your comment with the words, 'I want ALCA' and I will get back to you with the solution.

HOW TO SHUT DOWN WINDOWS_8 WITH A

CLICK OF A BUTTON

By default, windows 8 has no start button where one can choose the shut down option.

The good news is that, you can create your own custom button to shut it down easily.

This is how you do it:

1. Go to Desktop.
2.Right click on it and select new 
3.From the drop down, select shortcut.
4.On the window that appears, just type, shutdown /p
5.Notice the space between Shutdown and /p... 
  then click next.

6.On the next window, you can specify the name you want 
  for the shortcut...then click finish.
7.That's all.

To add an icon to this shortcut,

1.Right click on the shortcut and go to properties.
2.Select change Icon, and select any desirable icon.
3.To add a hot key for the same shortcut, just go to
  properties again.
4.Go to Add shortcut key and press the key of you choice.
  If your key is Z, then to launch the shortcut, you press:
  Ctr + Del + Z. 

Enjoy your self.
 

Saturday, 8 June 2013

This is complete working code for the Simulation and Modelling Assignment.

If u have to use it, make sure u UNDERSTAND it and then EDIT it

your own way.


THE DICE THROW CODE:


/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package diceroll;
import java.util.Random;
public class DiceRoll
{
public static void main( String[] args)
{
Random faces = new Random(); // Generates random numbers
int[] array = new int[ 7]; // Declares the array

//Roll the die 1,000 times
for ( int i = 1; i <=1000; i++ )
{
++array[ 1 + faces.nextInt ( 6 ) ];
System.out.printf( "%s%10s\n", "Face\t","Frequency\t","Percentage" );
}
// outputs array values
for ( int face = 1; face < array.length; face++ )
{
int percentage=(array[face]*100)/1000;
System.out.printf( "%4d%10d%10d\n", face, array[ face ],percentage);
}
}
}

Tuesday, 4 June 2013

This is what I call a good handshot...

You want yours like this one, ...talk to me!


Monday, 3 June 2013

Bringing to you the new file encryptor...

ALCA file encryptor.