Spam has always been a big problem for all blogs. Fortunately, worpress.com provides wonderfull Akismet spam filter which is works amazingly well. I do have switched on moderation for all comments, to make sure no spam gets through, but without Akismet it would be impossible to manage it because of the spam volume. Since I started this blog (August 2006), it caught over 17'000 (yes, seventeen thousands) spam posts. In other words, about 30 spam comments a day or almost 60 spam comments per published post.
There is a saying that necessity is the mother of invention. Such necessity happened last week and forced me to try out the Groovy language.
The trigger was need for creating good data set for testing changes in a full text search. I had to locate few hundred of obsolete technical documents to be used as test data, dump the metadata as well as the BLOB data to disc, create INSERT sql scripts and loader that would from Ant pre-load the database with the test set and insert the BLOB's. It is fairly simple task, the issue were boundary conditions:
Akita published two part tutorial that leads you through building the famous 15 minute blog application in Rails 2.0. Read the parts one and two - or follow the screencast by the same author.
Thanks a lot, Akita - very nicely done !
I have first time encountered the error:
ORA-29907: found duplicate labels in primary invocations
after testing the change request we have implemented recently. The error message was not very helpful - I was not exactly sure which labels and which invocations ;-) - and as Oracle guru who actually does understand fine details of Oracle Text was visiting sunny India, I was on my own.
The change addressed an issue in repository search: users were asking for more flexible processing of full text search phrases: instead of e.g. searching for "unit test" search for document that contains both unit AND test. The text was parsed in Java and the SQL generator produced instead of something like
After some break, I got back to Rails land. The return is not as smooth as I hoped: since Rails 2.0, many things work differently and quite a few steps learned from "The Book" do not work any more. The issues are more often than not quite easy to fix, but there is quite a few of them.
All the following is related to NetbeansRuby build 6327 from Jan 26th with JRuby 1.1RC1
After some break, I dusted off the Ruby to try out one interesting idea Peter presented yesterday that literally ASKS for Rails. So I grabbed the latest and greatest RubyNetBeans from Ruby Hudson. For some reason it stopped updates on January 26th so the latest version I have got was build 6327. It is bundled with JRuby 1.1RC1 and the Rails version that comes preinstalled is 1.2.6. Using the menu Tools -> Ruby Gems, they can be easily upgraded to latest and greatest 2.0.2.
Lured by the iPhone platform, this is what I read in the evenings. Feels kind of funny: after 10+ years of Java/C# and almost as many years of C++ beforehand, I mostly lost my C instincts and C habits. Fortunately, I have also mostly lost my C++ bad habits as well.
The Apple site is definitive starting point - put the http://developer.apple.com/referencelibrary/index.html into your bookmarks. From non-Apple sources, very bookmarking-worthy is the Cocoa Literature and Cocoa Devcentral.
This is post is NOT about version control in the sense of source code control. It addresses the issue how to easily tell which version of the Web application is running as well make sure that the same version is reflected in the snapshots performed by Ant. We have used this approach on several applications and found it quite useful.
The version I talk about is not the automatically generated version from VCS system (such as SVN revision). The version number is set manually.
I better blog this before I forget what was the issue :-).
During daily run of unit tests, I started to receive this (very well explained) exception:
[sourcecode language='xml']
org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [17004];
--- The error occurred while applying a parameter map.
--- Check the APPROVAL_TASK.insert-InlineParameterMap.
--- Check the parameter mapping for the 'scheduledDate' property.
--- Cause: java.sql.SQLException: Invalid column type; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred while applying a parameter map.
--- Check the APPROVAL_TASK.insert-InlineParameterMap.
--- Check the parameter mapping for the 'scheduledDate' property.
--- Cause: java.sql.SQLException: Invalid column type
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:121)
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:212)
at org.springframework.orm.ibatis.SqlMapClientTemplate.insert(SqlMapClientTemplate.java:397)
... [/sourcecode]
Now the problem was that scheduledDate was null. Here is partial SQL map used:
[sourcecode language='xml']
Testing applications that communicate using email is more challenging than e.g. testing database access. Thanks to GMail and Spring, it can be done pretty easily.
Here is the scoop: I need to generate email notifying users about business events and after sending the email, store the content in the database. In real environment you will use corporate SMTP server and real email addresses of real people.
For development we can avoid bothering and spamming our customers by few simple tricks.