_Another server_
Last modified on : 23.10.2009
I started working on minimalizing memory consumption on this server. That's because I want to install additional software (i.e. Catalyst and Dancer) on it.
It won't surprise much people that Apache was number one on memory consumption. So I decided to move the http-server to nginx. You probably don't see it, but I did the move today. It took me no more than half an hour. That includes getting the tar-file, compile, install and configure.
I can tell you: Nginx is way more easy than Apache. And it takes much less memory (my Apache configuration probably sucked a lot). Call this a win-win !
_Canon software installation_
Last modified on : 12.10.2009
I baught a Canon camera when my baby was nearly 1 year old (that is last year). I'm very happy with the quality of the images and the camera body itself. I did use Canon's software which was bundled in the package with pleasure too.
One day I reinstalled my mac and figured that I couldn't find the disk anymore. Today I found a web page which describes how to install the software available through Canon's site.
I didn't try it, but this seems very promising!
_Finance::Quote Release 1.17_
Last modified on : 5.10.2009
Today Finance: :Quote hit CPAN.You can find it here.
This version should enable GnuCash users to get quotes from websites again. Other work went to integrating HU.pm (Hungarian stocks) and bug fixes due to website modifications.
Finance::Quote is known to work nicely with Finance::QuoteDB for keeping your quotes easily in a database. Finance::QuoteDB uses DBIx::Class and therefor it is database independent. A frontend script (fqdb) is available if you just want to start downloading stocks to a personal database. Historical quotes are also available through the use of Finance::QuoteHist which is also supported in Finance::QuoteDB. An interface to GeniusTrader is also available.
Futur work goes to the porting of GeniusTrader to CPAN. A alpha version has already been posted to CPAN but non-developpers should stick to the current stable release of GeniusTrader
_Working on Finance::Quote_
Last modified on : 30.09.2009
I'm back to work on the next Finance::Quote release. Maintaining a module like F::Q seems more time consuming than I originaly thought. Mainly due to modifications in websites which make submodules fail. This is somewhat a surprise to me as I didn't use all modules before taking over the maintenance. Also release 1.16 has seen some additional submodules come to life, which also need maintenance for the same reason. I know now that an important of maintenance time has to go to checking submodules and keeping them on track with their respective websites.
The next release adds another job to be done. I recently subscribed to the GnuCash mailing list. The GnuCash project uses F::Q for retrieving quotes (which certainly is a very good idea). It seems some GnuCash users have problems making F::Q work from GnuCash. So I'd like to do some work for these users also.
I certainly don't have to do all the development on my own. Thanks to other users/developers for sending patches!
That definitely makes me try to free more time for this module, but also keep on working on Finance::QuoteDB and Finance::GeniusTrader!
_Installing wxPerl on Snow Leopard (works also for 64bit processors)_
Last modified on : 27.09.2009
I needed to run wxPerl on my new Macbook Pro with 64bit capable processor. wxWidgets doesn't support 64bit so I needed to compile everything in 32bit. Here comes how...
Fire up a Terminal and do the following: (you might prefer to create a temporary directory for doing all this)
Start with installing perl in 32bit
Download the current perl.tar.gz from perl.com.
wget http://www.cpan.org/src/perl-5.10.1.tar.gzexplode the archive and move into the created directory
tar -xvzf perl-5.10.1.tar.gz cd perl-5.10.1specify the SDK you wish to compile perl against (this is not really needed)
export SDK=/Developer/SDKs/MacOSX10.6.sdkConfigure the build instructions
./Configure -Dcc="gcc -m32" -Dprefix=/usr/local -Uloclibpth -Dlibpth=/usr/lib -Accflags="-arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -I/usr/local/include" -Aldflags="-arch i386 -L/usr/local/lib" -Alddlflags="-arch i386 -bundle -undefined dynamic_lookup -L/usr/local/lib" -dBuild and test
make make testinstall perl as superuser
sudo make installuse the newly installed perl by default: Add /usr/local/bin to the PATH
Use your favorite editor to edit $HOME/.profile. Then add this line to the bottom of the file :
PATH=/usr/local/bin:$PATH
Now build wxWidgets
- Download wxwidgets 2.8.10: Open this link in your browser: http://prdownloads.sourceforge.net/wxwindows/wxWidgets-2.8.10.tar.gz
explode and move into directory
tar -xvzf wxWidgets-2.8.10.tar.gz cd wxWidgets-2.8.10Configure the build instructions
arch_flags="-arch i386" ./configure CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" LDFLAGS="$arch_flags" OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags"Build and test
make make testinstall wxWidgets as superuser
sudo make install
Install stc
While still in the wx source directory, go to contrib/src/stc subdirectory
Compile and install
make make test sudo make install
Then install Alien::wxWidgets
Get the archive
wget http://search.cpan.org/CPAN/authors/id/M/MB/MBARBON/Alien-wxWidgets-0.44.tar.gzexplode and move into directory
tar -xvzf Alien-wxWidgets-0.44.tar.gz cd Alien-wxWidgets-0.44Configure the build instructions
perl Build.PLanswer 'no' when asking to refetch and install wxWidgets
Build and test
perl Build perl Build testinstall as superuser
sudo perl Build install
install Wx from cpan
only one step for this ;)
sudo cpan Wx
_Emacs in XCode_
Last modified on : 21.09.2009
I'm an Emacs lover. I use Emacs every day. I use it on all my computers, even on this server. So, Emacs lovers, don't hate me for what follows...
I've becoming more and more serious about developping a Macosx cocoa app. In a first stage I've set up Emacs to be the default editor. Allthough Emacs can be configured to enable some kind of auto completion, it can't do it as XCode does. As I don't know all the Cocoa framework class methods, I switched the editor back to XCode.
I really miss some key features in XCode, but I had to stick with it. Well, that's what I presumed, until I started digging around...
This was a very nice help !
MacOSX works with Keybindings.dict files to set keybindings and the default system text editor functions does support features as : kill ring ! However it is not bound to any key and by the way, the kill ring is set to 1 (which means no kill ring at all).
These are the steps to enable this (works on SnowLeopard, but should be working on previous versions also - untested):
At the Terminal prompt, set the kill ring to mre than 1:
defaults write -g NSTextKillRingSize -string 1000Then copy this file in ~/Library/KeyBindings (you probably will have to create this directory)
For supporting the C-u command in XCode, you'll have to set the View-Folding-Unfold All menu keybinding to something else (I use C-S-u).
You're done! Happy emacs Xcode !
_Site is up again_
Last modified on : 22.08.2009
The ecocode.net server crashed two weeks ago. Due to hard work ;-) I had no time for configuring the web server until today. So now the site is up again!
Please report if anything seems to fail...
_Release 0.00_50 of Finance::Geniustrader_
Last modified on : 7.08.2009
Today the first alpha release of Finance: :GeniusTrader hits CPAN. GeniusTrader is a mature tool for setting up trading systems.This port to CPAN is probably usable but untested yet, so don't use it for real life trading.
_Test templates for Finance::GeniusTrader_
Last modified on : 2.08.2009
I'm currently figuring out how the test structure should be set up.
The top module Finance::GeniusTrader isn't of any use for the moment, except having all submodules nicely grouped. So we can logically build tests for each submodule separately. Naming convention is therefor quite similar to Finance::Quote tests: Name the test as the module it tests. As there are also scripts in the package, these will be prefixed with "mod_".
Each module test-file tests following items:
- Is the module correclty loaded and does it provide the expected methods ?
- Are objects correctly created ?
- Do methods operate as expected ?
Script tests are less urgent. They'll be prefixed with "scr_".
Beside these module related tests, there are perl related general tests like pod-coverage, kwalitee etc. Those test files are named with a number index as this is the convention for cpan modules.
There might be a need for specific multi-module related tests also. We could use a short description for the naming of these, but that would prevent. We might use "mmod_" as a prefix for these...
_Ongoing work_
Last modified on : 1.08.2009
Hello,
While at the seaside I figured it might be useful to write some status reports covering ongoing public work. While playing with my son (well that's what keeps my busy while on vacation) I concluded that those might as well be published to this blog.
This is something I already do on regular basis for my professional live (except that they are kept private).
Those reports help me stay focused to whatever I'm doing and hope to accomplish. Maybe some people might wish to help or just give me their opinion on what I'm doing.
_Work on CPAN integration of GeniusTrader_
Last modified on : 25.07.2009
After some discussion on the GeniusTrader mailing list, there surely seems to be interest in integrating GeniusTrader to CPAN.
While waiting for an official 'cpan' branch on the svn repo, I started a private and temporary repo on github. I'll probably keep working in this repo and commit to the svn repo (if I get a commit bit), otherwise submitting patches.
This work is focused on the sole purpose of this integration. It is the intention to track commits to trunk and integrate those directly in the cpan-branch. Once the work is done I hope the cpan branch will replace trunk.
The work flow:
Create the module directory layout and add missing files (Done)
Port the module (.pm) files. Essentially changing the namespace and remove all those
use lib '..'statementsLook into external dependencies: GD, ImageMagick... (I might be missing some here)
Port the script files.
Write test script skeleton based on Test::More
Port the existing test-script. I think there currently is only one ;-)
_Catalyst Framework 5.80001 is out !_
Last modified on : 19.04.2009
Catalyst Framework version 5.8001 is out! This is a major step forward as Catalyst now incorporates full support of Moose object oriented framework.
The development wiki has some nice tutorials etc. if you want to build websites with this cool framework.
Take a visit at the Catalyst homepage for further info.
_The Belgian Perl Workshop 2009 - 28.02.2009_
Last modified on : 01.03.2009
Thanks to the personal investment of Dirk and Chris the second Belgian Perl Workshop was a success. Two rooms and 40+ attendees! Great speakers talking about interesting stuff. Here's a snapshot of the talks I attended in the second room.
Yuval Kogman
First speaker was Yuval Kogman. He introduced us to the Kiokudb object storage engine. The project is young (first publication on cpan is from december 2008) and very promising. Object storage is an alternative to relational database like DBIx::Class. Both are a layer between your program and the database backend. Currently Berkeley DB and DBI are supported by KiokuDB.
The main difference between the two is the absence of a schema when using object storage. You actually define and create objects using Moose and then just tell a KiokuDB instance to save the object. KiokuDB then offers you methods to find, list, delete etc objects. Relations between the objects are stored with the objects. That means that a link to a client is maintained when saving an invoice object, and thus when recalling the invoice from the storage.
Eriam Schaffter
As a wxPerl user myself, I can fully agree with the "wxPerl rocks!" slide of Eriam. Desktop applications are not dead. The world is more than browsers and wxPerl brings cross-platform GUI layout with native look to the Perl programmer. It supports Linux (using Gtk widgets), MacosX and even Windows (for those still working on that platform).
A nice replacement to the wxPerl event loop is the POE module POE::Loop::Wx which brings all POE components to the wx platform. For RAD-way development you can use wxGlade (which is a Python application. indeed that sucks, but hey, we are not in charge of maintaining the code ;) ). As some other wxPerl users, I don't use wxGlade and I'm used to code the dialog boxes. That eases my way of maintaining code with tools like Git.
Eriam also mentions the XRC module which builds UI based on XML files. Drawback of this approach is a slower loading of your app.
Coding in wxPerl looks a little C-ish. That's why a module named wxPerl::Styles is available on CPAN. It's a layer so this is probably using more resources.
Abigail - regular expressions and Unicode Guru
Great talk for those who didn't know unicode and regular expressions suck. That said, Abigail made me realize I don't use a tenth of the possibilities of Perl regexp. i.e. \h, \v, {isDigit1}, [[:upper:]], placing the "-" character when using ranges etc.
For those who couldn't follow or didn't assist there are tons of examples on Abigails slides! A link should be available shortly on the bpw2009 site.
Simone Brunozzi - demo AWS
As a dessert after lunch, Simone Brunozzi demoed the Amazon Web Services internet site shortly. Great stuff out there.
Chris Vertonghen - Perl & Amazon SQS, SimpleDB, S3
AWS does have a lot of potential. AWS can be used for storage (i.e. images, css-files etc) or even streaming to make your internet server faster by serving some content from AWS. There are multiple implementations of the API on CPAN. According to Chris, Net::Amazon::S3 is the most mature and still maintained module. It includes methods for opening a connection to a bucket, putting, getting, listing, deleting files etc.
For queuing there is the Amazon::SQS::Simple module.
Matt Trout - Catalyst
Matt Trout is one of the key developers of Catalyst and also DBIx::Class. He animated the whole afternoon talking about the Catalyst MVC framework.
Catalyst is aimed at creating complicated websites and therefor shouldn't be compared to RoR (I won't put a link to the page here ;)). It provides the ability to keep a clean code base and that's one of the most important features. Development of Catalyst is still going on and Matt tells us that version 5.8 will be using Moose, producing even more maintainable code.
However the Catalyst team wants Catalyst to be backward compatible. This is a major requirement. You should not get an error when upgrading. "So please report it and it will be fixed!" But still, it is probably a bad idea to upgrade a production server without keeping the old server code available in a separate tree.
Writing code for important websites implies writing tests. Tests tell you that things are working now, but also tells you you didn't break old code when implementing modifications. When using Catalysts' scripts for creating views etc, test-files skeletons are automatically created for you. You only have to edit the files and create tests. For testing websites you can use the Test::WWW::Mechanize::Catalyst module in your tests.
Also think about documenting your code (you should use pod syntax for this). This will help you find out what you actually wanted to achieve in particular code. Keep in mind that your application will grow!
Matt Trout - Catalyst & AWS
In the Catalyst way of doing things, AWS' SimpleDB and SQS are just other model backends. The modules for accessing those are on CPAN. There's nothing more to say about this point except that you shouldn't trust the cloud.
What happens if AWS dies? What about backup? Can you actually test AWS backup? No! Nobody actually guarantees that your data will come back! You should keep your data with you and also have your own backup AND you should test the restore of the data.
What about connectivity? Performance? What if Amazon has a problem? You should be able to serve your data even when AWS is down.
So why could you use AWS?
AWS gives you CPU and CACHE. Use it to serve your data by syncing it upwards to AWS. You keep the data at your place and back it up. That's what you need. AWS redundancy is good because it is actually another copy of your data.
The End
The Belgian Perl Workshop ended with a bunch of great Lightning Talks and an auction for allowing bpw to happen again. Thanks to all participants and speakers for this unforgettable event!
_Emacs git mode_
Last modified on : 27.09.2008
I've stumbled across this nice tutorial. With the mentioned emacs-git mode you can checkout a branch which is not available in the emacs-mode joined in the official git repo. Nice stuff there !
_Finance::Quote resurected ?_
Last modified on : 17.09.2008
It seems that the Finance: :Quote Perl module is getting a second life.Look at the discussion on the mailing list.
Hope to read you there !
_Emacs mail snipping out_
Last modified on : 10.09.2008
Here is a function that will kill the marked region and replace it with "[..]". Very usefull when replying to long messages.
(defun snip-region-for-message ()
"Snips the selected region of an included message."
(interactive)
(delete-region (point) (mark))
(if (not (zerop (current-column)))
(newline))
(insert "[..]")
(if (at-end-of-line-p)
(progn
(forward-line 1)
(beginning-of-line))
(progn
(newline)
(insert message-yank-prefix)))
(beginning-of-line))
_yahoo quotes csv_
Last modified on : 18.08.2008
Everybody knew it could happen again. Well it did. uk.finance.yahoo.com returns weird data. The "date" and the "time" fields return "time" and "date" now. This makes Perl module Finance::Quote return bad data.
Of course this only happens on the UK site.
_my first org-mode setup_
Last modified on : 24.07.2008
So I started the orgmode setup. I use the latest stable version 6.05b. I could have used the development version out of the git repo, but for this kind of applications I'd rather use released versions. This helps in isolating bugs.
This is my first starting setup :
(add-to-list 'load-path "/Users/ec/emacslisp/org-6.05b/lisp")
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(setq org-agenda-files (file-expand-wildcards "~/org/*.org"))
(setq org-todo-keywords
'((sequence "TODO" "MAYBE" "STARTED" "|" "DONE")
(sequence "ASK" "BUY" "|" "DELIVERED")
(sequence "|" "CANCELED")))
_git version control system_
Last modified on : 24.07.2008
I'm using git since a few months now. Git is developped by Linus Torvalds and I discovered this Google Tech Talk. Linus is also very active on the git mailing list. Great to see that he's really madly behind the future of this VCS! Thanks for that.
_moving from planner to org-mode_
Last modified on : 23.07.2008
For the past 3 years I've used planner-mode to organize my projects and todo-lists. The feature I do like most is the possibility to link a task to more than one project. That makes it possible not to have to copy tasks around project files as it is required by org-mode.
However there's a negative point to planner-mode. There's no archiving feature in planner. That makes my ~/Planner directory have files dated from 2005 which I won't ever need. Since files have links to each other through tasks, I never deleted those files, fearing that I might corrupt data. Org-mode doesn't need an archiving feature, since once a project is finished, you can just move that project out of your org-directory.
It did take me some time to decide to move to org-mode. Now I'm making the effort of planning the transition from planner to org-mode. This doesn't seem as easy as it sounds since I actually have found no other way than check every single project I have in Planner (covering more than 3 years of data !). If anyone has a better idea, please let me know :)
When evaluating org-mode I've been through this nice tutorial. Also I've watched this screencast.
The orgmode site lists all these and more tutorials/screencasts etc.
_RSS-feed_
Last modified on : 23.07.2008
The RSS-feed has now been added to the site.
It will hold articles created or modified in the last 20 days :)
_wxGrid cell attributes_
Last modified on : 21.07.2008
wxGrid is a terrific widget. It allows to use images and show data in grid format any way you'd like. i.e. you can modify the background of a row each two rows. What you need to configure this and other behaviour are cell attributes.
First you have to create a Wx::GridCellAttr and set cell attributes you want. Then you tell your grid to apply the setting by allocating the new style to i.e. a row by using SetRowAttr.
_geniustrader_
Last modified on : 21.07.2008
Geniustrader is a developped in Perl and aimed at taking care of your investments ;)
_emacs info_
Last modified on : 21.07.2008
Don't know about Emacs ? Take a look here
_home_
Last modified on : 21.07.2008
This site is aimed at describing my activities in programming technology. The site holds several tips and tricks about different tools I use. Please use the keywords on the right to select articles.
All pages are generated by processing data-files in markdown format through a perl-script using the Template Toolkit. I've choosen for this way to maintain all information in text-editable files. That way, I can use git to hold versions of all articles. The site-generating script makes it really no harder than using a database for holding data. One more thing: each article is unique and thus you can copy the article shortcut for any reference you might need. However, articles might get out of scope and for that be modified or deleted.
My interests go to Perl, Emacs and Economics. Geniustrader and Taskjuggler are currently investigated. In my research I also need to create GUI's as a Perl interface. For this I'm discovering wxperl/wxwidgets.
For any comments, please send email to site@ecocode.net.
Thanks for reading.
_macosx xcode_
Last modified on : 21.07.2008
An introduction to Core Data development
_perl regular expressions_
Last modified on : 21.07.2008
A very clean summary of regexps.
_installing taskjuggler_
Last modified on : 21.07.2008
First install QT3, libjpeg and libpng with fink
Then compile TaskJuggler on MacosX by using these commands:
export QTDIR=/sw/lib/qt3
export LDFLAGS=-L/sw/lib
export CPPFLAGS=-I/sw/include
glibtoolize --force
aclocal
./configure --prefix=/usr/local --enable-mac --with-kde-support=no
--with-extra-libs=/sw/lib --with-extra-includes=/sw/include
then using make and sudo make install finished the building and installation job
