Wednesday, February 11, 2009

RubyonRails: How to Integrate Comatose CMS & FCKEditor tutorial in your rails application

Steps

Install CMS Comatose plugin

$ script/plugin install http://comatose-plugin.googlecode.com/svn/trunk/comatose
$ script/plugin install git://github.com/darthapo/comatose.git (For Rails 2.X)

$ script/generate comatose_migration
$ rake db:migrate


Dependencias


$ ruby script/plugin install git://github.com/rails/acts_as_list
$ ruby script/plugin install git://github.com/rails/acts_as_tree


Install FCKEditor Plugin


$ script/plugin install git://github.com/davividal/fckeditor.git


Install views in our project

$ rake comatose:admin:customize

Edit "app/views/comatose_admin/_form.rhtml"

replace:


<%= f.text_area :body, :rows=>20, :tabindex=>2 %>


with:



<%= fckeditor_textarea('page', 'body', :width => '100%', :height => '500px') %>


Add FCKEditor javascript file to

app/views/layouts/comatose_admin.rhtml

<%= javascript_include_tag :fckeditor %>

Configure FCKEditor to accept other other Files Types like "PDF".

/vendor/plugins/fckeditor/app/controllers/fckeditor_controller.rb
MIME_TYPES = [
"image/jpg",
"image/jpeg",
"image/pjpeg",
"image/gif",
"image/png",
"application/x-shockwave-flash"
]

Comatose Configurations in config/initializers/comatose.rb

Comatose.configure do |config|

config.admin_title = 'Administration'
config.admin_helpers = []
config.admin_sub_title = 'Administration Pages'
config.content_type = 'utf-8'
config.default_filter = ''
config.default_processor = :liquid
config.default_tree_level = 3
config.disable_caching = false
config.hidden_meta_fields = 'filter'
config.helpers = []
config.includes = []

# These are 'blockable' settings
config.authorization = Proc.new { true }
config.admin_get_author = Proc.new { request.env['REMOTE_ADDR'] }
config.after_setup = Proc.new { true }


# Includes AuthenticationSystem in the ComatoseAdminController
#config.admin_includes << :authenticated_system

# Calls :login_required as a before_filter
#config.admin_authorization = :login_required

end

Java Tools - Finding bugs, optimization and profiling

There a few tools for Java developers that can help us to be "better" programmers, (a bad programmer will allows be bad...). Finding bugs, optimization and profiling make part of a programmer day life, and why not using tools like these ones:

FindBugs

«FindBugs, a program wich uses static analysis to look for bugs in Java code»


http://findbugs.sourceforge.net/


«PMD scans Java source code and looks for potential problems like:

  • Possible bugs - empty try/catch/finally/switch statements
  • Dead code - unused local variables, parameters and private methods
  • Suboptimal code - wasteful String/StringBuffer usage
  • Overcomplicated expressions - unnecessary if statements, for loops that could be while loops
  • Duplicate code - copied/pasted code means copied/pasted bugs

PMD is integrated with JDeveloper, Eclipse, JEdit, JBuilder, BlueJ, CodeGuide, NetBeans/Sun Java Studio Enterprise/Creator, IntelliJ IDEA, TextPad, Maven, Ant, Gel, JCreator, and Emacs.»



http://pmd.sourceforge.net/


«YourKit, LLC is a technology leader, creator of the most innovative and intelligent tools for profiling Java & .NET applications. The YourKit Java Profiler has been already recognized by the IT professionals and analysts as the best profiling tool.

With YourKit solutions, both CPU and memory profiling have come to the highest professional level, where one can profile even huge applications with maximum productivity and zero overhead.

There are several, recent innovations to profiling that have gained well-deserved popularity among professional Java developers, both in big and small companies.

YourKit is the standard-setter in the evolution of profiling tools.»

http://www.yourkit.com/

Wednesday, February 4, 2009

Ajaxian » ECMA What? Harmony Who? TC39? Tamarin? JavaScript!


There's a lot of misunderstanding among "javascript" and what it really means. I found an article that clarify it in a simply and direct way .

Ajaxian » ECMA What? Harmony Who? TC39? Tamarin? JavaScript!: "from the world."


I'm not a fan of ECMA and other standardization comities like ISO, and the last issue about OOXML and ODF was a clear example, since they were very criticized and their decision was not well aceppted by all the user community.

Thursday, January 29, 2009

Offline Gmail

It starts to be a reality using the Gmail in off-line mode. Gmail uses Google Gears to store the relevant information synchronizing the information whenever we have an Internet connection. This allows us to do simple things such as reading the mail and sending emails. Of course, the effective sending of the mail will only be made from the moment we have a valid Internet connection. I can only say that this new feature will be very useful, the only penalty for now, is the fact that it is not available in Portugal. It's only available in the U.S. and UK.

See more at Official Gmail Blog: New in Labs: Offline Gmail.

Monday, February 4, 2008

Software Projects Cycle


Software projects and all the processes involved are getting more and more predictable, I've found a picture (not new), that exposes all the cycle in a clear and simple way. Do you have a better way to described it?