NN – WordPress

September 12, 2009

Default arguments

Filed under: Uncategorized — by NN @ 7:40 am

Today I am going to talk about default arguments in programming languages.
What do you think about it ? Should your language support default arguments ?
Some languages support and some don’t. It has a heavy influence on the design.

What are the pros for the default arguments:
* Instead of writing many overloads you can write only one.
* The code completion can show only one function instead of 20 (E.g. System.MessageBox.Show method)

What are the cons for the default arguments:
* They can lead to strange behaviour.
– Default arguments in python: Default values
– Default arguments in C++ when using virtual functions. You use the default value according to the static and to the dynamic type.

So what is the best solution ?
In my opinion the best solution is to create many functions with overloads, but to do it automatically.
You can do it in Nemerle language using macros:

Default arguments

Enjoy :)

June 20, 2009

Scripts Part II

Filed under: Uncategorized — by NN @ 8:29 pm

From the post before it can be realized that we do need some dynamic environment.
But how is it easy to achieve this?

Today I will talk about some common things. For these things one cannot find a good answer.

  • First, A script debugging.
  • Is this easy ? It should be, but not always.

    Lets start from MS supported products.

    VBA: So how do you do this in VBA ? There is a whole world of support. It works in all MS Office programs, moreover I there are more programs with VBA support. E.g. AutoCAD support VBA programming.
    Scripting technology: Here you have a bunch of interfaces and baz words like “Machine Debug Manager” and “Process Debug Manager”. Active Scripting API
    After reading a lot and trying a lot without a success you can manage to debug a script which runs in your executable file.

    What with the open source projects?
    Lua: There is no built-in debugger attached with the lua implementation from lua.org.
    But there is a debugger called Decoda. It costs money of course if you are not sure. ;)
    It works very nice. It doesn’t work good with the compiled lua code and code in release. But works.
    Python: You can try PDB.
    Wingware claims to debug embedded Python script.
    I did not check them, you can try and tell me if it works.
    Ruby:Internet search (like with Python) gives the ruby-debug, it seems very similar to python debugger (pdb).
    What with other languages ? There are few widespread scripting languages, so if you have something good and works, you can point me to.

    What the next?

  • Second, Interoperability.
  • How you can call from script to your language, and from your language to the script?

    The best what I know is the Boost.Python implementation.
    It supports whatever you want and it works, yeah ! :)
    For Lua you have luabind of luabridge libraries, they are pretty good too.
    There are more libraries than I can think about, so use the Internet search.
    What we have for Ruby language: Rice

    What about ActiveScripting ?
    Here you have just to implement COM object and you are in. It was too easy, so the long answer that you have to implement IDispatch interface and maybe to write some more magic. To make it shorter, ATL solves all your problems.

    The only problem with this that there is no automatic way to expose your classes to the script.
    Not so!
    With Boost.Python you have Pyste and the newer Py++:

    Looks just great. It uses GCC XML so it can be a problem for some incompatible code.
    One day we can see automation support for other scripts too.

    For Active Scripting you just do nothing, because every COM object can be used automatically.
    The only disadvantage of this technology that it is not cross platform. (You can use WINE to make it cross platform ;) )

    What else bothers you with the scripting languages ?
    Something about the scripting virtual machine: Speed and size, multithreaded support.
    Something more about the language itself: Strong typed or non strong typed. duck typing.

    Conclusion:
    In my opinion if you want some scripting environment in your program make it easy and extendable enough.

    P.S.
    Yes, I did not mention Perl language. If someone can give me a good link for Perl language debugging and embedding, it would be nice.

    June 12, 2009

    Windows 7 x64

    Filed under: windows — by NN @ 8:32 pm

    I have Windows7 for a long time in my laptop.

    It works pretty good.

    I have upgraded Windows7 from RC1 to post RC1 and to RC2. No problems.

    The only one thing which doesn’t work good is Daemon Tools.

    Today I have installed Windows 7 on my home computer.

    I have AMD X2 Processor and 4Gb RAM so I wanted 64-bit system of course.

    I have very good impression. It works fast. Even faster than my Windows XP x64 !

    I don’t care about eye candy in Windows 7 but some eye candy features are definetly good.

    And of course IE8 in Windows 7 works faster than in Windows XP ;)

    Conclusion: Windows 7 is the best Windows for today. Even in RC state.

    I will buy it for a sure :)

    P.P.S.

    Currently I did have one problem. The quick launch bar.

    You don’t have it automatically in Windows 7. I hope it will be restored in the RTM.

    Now you have to use this trick:

    http://www.howtogeek.com/howto/windows-7/add-the-quick-launch-bar-to-the-taskbar-in-windows-7/

    Some magic but does the work.

    And if you don’t want a watermark use patch:

    http://www.megaupload.com/?d=3AKF1TDG

    Enjoy.

    May 16, 2009

    BoostCon 2009

    Filed under: Uncategorized — by NN @ 8:58 am

    Very interesting docs about C++: BoostCon 2009.

    C++0x overview and Compiler support
    Parallel Patterns Library in Visual Studio 2010
    Icefishing for Neutrinos with Boost – Serialization Tutorial and Examples
    Icefishing for Neutrinos with Boost – Hybrid Architecture with Boost Python
    The Meta State Machine (Msm) library
    High-Level Parallel Programming EDSL
    Boost++0x #1: Hands-on rvalue References
    Tuesday Presentations

    A Cmake-Based Software Process for Development and Integration Testing
    Status of the boost-cmake effort
    State-Oriented Programming Using Boost Statechart Library
    The Meta State Machine (Msm) library
    Multithreaded C++0x: The Dawn of a New Standard
    Extending Boost.Algorithms — A Progress Report
    Boost Exception
    Boost + Software Transactional Memory, Boost + Software Transactional Memory – paper
    Boost++0x #2: Hands-on decltype, variadic templates, advanced SFINAE Also, slides from last year’s C++0x talk, covering variadic templates et al.
    Wednesday Presentations

    Keynote: Iterators Must Go
    C++0x Support in Visual Studio 2010
    Building a simple language compiler using Spirit V2.1
    Kamasu: Parallel computing on the GPU with boost::proto
    The Boost Smart Pointer Library
    Thursday Presentations

    Practical C++ Test-Driven Development with Boost.Test and Bmock
    Dynamic Programming: A Generic Viterbi Algorithm
    A Generic Geometry Library, A Generic Geometry Library – paper
    GTL for STL-like 2D Operations
    The Boost Filesystem Library V3
    Boost Fusion
    An experimental domain specific language for template metaprogramming
    Introduction to Graphics Programming with boost::gil
    GIL Workshop – Basic Algorithms, link available Wednesday
    Friday Presentations

    Advanced Preprocessor Meta-Programming with Boost.Preprocessor Library
    An Introduction to the Interval Template Library
    All library in a week presentations:

    Library in Week 2009 – std::rdb

    April 14, 2009

    MSI Wind U100 Plus

    Filed under: Uncategorized — by NN @ 2:23 pm

    I got a new netbook, yes yes this name is forbidden to say :) but i like this name.

    So what did I get ?

    http://www.msi.com/index.php?func=newsdesc&news_no=771

    This one with the red color, red is more beautiful ;)

    What can I talk about my new computer. It is very very good.
    It has N280.
    It supports wifi b/g/n.
    And works very fast. Faster definitely than old Pentium 3.
    The keyboard is pretty good, I can arrange writing fast enough.
    But Fn key in the left bottom corner not so good. I always press it when I want Ctrl button.

    So if you are searching a good netbook, you must buy this !!!

    There is one problem which isn’t solved.
    What OS should I install and use this computer.

    What I got is Windows XP Home Edition !!
    It works good, every Fn+Fx keys work, in ubuntu not all work.
    But i don’t like Windows XP Home ..

    Maybe Windows 7…

    February 2, 2009

    Hello IE 8 RC1 Final

    Filed under: Uncategorized — by NN @ 12:10 pm

    So for now definitely a good version of IE 8!
    Works faster but not as fast as Maxthon.
    All sites work as expected.
    Even ACID 2 test. Not ACID 3 :( But at least something good :)

    Anyway, without IE7Pro plugin this browser is not usable at all !
    MS should think about merging it to the IE.

    The security part is very good though. It asks about any strange thing. Well done.

    Hopefully the final version will work even faster. I still do not get why opening a tab takes so much time.
    Maxthon can open 10 tabs while IE 8 opens 1 tab. (I do not compare to IE7 at all :D )

    P.S.
    Still no Flash for IE x64 what makes IE x64 useless.

    January 9, 2009

    Boot loaders

    Filed under: Uncategorized — by NN @ 10:09 pm

    I have a good rescue DVD, it is very helpful to fix computers.

    It is a multiboot DVD which includes Windowses installations, some Windows Live, Hiren’s Boot CD, System Rescue CD, Acronis Boot CD and something else. The list changes all the time because I look up for improvements.

    I am using now a tool called Bootable CD Wizard. This is a very simple boot loader for CD which allows everything you need:
    1. Support for gif format in logo.
    2. Simple to use.
    3. Can boot almost everything. It boots Windows installation , Linux installation without any problems.
    4. Can boot ISO image directly ! You just write a path and it works.

    The only problem is a lack of USB support. I know that some day I will need it, so I have started searching for something better.
    The candidates are: ISOLinux, GRUB, GRUB2.
    It is easy enough to install them to the CD but it is not easy to make them work.
    I did not find how to load ISOLinux from GRUB or GRUB2. It just not as simple as it is done using BCDW.
    I did not find how to load ISOLinux from ISOLinux, it didn’t work for me either. Here I can just edit isolinux.cfg but it is not what I want..

    Sounds strange but program from 2004 beats the new programs from 2009!!
    I think that all my needs can be satisfied using GRUB or ISOLinux but the solution will not be intuitive like it is done in BCDW.
    Some day the problem will be solved, some day.

    January 5, 2009

    Netbook Remix

    Filed under: Uncategorized — by NN @ 8:18 pm

    Have you heard about netbook ? It is a small computer with a small display. I had Asus 701 model. The main OS was Linux with english and no translation. The goal was installation a normal system with russian interface.

    First I looked at Windows XP Tiny edition it looked interesting. I even found how to boot Hiren’s Boot CD from USB and run Windows installation.

    Everything was prepared but it was found. Eeebuntu!

    The main problem with all strange hardware is driver for all. I assumed about difficulty finding driver for Wi-Fi network adapter and web cam for Windows. And there it is all packed, no need to look in all internet.

    So was it.

     

    The other interesting part is netbook remix, nbr-launcher. It is very intuitive and minimalistic interface. It is good for touchpads because you have no need to scroll in menus and good for those who want simplicity in their life.

    IMHO it is good for desktops too.

    Anyway eeebuntu was a good choice, russian interface was completely installed, every program worked as expected. There was enough space for OpenOffice, Skype, many games and even for WINE :) Finally about 250Mb was left free.

    In any way you have to buy some USB stick to have all things close to heart so it is ok.

    Currently the applets work only in Gnome. KDE will be supported some day, I hope.

     

    References:

    Eeebuntu

    Ubuntu Netbook Remix - there you have a nice video. 

    Netbook Remix

    December 17, 2008

    Internet Explorer 8 RC1

    Filed under: Uncategorized — by NN @ 6:13 pm

    For those who don’t know there is IE8 RC1 for beta testers. In fact this means that you have it in the torrent:)

    What is good: Finally there are no problems with any sites. facebook was the famous non working site with IE8 Beta2 , works as expected.

    What is bad: The IE shell works slower. Maxthon rules ;)

     The second is problem with ICQ 6.5 . Yes , yes. It is unrelated to IE but somehow it crashes when attempts connecting to the server. Very strange.

     

    Conclusion: Wait for final version. ;(

    November 28, 2008

    Opera Mini for PC

    Filed under: Uncategorized — by NN @ 2:15 pm

    Recently I have lost my home internet connection.

    I will have it soon again, but currently I have only my Nokia N73 and the PC. Can they be brought together ? Yes, of course.

    But nokia & orange company are not so nice.

    The default connection is the internet account connection, which means all ports are open and you feel exactly like a normal internet user.But not so fast !

    This shit costs you a lot of money. Do not be fool.
    The other connection is WAP connection, which means in fact HTTP/HTTPS connection. The only problem is limitation for HTTP. Is it really a problem ?:)

    So this is simple. Connect your phone to the PC, press connection in the Nokia PC Suite and then set manual connection. Set all setting as they set in the phone.

    E.g.:

    Access point: uwap.orange.co.il

    Username: orange

    One thing left is the proxy server. It is defined for 192.168.11.56. (If you have 3G).

    Set proxy server in your favourite browser and go on.

    Do not forget to set 3G for the speed ;)

    It worked great but what about traffic ?? You can stop showing pictures and this won’t help you too much.

    The solution is Opera Mini. This browser knows to compress all pages and supports HTTPS :) Nice :)

    What you need is an emulation of large screen phone and run Opera Mini there.

    Fortunately it has been done !

    Try here:

    http://java4me.blogspot.com/2008/02/run-opera-mini-on-pc-version-06-also.html

    Works great.

    P.S.

    Not every site works with Opera Mini, I have not succeed in accessing wordpress.com because of no cookies support.

    Enjoy.


    Next Page »

    Powered by WordPress.com