Monday, March 09, 2009


از کرامات شیخ ما این بود

امشب یک اتفاق جالب افتاد. میکرفون رو به لپ تاپم وصل کرده بودم که صدا رو ضبط کنم. برنامه ضبط صدا هم در حال اجرا بود ولی خوب یادم رفت که این برنامه هه داره صدا رو ضبط میکنه. یک ساعتی گذشت و من میکروفن رو از لپ تاپ جدا کردم. رفتم شام خوردم، یوزارسیف رو هم کامل دیدم و برگشتم. بعد دو ساعت و نیم دیگه گذشت و فهمیدم که، اِ، مثل اینکه هنوز این برنامه هه داره صدا رو ضبط میکنه ولی خوب پیش خودم گفتم که دو سه ساعت پیش که من میکروفن رو قطع کردم. همش نوار خالیه. بعد گفتم حالا ببینم تا کجا پر شده. گوش کردم دیدم نه. مثل اینکه تمام یوزارسیف ضبط شده. اولش گفتم جل الخالق. ببین این یوزارسیف چه کراماتی داره! بدون میکروفن هم صداش ضبط میشه! ولی بعدش گفتم خوب یوزارسیف کرامات داشته؛ من که صدام از اون هم بهتر ضبط شده که کرامات نداشتم. بعد از کلی فکر کردن فهمیدم که ای بابا. این لپ تاپ ما میکروفن بیلتین (همون توکار خودمون) داشته و ما خبر نداشتیم! یاد این دانشمندای معروف که تصادفی یه چیزو اختراع میکنن افتادم. اَ...، من چقدر منت این محمد رو کشیدم که میکروفنت رو بده یه صدا ضبط کنیم. سال ها دل طلب جام جم از ما می کرد... بقیشو یادم نیست. البته بگم که من این لپ تاپو تازه دوساله خریدمش. باید خوب بررسی کنم ببینم چیز دیگه نداشته باشه که من ندونم

Saturday, January 03, 2009

یادگاری درس ذخیره و بازیابی
اگر فکر می کنید جیمیل خیلی میل سرور خفنی هست و به جای استفاده از میل سرور دانشگاه از جیمیل استفاده میکنید، باید بگم اشتباه میکنید! اگر 65 - 70 تا دانشجوی تربیت معلمی در عرض 48 ساعت بیشتر از 150 تا ایمیل بفرستند به ایمیلتون اون وقت هست که دیگه نمیتونید به اینباکستون دسترسی داشته باشید! و دانشجوهای بیچاره هم اون طرف منتظر میمونن که چرا این استاد بی مسئولیت پذیر (به به، چه اصطلاح توپی) چرا جواب ما را نمی دهد! البته تقصیر خودتان هست. گفتم نفری یه ایمیل بیشتر نفرستید، گوش نکردید! این هم نتیجه اش:



اگر نتونستید عکس بالا رو ببینید اینجا رو کلیک کنید.

Monday, December 22, 2008

We need a Better Matlab!

I have used Matlab in some of my projects (mostly in university and just when I had to do that). I really don’t enjoy it. I think the worst problem with Matlab is the language itself. Poor design of the language, from function definition and typing mechanism to OO support and lack of namespaces, makes it an unpleasant choice for a computer scientist(it may seem very nice from a non-computer-scientist view). Of course it has some nice features including an exhaustive scientific library and efficient support for matrix and vector operations. Unfortunately, the Matlab library is completely based on the awful programming language. Because of the poor language constructs, matrices are overused in library design. Despite the mentioned weaknesses, Matlab is vastly used in scientific world, that’s because you cannot find any other single alternative in scientific programming.

I have found some ongoing works to make a Matlab replacement, Scilab and Octave are more or less a clone of Matlab (which means they are not a better Matlab), SciPy is a scientific python library (and just a library) which seems pretty good to me.

Based on my experience, a scientific environment at least must have the following components to be called a better Matlab:

1) A better programming language, by better I mean powerful but simple. As the language is used by non-computer scientists, simplicity is a must for the scientific programming language.

2) An excellent library, of course an excellent language is almost useless without a proper library.

3) Efficient support for matrix and vector operations. Maybe hardware accelerated operations or support for parallel processing (e.g. support for SMPs or use the power of GPU SIMD instructions) may be helpful.

4) A simple and useful distributed processing platform. As scientific programs are usually CPU intensive, a built-in Cluster Computing platform will greatly help scientists.

5) A better Development Environment

For the programming language, we must choose to use a compiled or scripting language, of course scripting languages are simpler to learn, understand and use and more appropriate for scientific experience and simulations. Moreover we have the following options:

1) Design a programming language from scratch for scientific purposes, it has the benefit that it could completely fit to the scientific computing requirements, but it has a huge cost and is very risky.

2) Use an existing language, there are many programming languages around. We can easily choose one of them; among several programming languages which I have studied, I prefer python and ruby. Although python has a more matured library, ruby design is more consistent. I will discuss later how ruby would be fitted to the needs.

3) Choose an existing platform with multiple programming languages, e.g. .Net or Java with a mixture of compiled-scripting languages; I don’t like this option for many reasons including its complexity.

So, why ruby is a good choice for our goal? There are many reasons to be considered.

1) Ruby is not designed for scientific computation but its flexible nature made it fully DSL-able. There are already some proofed examples of success of ruby in specific domains; Ruby on Rails is an excellent example. As an example of adaptation, consider the scalar expansion capability. Ruby does not support scalar expansion (e.g. 2 * [1, 2, 3, 4]), but this feature could be easily added to the language so as to become native to the language! Here is some lines of code which do that:

class Fixnum

alias_method(:old_mult, :*)

def *(a)

if(a.is_a?(Array))

a.collect { |i| self * i }

else

self.old_mult(a)

end

end

end

This is the job that needs AOP in many other languages to be done, even in many languages like java it can’t be done at all.

2) Ruby is simple, it could easily be learned by non computer scientist and students, and it has very simple OO semantics. Moreover, it is strongly and dynamically typed, its dynamic typing semantic made it simple to use and its strong typing nature prevents many programming errors.

3) Ruby has a wonderful implementation called JRuby which runs over JVM. This is an excellent option because you can easily use all of available java libraries out of the box. Using some simple wrappers, many scientific java libraries could be ported to ruby. Also some parts of new libraries may be implemented in java for efficiency. Additionally, both NetBeans and eclipse (through RadRails plug-in) support ruby. As the IDEs are extendable they could easily be modified to make a better Matlab development environment.

As many other java fans I love ruby because it is very consistence and clean (just like java). It might be some other good choices.

Wednesday, October 22, 2008

دکتر جان، تو خودت نشاط ملی هستی، طرح برای چی؟!

دکتر کردان، دیروز در حاشیه آمد و شد معاون بعدی و قبلی خودشان فرموده اند: "پيش‌نويس اوليه طرح نشاط ملي آماده شده است كه به شوراي اجتماعي كشور ارسال شده و مراحل تصويب خود را مي‌گذراند". خواستم در اینجا از ایشان به خاطر اینکه اینقدر به فکر نشاط این ملت هستند تشکر کنم و بگویم، طرح برای چی؟! خود شما به اندازه کافی در این ملت نشاط ایجاد کرده اید. راستش را بخواهید در این چند سال عمرم هیچ کس را ندیده ام که به اندازه جنابعالی در کاریکاتورها و مطالب طنز کشور مطرح شده باشد و اینچنین باعث انبساط خاطر مردم این کشور شود.

* حاشیه: کاش یک نفر آدم بیکار پیدا میشد و آرشیوی از مطالبی که در مورد دکتر (!؟) کردان مطرح شده جمع آوری می کرد. فکر می کنم از نظر تاریخی ایشان اتفاق منحصر به فردی در کشور ما بودند (هستند؟!).

Friday, August 29, 2008

اضافات فایرفاکس

کم کم دارم به این نتیجه می رسم که برای هر کاری یک add-on توی فایرفاکس می شود پیدا کرد. حتی برای رفع اتهام نامردی و حل مشکل قیافه! چند روز پیش هادی گیر داده بود که چرا قیافه این فایرفاکس تو با فایرفاکس من فرق می کند. گفتم به خاطر add-on هایی هست که نصب است. بعد گیر داد که لیست add-on هایی را که نصب داری به من بگو. راستش را بخواهید چون من اصلا حال و حوصله تایپ کردن بیست سی تا اسم را نداشتم، یک جورهایی مسئله را پیچاندم (در اصل پیچوندم). و او هم طبق معمول گفت "خیلی نامردی". ولی امروز به صورت اتفاقی یک add-on ی پیدا کردم که هم مشکل نامردی من را حل کرد، هم مشکل قیافه هادی را. این add-on ی که پیدا کردم می تواند یک لیست از تمام add-on هایی که روی فایرفاکس شما نصب هست درست کند. این لیست را هم با آن درست کردم:

Application: Firefox 3.0.1 (2008070208)

Total number of items: 29

  • /Find Bar/ 1.0.1
    Firefox 2.0b1 - 3.1a2pre
    A souped up findbar with regular expression capabilities
  • Adblock Plus 0.7.5.5
    Firefox 1.5 - 3.1a2pre
    Ads were yesterday!
  • Aging Tabs 0.7.1
    Firefox 3.0 - 3.1a2pre
    Makes unused tabs fade with age and highlights the selected tab.
  • BugMeNot 2.0
    Firefox 2.0 - 3.0.*
    Bypass compulsory web registration with the context menu via www.bugmenot.com.
  • CacheViewer 0.4.7.1
    Firefox 2.0 - 3.0.*
    Allows searching and sorting cache files
  • Clipmarks 3.5.0
    Firefox 1.5 - 3.0.*
    Clip and save just the stuff you want from any web page.
  • Copy Link Text 1.3
    Firefox 1.5 - 3.0.*
    Right-click a link to copy its text
  • CustomizeGoogle 0.75
    Firefox 1.0 - 3.1a2pre
    Enhance Google search results and remove ads and spam.
  • DownThemAll! 1.0.3
    Firefox 2.0.0.8 - 3.0.*
    The mass downloader for Firefox.
  • ErrorZilla Mod 0.34
    Firefox 2.0 - 3.0.*
    Implements a useful error page when a website cannot be reached.
  • Extended Statusbar 1.5.1
    Firefox 1.5 - 3.0.*
    A Statusbar with speed, percentage, time and loaded size (similar to Opera's one)
  • Extension List Dumper 1.14.1
    Firefox 1.5 - 3.0.*
    Dumps a list of the installed extensions.
  • FireFTP 1.0.2
    Firefox 3.0 - 3.0.*
    FTP Client for Mozilla Firefox.
  • Fission 1.0
    Firefox 2.0 - 3.0.*
    Progress bar in the address bar (Safari style).
  • Flagfox 3.2.8
    Firefox 1.5 - 3.0.*
    Displays a flag depicting the location of the current server
  • GoogleEnhancer 1.63
    Firefox 1.5 - 3.0.*
    Adds numbers, highlighting and favicons to Google searches
  • Grab and Drag 2.7.4
    Firefox 2.0 - 3.0.*
    Enables Adobe Acrobat-style grab and drag scrolling in Mozilla applications.
  • Link Alert 0.8.2.1
    Firefox 1.5 - 3.0.*
    Changes the cursor to indicate the target of a link.
  • New Tab Button on Tab Right 0.5.3
    Firefox 3.0 - 3.0.*
    Adds a new tab button like IE7.
  • OPIE 1.2.1
    Firefox 2.0 - 3.0.*
    Import/Export extension preferences
  • PicLens 1.8.0.4280
    Firefox 2.0 - 3.0.*
    Discover More
  • Quick Preference Button 0.1.8.1
    Firefox 1.5 - 3.0.*
    Adds menu button for quickly accessing common preferences.
  • QuickProxy 2008.08.24
    Firefox 1.0 - 3.0.*
    Quickproxy creates a statusbar button to quickly turn the proxy on and off.
  • Save Link in Folder 1.4.2
    Firefox 1.0 - 3.0.*
    Easily save links in personally customized folders.
  • ScrapBook 1.3.3.7
    Firefox 2.0 - 3.0.*
    Helps you to save Web pages and organize the collection.
  • Tab Scope 0.2.2.8
    Firefox 1.5 - 3.0.*
    Preview and navigate tab contents through popup.
  • Taboo 0.5.5
    Firefox 2.0b1 - 3.0.*
    The cure for tabitis
  • Yahoo! Mail Notifier 1.0.0.12
    Firefox 0.9 - 3.1a2pre
    This extension notifies you when new messages arrive in your Yahoo mailbox.
  • YouPlayer 0.9.8
    Firefox 2.0 - 3.0.*
    Advanced video-site player and download tool

اگر با فایرفاکس کار می کنید، توصیه می کنم حتما این add-on ها را امتحان کنید ولی اگر با فایرفاکس کار نمی کنید، توصیه می کنم با فایرفاکس کار کنید و این add-on ها را هم امتحان کنید. از بین اینها من خودم به Grab and Drag علاقه خاصی دارم.