Thursday, October 10, 2013

Shared Folder on Virtualbox on Linux Host

There are  a lot of people who use windows on virtualbox which is hosted by a linux distribution. For example, I installed virtualbox on Linux Mint 1.14 to setup Windows XP on it and use this for some software that I need for my education on Electrical & Electronics Engineering. Let's start with the most known problem.

Problem :

When we use virtualbox the most important problem is that how to share folders or directories with the host and any operating systems installed on virtualbox.

Solution: 

To solve this problem just follow the given instructions below:

1.  Open virtualbox and start any os that you installed on vb.
2.  Click 'Devices' tab which is seen in the menu bar of vb.
3.  Select ' Install Guest Additions'

If it asks to download click and proceed it.

4.  Totally close the operating system that you run on virtualbox.
5.  On Virtualbox software, click settings.
6.   You are going to see an option like 'Shared Folders' or 'Shared Directories'. Click on that.
7.   In that option click Add Shared Folder icon and enter its location and its name whatever you want. Make sure you checked read box before you click ok.

That's it, now you can share any folder between your host and operating system installed on virtualbox.(also called Guest Operating Systems)
Read More

Tuesday, August 27, 2013

Modeling a Whale Call with Matlab

I did my computer probation in a company called FIGES last year. In one of these days, my job was modeling a whale call of a blue whale. To do this firstly I did a long research, because I have needed
some equations to represent whale call.

According to my research:

Befitting the largest mammal on earth, the call of an adult blue whale is loud and low The
sound carries farther than any other animal sound, and can be detected over a thousand miles
away. The call has a distinct pattern. An a “trill” usually precedes a series of B “moans.”
There is little variation in the call among individual whales.

The B call is simpler and easier to analyze. It consists of a fundamental frequency around 16-
17 hertz and a series of harmonics(multiples) of the fundamental frequency. The amplitude of
the call is modulated to produce a loud moan followed by weaker moan.

• The envelope of the signal is treated as a decaying sine wave of the form A0*e^(-
Bt)*sin(2*pi*fm*t) where the amplitude A0 the decay rate B, and the modulating
frequency fm are all adjustable parameters.

• The signal itself is treated as a sum of harmonics sin(2*pi*n*f0*t) for n=0,1,2,3, ... .
The harmonics are assumed to be present for the entire duration of the call, even
though the higher harmonics appear and disappear in the middle of the call. (Simply
chopping off the higher harmonics introduces unwanted frequencies.)

• Because blue whale calls are so low, they are barely audible to humans. The time scale
in the data being modeled is compressed by a factor of 10 to raise the pitch and make
it more clearly audible. The model works with the same “x10” audible frequencies.

Using these informations I wrote the script in the following:



The Blue Whale B call model is shown in following figure. If you also wanna hear the voice, write down the codes into a matlab mfile and run it..



Read More

Wednesday, August 21, 2013

Firefox Babylon Add-on and More

Everyone knows Babylon dictionary, it is one of the most common dictionary that used in the world. A free babylon extension for firefox is available here. It works quite enough, the requirement is just clicking the word that you wanna search twice.

Babylon Dictionary

But missing part is that:

It doesn't save the word you search once. When you encounter a word that you have searched 10 days ago, you need to remember it or you need to search it again in a dictionary. 

SOLUTION:

I modified the babylon extension to resolve this deficiency. When you use the modified version, you will find the words you searched before in a file called mywords.html which is going to be found in your desktop. The mywords.html will looking as in the following picture. :)

Babylon - mywords.html



-->


Watch the following video tutorial to setup the babylon to do the work we want :)
[By the way, the blog you see in the video is belongs to my bro. http://make-possible.blogspot.com]



Download the modified version from here and mywords.html(right click and save it). Install the extension to the firefox and copy mywords.html into your desktop. Also you can use the following code to download mywords.html into your desktop:



Use it with fun :).

What I changed in Babylon to be able to do this? (saving every word we searched once)

The changes I have made are given in the following:

I add a new function called saveDataToFile into javascript file BabylonWordSearch.Results.js. The function is given below:



In if block that I given below, I send the answer that I get from babylon server by innerHTML  to the above function(saveDataToFile) .



To modify the extension yourself, you can find its source code from that post.

If you have any question or need some help, leave a comment below.

Read More

Monday, August 19, 2013

Loops in Matlab ( for in matlab, while matlab, for matlab)

There are two loops in matlab:
  • For loops 
  • While loops
For loops are used when the number of loop is certain whereas while loops are used when the condition is specified for a loop to terminate the code in it. 

You can see the usage form of for loops and while loops from given examples below:

Example 1: For loop



Example 2: While loop



For information in detail type in command window:

'help for' to get the following result:



or you can type doc for  to get reference page in help browser. I am not giving it here.

For while loops you can type:

'help while' to get information in detail like as given below:



or you can type 'doc while'  to get reference page in help browser. I am not giving it here.

If you have any question or need some help, leave a comment below.

Read More

Sunday, August 18, 2013

Flash for Linux

Hi guys, most of the linux distributions do not include flash as default installed software. Mint comes with flash but such as in ubuntu it is not preinstalled. So we have to install it. There are a few ways to install flash in linux:
1.   - open software center
        - enter 'adobe flashplugin
        -click install, that's it. (That is the first way to get linux flash)

2.   - open terminal by typing Ctrl+F2
        - write the following code:

to install adobe flash on ubuntu:



to install adobe flash on mint:



        - after this, if it ask Y or N type Y. Flash is installed, you can try it now. (That is the second way yo get linux flash)

 3.  - Open any website that requires flash, like youtube. It will ask you 'install missing plugins' press install or download. That should solve your problem about flash plugin. (That is the third way to get linux flash)

4.  -Open software center
       - type adobe flash into search box
       -click install, that's it. (that is the fourth way to get flash on linux)

If you have any question or need some help, leave a comment below.
Read More

Monday, August 12, 2013

Flashlight Android Application

Hi guys, today I wanna tell about one of my experince on android app development. A couple of days ago, I wrote a Flashlight android app using docs in developer.android.com, I checked the app in two different phones:

  • first in a Motorola phone: my app worked perfect, it did its job. (turning on and turning off flash of the camera)
  • second in a Samsung SIII Mini: my app didn't work, it didn't do its job. (when I touched the 'open flash' button, flash couldn't open.)

So, I started to search the problem. There were a lot of statements in websites like that: "FLASH_MODE_TORCH doesn't work on samsung". I have used this parameter in my app too. I didn't believe that, because when I request possible parameters from eclipse by pressing Cntrl+Enter there was only one parameter which can open the flash: FLASH_MODE_TORCH. So, I thought there must be a missing code which requires in samsung phones and not needs in phones like Motorola. I continued to search and found a nice solution which says use "camera.startPreview()" after setting parameters of the camera. I used this in my app and it worked in samsung phones too.

The picture of my app are given in the following, and you can download it from the link below pic. I wrote the app just for an example, so its gui is really bad and simple.



If you like this article, use the share buttons below to help my blog.
If you have any question or need some help, leave a comment below.

Read More

Saturday, August 10, 2013

Initial Arrangement Example in Matlab

Read More