May 142013
 

Short story: when upgrading a production system, always check the release notes of the new version.

Long story.

After the first upgrade of the server following the release of the new Debian stable, I was no more able to send e-mail from mai home pc, but I am still able to send from the server itself. The server itself is running Debian testing, so in the following days of the Debian release, testing got a lot of upgrade as usual.

This upgrade also boost postfix to the 2.1.0 release.

Sending mail from my home pc, then result in the error:

May 11 09:28:22 localhost postfix/smtpd[17094]: connect from unknown[79.21.142.151]
May 11 09:28:24 localhost postfix/smtpd[17094]: NOQUEUE: reject: RCPT from unknown[79.21.142.151]: 554 5.7.1 
<gianlum@gmail.com>: Relay access denied; from=<gian@grys.it> to=<gianlum@gmail.com> proto=ESMTP helo=<galactica>
May 11 09:28:24 localhost postfix/smtpd[17094]: lost connection after RCPT from unknown[79.21.142.151]
May 11 09:28:24 localhost postfix/smtpd[17094]: disconnect from unknown[79.21.142.151]

It turn out that from this release on, to be able to have a relay (from home I send mail using my server and not the provider’s one), you should put the client restriction in the directive

smtpd_relay_restrictions

instead of the old

smtpd_recipient_restrictions

as always in the main.cf file

I discovered this the hard way, since I was in a hurry to send a mail, and before I can find this change, I tried a gazillion other solutions and also checked for every blacklists in the case the server and/or my provider nerwork were blocked.
So, lessons learned:

  1. Always read the release notes (or at least, check them for the important software)
  2. Do not try massive upgrade past 10.00 pm or you will end to lose sleep and do not solve anything anyway until the next morning
  3. If you need to send a very urgent email, send it before trying a massive upgrade :-D

 

Mar 062013
 

I am pleased to announce the immediate availability of the new release of BulbCalculator.

With the 2.1.0 release I introduced some features that I feel was missing from the original version (to name one: load and save of the project) and are the basis for the development of some more new features that can be interesting.  The complete list of the new features are available from the BulbCalculator home page,from which can be also downloaded the software (both win-32 installer and stand-alone version) and source code.

As always I am looking for someone to help package for other linux distribution aside ArchLinux, which already have the package in AUR

 

Mar 012013
 

As stated in the previous post, the next version of BulbCalculator is approaching fast.  With the last couple of commits, I introduced the last big feature I’d like to add in the new version (the recent project list), so the last things to do is to fix a little bug (issue #16 on github) and produce a better installer for Windows.

I expect to release the 2.1 version by the end of the next week

Feb 212013
 

In the last couple of weeks the development on BulbCalculator begin to shape what will be the next version. Some of the limitations of the current version, like the limitation on the page size when printing,  make BulbCalculator less usefull. So, with this  and some other indications from users in mind, I start to work on the first version that will be an evolution of the original software.

So far, other than fix some annoying bugs, there is a (not complete) list of improvements that are already landed in the master branch of the git repository, in no particular order:

  • fixed the print problem
  • added a preferences system, for now for the GUI and the bulb defaults parameters. Other sections will be added
  • added the fron view to the 2d draw
  • merged the 2d views into one view (now top, side and front)
  • merged the two windows with data calculations
  • added a tabbed mode for the subwindows
  • some code clean-up and polishing
  • added a toolbar to which get the 3d resolution level and the choose of the profile to use (to be done)

Along with what already done, I finally find a way to have a load/save function without the need to save all the information about the profile definition in the output file. This will work introducing a local data directory where store the profile definitions downloaded and that will replace the “profile import ” option so to save a project I just have to write in the file the bulb name, the bulb parameters and little more, but not the full profile data.

I defined on github the 2.1 milestone with a short list of what I want to have before the next release.  Of course the list is not closed, so there is the possibility that some other improvements will be added as soon as they came in my mind.

 

Jan 072013
 

2012 is gone and a new year is beginning, so what better than write down some projects for 2013 ?

Let’s start

KDE
I’d like to complete the first KDE application I am writing and write a little plasmoid. The application is  a smart card / memory card /rfid card reader which I am starting to write with python, we will see what turn out. About the plasmoid, I am still looking for an idea.

BulbCalculator

I hope to release a new version with some nice features added and maybe try to port it to Qt5, but not immediatly

Other projects

Aside the already mentioned ones, I am looking to learn something mode about the NoSql databases, looking to Cassandra and maybe CouchDb, after I had a look on MongoDb. All this to work on a project I cannot talk about, at least for now.

Another thing I’d like to work on is OwnCloud, server side, but for now I am lacking the time to start (and my Php skills are a little behind, since I am not using very much for now).

There are other things outside the PC world, but these are really not very defined for now, aside my fun with the Footy Class Boat.

I will see by the end of the year how far I will go with these pet projects…

 Posted by at 6:05 pm
Dec 142012
 

While working on the Rosalind’s problems, I discover a nice feature of python, the cProfile module, that produce an output like this:

         5683 function calls (5637 primitive calls) in 0.013 seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:1012(__init__)
        1    0.000    0.000    0.004    0.004 <frozen importlib._bootstrap>:1018(load_module)
        4    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:1025(get_filename)
        1    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:1030(get_data)
        1    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:1040(path_stats)
        1    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:108(_path_isfile)
        5    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:1257(_path_importer_cache)
        1    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:1274(_get_loader)
        1    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:1299(find_module)
        4    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:1346(find_loader)
        6    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:1446(__enter__)
        6    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:1450(__exit__)
        3    0.000    0.000    0.001    0.000 <frozen importlib._bootstrap>:1464(_find_module)
      3/2    0.000    0.000    0.004    0.002 <frozen importlib._bootstrap>:1500(_find_and_load_unlocked)
        1    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:154(new_module)
      3/2    0.000    0.000    0.005    0.002 <frozen importlib._bootstrap>:1550(_find_and_load)
        1    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:1587(_handle_fromlist)
        3    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:181(__init__)
        3    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:201(acquire)
        3    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:226(release)
        3    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:266(_get_module_lock)
        3    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:280(cb)
      3/2    0.000    0.000    0.003    0.002 <frozen importlib._bootstrap>:305(_call_with_frames_removed)
        4    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:34(_relax_case)
        2    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:415(cache_from_source)
        5    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:486(_verbose_message)
        2    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:496(set_package_wrapper)
        2    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:509(set_loader_wrapper)
        1    0.000    0.000    0.004    0.004 <frozen importlib._bootstrap>:536(module_for_loader_wrapper)
      5/1    0.000    0.000    0.004    0.004 <frozen importlib._bootstrap>:581(_check_name_wrapper)
        2    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:593(_requires_builtin_wrapper)
        2    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:61(_r_long)
        3    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:643(find_module)
        2    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:654(load_module)
        1    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:700(find_module)
        3    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:74(_path_join)
        1    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:754(_open_registry)
        1    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:761(_search_registry)
        1    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:776(find_module)
        2    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:796(is_package)
        1    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:804(_bytes_from_bytecode)
        1    0.000    0.000    0.004    0.004 <frozen importlib._bootstrap>:849(_load_module)
        4    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:86(_path_split)
        1    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:934(get_code)
        1    0.000    0.000    0.000    0.000 <frozen importlib._bootstrap>:98(_path_is_mode_type)
        1    0.000    0.000    0.004    0.004 <frozen importlib._bootstrap>:996(load_module)
        1    0.000    0.000    0.000    0.000 codecs.py:238(__init__)
      852    0.001    0.000    0.002    0.000 cp1252.py:18(encode)
        1    0.000    0.000    0.000    0.000 cp1252.py:22(decode)
        1    0.000    0.000    0.000    0.000 functools.py:148(__init__)
        3    0.000    0.000    0.000    0.000 functools.py:152(__hash__)
        1    0.000    0.000    0.000    0.000 functools.py:155(_make_key)
        3    0.000    0.000    0.000    0.000 functools.py:167(<genexpr>)
        1    0.000    0.000    0.003    0.003 functools.py:241(wrapper)
        1    0.000    0.000    0.000    0.000 locale.py:555(getpreferredencoding)
        1    0.000    0.000    0.003    0.003 re.py:212(compile)
        1    0.000    0.000    0.000    0.000 re.py:230(escape)
        1    0.000    0.000    0.003    0.003 re.py:264(_compile)
        1    0.002    0.002    0.013    0.013 ros_kmp.py:3(<module>)
      168    0.000    0.000    0.000    0.000 ros_kmp.py:45(<listcomp>)
      212    0.000    0.000    0.000    0.000 ros_kmp.py:5(Find)
      212    0.001    0.000    0.001    0.000 ros_kmp.py:8(Comp)
        4    0.000    0.000    0.000    0.000 sre_compile.py:178(_compile_charset)
        4    0.000    0.000    0.000    0.000 sre_compile.py:207(_optimize_charset)
        2    0.000    0.000    0.000    0.000 sre_compile.py:258(_mk_bitmap)
     12/1    0.000    0.000    0.001    0.001 sre_compile.py:32(_compile)
        2    0.000    0.000    0.000    0.000 sre_compile.py:357(_simple)
        1    0.000    0.000    0.000    0.000 sre_compile.py:364(_compile_info)
        2    0.000    0.000    0.000    0.000 sre_compile.py:470(isstring)
        1    0.000    0.000    0.001    0.001 sre_compile.py:473(_code)
        1    0.000    0.000    0.003    0.003 sre_compile.py:488(compile)
       22    0.000    0.000    0.000    0.000 sre_compile.py:51(fixup)
        9    0.000    0.000    0.000    0.000 sre_parse.py:127(__len__)
       36    0.000    0.000    0.000    0.000 sre_parse.py:131(__getitem__)
        2    0.000    0.000    0.000    0.000 sre_parse.py:135(__setitem__)
       14    0.000    0.000    0.000    0.000 sre_parse.py:139(append)
     14/3    0.000    0.000    0.000    0.000 sre_parse.py:141(getwidth)
        1    0.000    0.000    0.000    0.000 sre_parse.py:179(__init__)
      310    0.001    0.000    0.001    0.000 sre_parse.py:184(__next)
       52    0.000    0.000    0.000    0.000 sre_parse.py:203(match)
      281    0.000    0.000    0.001    0.000 sre_parse.py:209(get)
        1    0.000    0.000    0.000    0.000 sre_parse.py:222(tell)
        1    0.000    0.000    0.000    0.000 sre_parse.py:224(seek)
       25    0.000    0.000    0.000    0.000 sre_parse.py:227(isident)
        4    0.000    0.000    0.000    0.000 sre_parse.py:233(isname)
        2    0.000    0.000    0.000    0.000 sre_parse.py:284(_escape)
      6/1    0.000    0.000    0.002    0.002 sre_parse.py:340(_parse_sub)
      9/1    0.000    0.000    0.002    0.002 sre_parse.py:418(_parse)
        1    0.000    0.000    0.000    0.000 sre_parse.py:68(__init__)
        1    0.000    0.000    0.000    0.000 sre_parse.py:702(fix_flags)
        1    0.000    0.000    0.002    0.002 sre_parse.py:714(parse)
        4    0.000    0.000    0.000    0.000 sre_parse.py:73(opengroup)
        4    0.000    0.000    0.000    0.000 sre_parse.py:84(closegroup)
       12    0.000    0.000    0.000    0.000 sre_parse.py:91(__init__)
        1    0.000    0.000    0.003    0.003 string.py:15(<module>)
        1    0.000    0.000    0.000    0.000 string.py:162(Formatter)
        1    0.000    0.000    0.000    0.000 string.py:51(_TemplateMetaclass)
        1    0.000    0.000    0.003    0.003 string.py:61(__init__)
        1    0.000    0.000    0.000    0.000 string.py:73(Template)
        2    0.000    0.000    0.000    0.000 {built-in method OpenKey}
        3    0.000    0.000    0.003    0.001 {built-in method __build_class__}
        1    0.000    0.000    0.000    0.000 {built-in method _fix_co_filename}
        1    0.000    0.000    0.000    0.000 {built-in method _getdefaultlocale}
        6    0.000    0.000    0.000    0.000 {built-in method acquire_lock}
        6    0.000    0.000    0.000    0.000 {built-in method allocate_lock}
        1    0.000    0.000    0.000    0.000 {built-in method charmap_decode}
      852    0.001    0.000    0.001    0.000 {built-in method charmap_encode}
        1    0.000    0.000    0.000    0.000 {built-in method compile}
      2/1    0.000    0.000    0.013    0.013 {built-in method exec}
        6    0.000    0.000    0.000    0.000 {built-in method get_ident}
        5    0.000    0.000    0.000    0.000 {built-in method getattr}
       26    0.000    0.000    0.000    0.000 {built-in method getlower}
       13    0.000    0.000    0.000    0.000 {built-in method hasattr}
        1    0.000    0.000    0.000    0.000 {built-in method hash}
        2    0.000    0.000    0.000    0.000 {built-in method init_builtin}
        3    0.000    0.000    0.000    0.000 {built-in method is_builtin}
        1    0.000    0.000    0.000    0.000 {built-in method is_frozen}
       43    0.000    0.000    0.000    0.000 {built-in method isinstance}
1322/1319    0.000    0.000    0.000    0.000 {built-in method len}
        1    0.000    0.000    0.000    0.000 {built-in method loads}
        4    0.000    0.000    0.000    0.000 {built-in method max}
       28    0.000    0.000    0.000    0.000 {built-in method min}
        1    0.000    0.000    0.000    0.000 {built-in method open}
       20    0.000    0.000    0.000    0.000 {built-in method ord}
      214    0.002    0.000    0.004    0.000 {built-in method print}
        9    0.000    0.000    0.000    0.000 {built-in method release_lock}
        6    0.000    0.000    0.000    0.000 {built-in method stat}
      423    0.000    0.000    0.000    0.000 {method 'append' of 'list' objects}
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
        5    0.000    0.000    0.000    0.000 {method 'extend' of 'list' objects}
      212    0.000    0.000    0.000    0.000 {method 'find' of 'str' objects}
        1    0.000    0.000    0.000    0.000 {method 'format' of 'str' objects}
       10    0.000    0.000    0.000    0.000 {method 'get' of 'dict' objects}
        1    0.000    0.000    0.000    0.000 {method 'items' of 'dict' objects}
        7    0.000    0.000    0.000    0.000 {method 'join' of 'str' objects}
        2    0.000    0.000    0.000    0.000 {method 'partition' of 'str' objects}
        1    0.000    0.000    0.000    0.000 {method 'read' of '_io.FileIO' objects}
        1    0.000    0.000    0.000    0.000 {method 'read' of '_io.TextIOWrapper' objects}
        4    0.000    0.000    0.000    0.000 {method 'remove' of 'list' objects}
       17    0.000    0.000    0.000    0.000 {method 'rpartition' of 'str' objects}
        2    0.000    0.000    0.000    0.000 {method 'rsplit' of 'str' objects}
        1    0.000    0.000    0.000    0.000 {method 'strip' of 'str' objects}

These informations are very usefull when the execution time matter, since looking at what function/method are called and how many time they are called, you can locate the bottle-neck and try to eliminate them.

For example,  trying to find a  solution for a problem on Rosalind.info the script need about 3 minute to run (with correct result). After some profiling and optimization, the time needed is down to 39 seconds. The problem in that case was to see that a certain function that I write, while giving correct results,  was called way too much time and use too much time.

Optimizing this single function, both in term of numer of calls and execution time, reduce the overall execution time of about 2 minutes.

So the lesson learned here was: profile the code !
Ok, profiling the code is not always usefull, for example if a software execute fast operations in the order of milliseconds and then wait for user input that are in the order of seconds, but it is always a good way to learn something else.

Nov 232012
 

In the last days I am playing with the problems on rosalind.info, to improve my python skill. So far I solved about ten problems, and they look good to code in python (I already learned something of course).

My goal is to solve all the problems, but I admit that some problems require some knowledge in some argument that are not my field (biology), since the problems are all about bioinformatics.

Mar 312012
 

As stated in the previous post, the work on BulbCalculator is restarting. The first activities, aside some little bugs fix, were the implementation of a better system to print the project along with some minor rework of the gui, mainly the Print menu.

Now BulbCalculator is aware of the paper size and of the page orientation, which where the first steps to be able to print the linesplan not grouped and with some reference point, which I suppose will make easy to print the lines and build the bulb.

 

Mar 282012
 

Since I will resume the development of BulbCalculator, I just moved the home page away from the wiki on gitorious to a new home page on the wordpress platform.

I am also moved the official git repository to github which has a issue tracker. For now I am using Bugs Everywere, but it has not a real web interface, so I will continue to use it for my development but I will sync the BE repository with the github issue tracker.