Test your Intel or AMD CPUs raw speed using Windows batch script

Processor speed is the key to system performance of any personal computer. Here a simple loop based testing is used for testing raw speed of any microprocessor. It is written in Windows batch script so that it can be run without need for compilation or CPU architecture consideration.

Follow the given steps to successfully test your PC-
1. Open the PDF in your favorite viewer
2. Open notepad and copy the text from the PDF to notepad
3. Save the file with a .bat extension from notepad File menu (for example cpu-test.bat)
4. Close all windows and double click the batch file (the one you have just created)

The PDF is here Program for testing raw CPU speed

As the source is given you can modify it to fit your needs. Apart from testing cpu speed you can use it to analyze operating system task scheduling, cpu hardware threading, and core merging features.

Modifying the code: Run another big program from inside the loop to see how drastically the execution time changes. You can judge the effect of cache size this way.

, , , , , ,

Leave a Comment

Building OpenCV with Microsoft Visual Studio

The win32 distribution of OpenCV doesnot include the lib files for visual studio compiler. It is necessary to build them from source. The best method to do this is to use CMake. In order to get started with computer vision research with OpenCV successfully the following steps can be followed:-

1. Download and install OpenCV for win32 http://sourceforge.net/projects/opencvlibrary/

2. Install Microsoft Visual Studio (I tested with Visual Studio .NET 2005 and 2008) if not already installed.

3. Download and install CMake http://cmake.org/.

4. Download and install Python. [optional]

5. Generate solution file (.sln) for visual studio with CMake. See the following screenshots.

Select the directories.
Generate .sln file.
6. Build the libraries with visual studio by opening the .sln file and then pressing F7.

7. The lib files are now at PATHTOBUILD\lib\debug or PATHTOBUILD\lib\release depending on the configuration you select from visual studio. For every new OpenCV project configure to point to this directory for libs. Also add Project>Properties->linker->Input->Additional Dependies: cv200d.lib cvaux200d.lib cvhaartraining.lib cxcore200d.lib cxts200d.lib highgui200d.lib ml200d.lib opencv_ffmpeg200d.lib

8. Set Project>Properties->C/C++->General->Additional Include Directories: PATHTOOPENCV\include\opencv

9. Add PATHTOBUILD\bin\debug to system PATH from control panel. Control Panel>System->Advanced->Environment Variables->System variables->Path->Edit.

10. Create a new project and test the following code:

You can download the visual studio .net 2005 project folder with debug build from here. Note: The code was taken from the official OpenCV book. Change the path to image in the code to match one of your existings.

1 Comment

Facebook group: Japanese Language Learners Group of Bangladesh

Group created
Japanese Language Learners Group of Bangladesh on Facebook

If you are a bangladeshi and are interested in the japanese language then join this group. The objective is to create a community of bangladeshies whose common interest is learning the japanese language and who are fond of japanese literature, media, and entertainment.

, , , , ,

Leave a Comment

Dept. of ETE community website released

Today I have finally released the community website for the department of ETE, RUET. I was planning this for about a week. Everyone is welcome. Link given eteruet.co.nr

Leave a Comment

Java ME along with Gauss Elimination == Simultaneous equations with any number of unknowns solved

Gauss elimination is an elegant method to solve system of simultaneous equations. The main idea consists of two steps (1) Forward elimination and (2) Backward substitution. I won’t attempt to teach Gauss elimination here.

Although elegant the method consists of repetitive calculations which is pain to carry out. A computer implementation of the algorithm can give us the benefit of having the computer consume the pain. But a computer is not always the thing at hand. So, here is a simple Java ME MIDlet which can be run on any CLDC 1.0, MIDP-2.0 device.

Download the jar from here (source included)

, , ,

1 Comment

MATLAB report generator, simple way, smart output

In a previous post I had shown how to use MATLAB and the web command to use the power of HTML in MATLAB to display program outputs in a more fabulous manner.
But sometimes the complexity of the procedure doesn’t worth the effort it takes.

In cases where direct manipulation of HTML is not required there is a much simpler but
smarter way. The code is here. The code snippet responsible for generating the report
is highlighted.

Download source

Leave a Comment

Palindromes

Numbers such as 233332 are called palindromes. They have the property that they are same forward as backward. Interestingly enough if we start from any number and continuously reverse and add, it usually ends up in a palindrome.

For example we start with 7513:

7513+3157= 10670

10670+7601=18271

18271+17281=35552

35552+25553=61105

61105+50116=111221

111221+122111=233332

Thus we get a palindrome in six reverse and add operations.

Here is a simple python program to do the dirty reverse and add and give us the palindromes.

Notably, not every integer yields a palindrome this way. For example 196 does not.

Palindromes with Python

Leave a Comment

Renaming files downloaded from the web automatically for better readability using Python

Today I downloaded an mp3 with url:

http://music.music.com.bd/Music/S/Sumon%20&%20Anila/Ekhon%20Ami/02%20-%20Sumon%20&%20Anila%20-%20Ekhon%20Ami%20[music.com.bd].mp3

So the downloaded file (downloaded with Multiget) has the name:

02%20-%20Sumon%20&%20Anila%20-%20Ekhon%20Ami%20[music.com.bd].mp3

But it’s awesome so I renamed it to:

02 – Sumon & Anila – Ekhon Ami [music.com.bd].mp3

Which looks much prettier. But as I continued to download more mp3s it felt
labourus to rename every single file that I download. So I thought about some
automation script. Batch file (Windows) / Shell script (Linux) would be good
enough but that would require me to manipulate the name string directly to replace
the %20s with spaces. Not a big deal but the name could contain things other
than %20s (spaces) . So a better solution, I thought, would be Python’s url decoder.
Here is a snapshot of the code from my favourite editor IDLE and also a download link to the python source file.
Place the python script in the folder containing your files and double click on the
script to see it at work!

Source code – rename (decode) file name

2 Comments

How to feed PC music into the Microphone

While voice chatting on yahoo or talking over mobile using bluetooth voice gateway friends request me to let them hear the song I am hearing. I used to place the microphone close to the speaker so that, they can hear. But this is so uncomfortable and awesome specially when using a headphone. I looked for a smarter solution & I found. Here I show (Windows only)-

1.  On the taskbar’s right corner (System tray) right click on the Volume Icon.

2. Click on Open Volume Control menu item.

3. A window titled ‘Front Speaker’ appears. From the munubar choose Options>Properties

4. In the ‘Properties’ window choose Adjust Volume for (Group box) Recording (radio button).

5.  Chek ‘Stereo Mixer’ and ‘Mic’ and uncheck everything else and click OK.

6. A window with two sets of widgets seperated by a vertical line appears one titled Stereo Mixer & another titled Mic. Check Select of Stereo Mixer.

To ensure that the setup is working, play your favourite music on your favourite player and open up Sound Recorder (Start>All Programs>Accessories>Entertainment>Sound Recorder) and start recording.

, ,

2 Comments

G2′s Poetic Python

This a favourite poem of mine. It’s about Python.

Programming is fun
When the work is done
if you wanna make your work also fun:
        use Python!

Leave a Comment

Follow

Get every new post delivered to your Inbox.