Monday, November 3, 2008

A Great Free Music Video From iTunes! Lovers in Japan

Hey there!
Just to tell you a great news, if you live in US and like Coldplay!
Music video of "Lovers in Japan" is available for free download in iTunes! (for a week, i think!)
So, Hurry up! :D

Thursday, October 23, 2008

جبر و اختیار : A Computer Science Student Approach

با خوندن کتاب های بینش اسلامی راهنمایی-دبیرستان-دانشگاه-و... و گوش دادن به صحبت های عالم های دینی یکی از سوال های حل نشده برای من و شاید خیلی های دیگه بحث جبر و اختیار ه.
چطور میشه که به ما میگن شما اختیار دارید و مخییر هستید که هر کاری بکنید وقتی خدا می دونه که تا آخر عمر تون چه اتفاق هایی میفته!؟ این حرف متناقض رو خیلی ها شنیدن و این باعث میشه که بعضی ها بگن «در دایره ای از جبر مخییر ایم!». حرفشون خیلی منطقی به نظر میاد.

من اینجا ادعا ندارم که میخوام این موضوع رو به طور کامل حل کنم ولی شاید بتونم یه لامپ روی کله ی یکی روشن کنم. همونطور که مال من روشن شد!

کلید اصلی در اینجا اینه که پدیده ی کاملا تصادفی توی این دنیا وجود نداره. یا حداقل من اینطوری فکر میکنم! وقتی یه سکه رو بالا میندازید با احتمال ۰.۵ شیر میاد و با احتمال ۰.۵ خط! این از بدیهی هاست ولی آیا این پدیده کاملا تصادفیه؟ اگه یه قدرت پردازشی خیلی زیاد داشته باشیم که بتونیم تمام حرکات سکه و باد و جاذبه و ... رو شبیه سازی کنیم میتونیم «پیشبینی» کنیم که کدوم طرف میاد!

ما به چیزی میگیم تصادفی که پیچیدگی زیادی داشته باشه

ما قدرت پردازشی محدود داریم ... ولی خدا قدرت بینهایت داره!

سیستم دنیا رو در نظر بگیرید. این سیستم رو خدا در لحظه ی صفر روشن کرده. یه سری اتفاق توش اتفاق میافته و اونا اتفاق های دیگه رو باعث میشن. این سیستم همینطوری پیش میره تا ما به دنیا میاییم! بعد ما یه تصمیمی میگیریم و بعد یهو اینو عوضش میکنیم تا خدا قافلگیر شه!! ولی خبر نداریم که خدا قدرت پردازشی بینهایت داره و تا آخر دنیا رو شبیه سازی کرده! حتی اینکه ما میخواییم تصمیمون رو عوض کنیم...

لامپ روشن شد؟! البته من حق میدم به کسی اگه با این حرف ها هم قانع نشده باشه...
این از دست ما بر میومد! اگه ایده ای دارید اضافه کنید...

Sunday, July 20, 2008

Microsoft Live OneCare : A Big Mess

I think Microsoft Live OneCare is the worst software ever made by Microsoft! Here I’m writing about my experiences..

Let’s start with the history! As I’m using Windows (Shame on me!) and they ask users to install an anti-virus software, I decide to try a 90-days trial version of Microsoft OneCare..

In Microsoft’s website, they are saying lots of good things about OneCare. It protects you (from malaria virus, maybe!), it backs up your files, it has a built-in tune-up function (with a big intonation on “Built-in”!). so you might think it should be a good software… it’s developed by Microsoft and it should be well integrated in Windows. So let’s give it a try! :D

It have a huge over-head! When you click on its icon, you have to wait for some seconds! It also have a splash with a beautiful loading bar! But I have a powerful Intel Core 2 Duo processor… I can’t never imagine a day when Microsoft wants to develop an application like 3D Studio MAX ! probably, you should buy a supercomputer like an IBM Blue Gene, if you want to run that!! :D

Its tune-up function is a real catastrophe ! it is just some well-known functions : Virus-Scan (I didn’t test it, but you can’t hear good things about that if you do a googling), Disk defragment (vista do the disk defragment every two weeks by default), Disk Clean-up (an old feature of Windows!), and back-up (I think business and home premium and, of course, ultimate versions of Vista have this feature) !! so I can say this tune-up is absolutely nothing!

I had a 90-days trial, so I didn’t expect those warnings about ending my subscription when I had 30 days left! (… I don’t remember the exact number). I just can say OneCare is a big mess ! :)

I don’t know why a big company like Microsoft can’t build a fast software like NOD32..

Labels: , , , ,

Tuesday, May 20, 2008

Love or Carrier Recovery?!

رینگ رینگ! ]تلفن زنگ میزنه[

-الو؟! سلام..

-سلام.. حال شما چطوره خوب هستید؟!

-الحمدولل.. ما هم خوبیم! شما چطورید؟ برادرا خوبن؟ مامان .. بابا؟ همگی خوبن؟!

-از دعای شما .. سلام می رسونن .. خوبن ..

-دیگه چطورید؟ آب و هوا چطوره..

-آره هوا گرم شده..

-..

]و این مکالمه همینطور با این حرف ها ادامه پیدا میکنه تا به صحبت اصلی برسن..[

اینجا صحبت اصلی مهم نیست! بلکه تحلیل یک مهندس و یک انسان اهل ذوق و هنر از این ماجرا ..

ذوق و هنر!

ایرانی ها کلا خیلی به هم علاقه دارن و دوست دارن با هم حرف بزنن چون همدیگر را دوست می دارند!

مهندس!

در تئوری اطلاعات گفته می شود که اگر لحظه ی بعدی یک سیگنال قابل پیشبینی باشد، آن سیگنال حاوی اطلاعات نیست. حالا این سیگنال های بالا هم قابل پیشبینی هستند.. پس حاوی اطلاعات نیستند و نباید آنها را فرستاد. البته اگر مجبور باشیم این سیگنال ها را بفرستیم می توانیم برای سنکرون کردن فرستنده و گیرنده یا بازیابی سیگنال حامل (carrier recovery) از آنها استفاده کنیم .

حالا ما همدیگر را دوست داریم؟! یا سیگنال حامل را بازیابی می کنیم؟؟!

Labels: , , ,

Thursday, May 1, 2008

Consuming less power

سلام!

چند روزیه که تهران گرم شده و از اونجایی که ایرانی ها آدم های پر مصرفی هستند (من هم شامل این می شم) مردم سریع میرن و کولر هاشون رو راه میندازن تا از گرما خفه نشن! اما کولر خونه ی ما با کمی تاخیر راه افتاد.. من دوست ندارم پنجره رو باز بگذارم .. (صدای بیرون روی اعصابه!.. البته خونمون جای پر سرو صدایی نیست).

خوب حالا این دو تا موضوع رو با هم جمع کنیم می فهمیم که من باید تا وقتی که کولر آماده بشه با دمای نزدیک 30 درجه سانتیگراد زندگی کنم! .. من کلی کار کردم و چند تا نکته در آوردم که احتمالا به درد کسی که می خواد تو یه جای گرم ثابت بشینه و کار فکری (!) بکنه می خوره : اگه نکات پایین رو رعایت کنید توان کمتری مصرف می کنید و دیرتر خسته و گرسنه می شید و performance تون بالاتر میره:

زیاد ورجه وورجه نکنید! یه جا کاملا ثابت بشینید.. اگه در ابتدا گرمتونه یواش یواش دمای بدنتون رو پایین بیارید و خیلی آروم بشینید و حرکت اضافی نکنید!

برید روی حالت Low power ! یعنی ولتاژ کاری مغزتون رو بیارید پایین یا فرکانس کاری رو کم کنید .. یا اون قسمت هایی از مغزتون که باهاش کاری ندارید رو بفرستید رو حالت Sleep !

اونایی که معمولا اموراتشون با کامپیوترشون میگذره از پردازنده های low power استفاده کنن .. چون یکی از منابع گرما توی اتاق همین پردازنده ی گرما تولید کنه! خیلی از پردازنده ها این قابلیت رو دارن که با فرکانس های پایین تری کار کنن.

منابع گرما رو از خودتون دور نگه دارید

از لامپ های کم مصرف استفاده کنید. لامپ ها یکی از بزرگترین عوامل تولید گرما هستند!

لباس های صد در صد نخ بپوشید و تعداد لباس ها رو مینیمم کنید!

موقع خواب اجزای بدونتون رو از هم دور نگه دارید! این باعث میشه که کمتر احساس گرما کنید.. مثلا پاهاتون رو روی هم نیندازید. اگه موقع بیدار شدن زیاد گرمتون نباشه روز بهتری رو شروع می کنید و performance بهتری رو تجربه می کنید.

مو های زائد بدنتون رو بزنید! این واقعا موثره.

بدنتون رو تمیز نگه دارید. حمام برید!

خیلی با تمرکز کارتون رو انجام بدید تا گرما آزارتون نده.

زیاد آب بخورید

البته باید گفت که این مسائل کاملا بستگی به TDP (یعنی thermal Design Point) بدن شما داره! امیدوارم خدا انسان هایی با TDP پایین تر تولید کنه.

امید وارم با رعایت کردن نکات بالا گرمای کمتری تولید کنید، هوای زمین کمتر گرم بشه .. یخ های قطب شمال کمتر آب بشه و سطح آب دریا ها کمتر بالا بیاد و مردم رو سیل نبره! در ضمن با مصرف کمتر انرژی چرخ اقتصاد لعنتی این مملکت بچرخه.

صحبت های بالا رو می تونید افکار پریشان یه انسان دوستدار low power design بدونید!

Sunday, March 30, 2008

CurveTo

I didn't update CurveTo.com for about 2 years!
.. now i present CurveTo with new contents and design:D. those old Flash/FreeHand are cleaned up and the new website contains a blog from Blogger!
although i'm so lazy in updating a weblog, i'll do my best with this new one!

i tried to make it
  • really simple
  • optimized in size
  • with a clean design

CurveTo contains :
  • Index : a really simple homepage
  • Portfolio : I put some useful documents, almost technical in computer/electronic field, there..
  • PhotoStream : 3 of my latest photos plus a link to my PhotoStream !
  • GuestBook
  • Feedback
  • Me
CurveTo is not complete now (by the time of posting this post!).. but i'm trying to make it complete soon..
please send your comments to me [at] curveto [dt] com
Thanks

MPICH2 under Windows Vista

MPI stands for Message Passing Interface and it’s widely used in Parallel Processing. This is a tutorial about installing and testing MPICH2 on Windows Vista with Microsoft Visual Studio 2005.

In this page I introduce MPI and the way it works briefly and then I’ll show you how to install and test MPICH2.

Introduction:

We want an application to be run on several machines (processors) to get better performance (i.e. less execution time). You can imagine a computer network with N computer that running an application that compute PI for example! Remember that it’s “an” application that runs on a “network”.

We develop an application that executes on different machines (different instances) and pass messages with other instances. I think the model must be clear now! For this “message passing”, I know two method:

1- Using Socket programming and working with OS APIs directly.

2- Using MPI!!

You’ll get more power with socket programming but MPIs are easier to use and they are actually widely used in parallel processing. You can think of MPI as a set of functions for message passing. I know one free implementation of MPI, that is MPICH2 and you can download it for free from here.

There are lots of tutorials and web pages out there about MPI functions but I can’t find anything about installing MPICH2 on Windows Vista and compiling applications with Microsoft Visual Studio 2005. Here I want to show you my experience step-by-step. You must have an account with administrative permission. Note that I’m using MS Windows Vista Business.

Install :

1. Download MPICH2 from here.

2. Run the .msi package, you might got this error : “you must install C-Runtime (SP1) ..” go to Microsoft Website and download it. Note that you must install SP1 version! That is the point! Or you might got other errors about installing .NET Framework or things like that.. but because I installed VS 2005, I didn’t see these errors.

3. That’s it! If you follow the installation process correctly, you now have MPICH2 installed.

4. You must turn your firewall off or you can add rules to your firewall to allow “mpiexec” and “smpd”. This process depends on your firewall.

5. You may need to add MPICH2 folder to your PATH. This is the way :

a. right-click on “computer” and select “properties”

b. select “Advance system settings” on left pan.

c. Select “environment variables..”

d. On “system variables” select “Path”. You may need to scroll down.

e. At the end of the text-box, enter “C:\MPICH2\bin\;” with semi-colon! If you installed MPICH2 in “C:\MPICH2\”

6. Turn off UAC (User control account). When I turned it on, mpiexec returned with an error..

a. Open Start>User Accounts

b. Click on “Turn User control account on or off”

c. Turn it off!

Test:

you run your applications with mpiexec! Let’s do it for the first time! You can test your applications on your local machine without a network.. if you have a multi-core CPU, you’ll get full advantage of your multi-core system with utilizing it to 100% .

1- Start command-line. Start>cmd

2- Locate examples folder. If you installed it on C:\MPICH2\, it’s the examples folder “C:\MPICH2\examples”. Change directory to it.

3- Run the example with this command : “mpiexec –n 2 cpi.exe”. if you did everything correctly, CPI.exe will ask you for the number of intervals, use a large number and see you have 100% CPU-utilization on a single and dual-core. If you have a quad-core, enter “-n 4” instead of “-n 2”. This number shows the number of instances. If you test your application on a network you must enter the computer names.. I don’t want to mention these things here, you can find them here!

Build your own application with Microsoft Visual Studio 2005:

Now it’s the time for writing a hello-MPI !

1- Open MS VS.

2- Create an empty Win32 console application.

3- Add .h and .lib files to your project:

a. Tools>Options

b. Select “VC++ Directories” under “Projects and solutions” in the left pan.

c. Select “Include files” under “Show directories for:” drop-down list.

d. Add “C:\MPICH2\Include”. Assuming you installed it in that directory.

e. Select “Library files”, again under “Show directory for:” drop-down list.

f. Add “C:\MPICH2\Lib”.

g. In Solution Explorer, right-click on your project and select “add>existing item” and then select all .lib files under Lib folder. (C:\MPICH2\Lib)

h. Add a .cpp file with the code shown bellow.

i. Ctrl+F5.

j. Run the application using mpiexec and see the results!

4- Finished!

Although this was a tutorial for Windows Vista and Visual Studio 2005, you can use it for Win XP and VS2003 as well with some changes.. there are some good tutorials and documentations at MPICH2 official website.

if you have any question, just feel free to ask!

Code:

#include "mpi.h"

#include "iostream.h"

int main(int argc,char *argv [])
{
int numtasks, rank, rc;
rc = MPI_Init(&argc,&argv);
if (rc != MPI_SUCCESS) {
printf ("Error starting MPI program. Terminating.\n");
MPI_Abort(MPI_COMM_WORLD, rc);
}
MPI_Comm_size(MPI_COMM_WORLD,&numtasks);
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
printf ("Number of tasks= %d My rank= %d\n", numtasks,rank);

MPI_Finalize();
}

Labels: , , , ,