Daniel Leidert reported that the chemical-mime-data deb package has hit Debian. This package makes the chemical MIME types known to desktop environments like Gnome and KDE. Daniel, cheers!
Monday, September 18, 2006
Thursday, September 14, 2006
KDE/Ruby CMake magic?
I have commited my what's this about?? keyword cloud thingy to SVN into trunk/playground/utils/whatsthisabout. today. I am trying to use CMake as a build tool, but ran into a number of problems, one being the lack of a good example. After asking around on #kde-ruby it turned out that there is no known example.
OK, no problem. I'm a hacker, right? Jerome Pansanel pointed me to the KDE cmake modules. FindRUBY.cmake was there, so that's one step. Something that was missing was a module to detect the Korundum KDE/Ruby bindings, so I added FindKorundum.cmake. Since I am not a CMake experienced hacker, things might be off; comments most welcome!
However, when I add a find_package(KDE3), I get the error:
Additionally, I have struggle with the FindRUBY.cmake. I would expect ${RUBY_LIBRARY} to point to the directory where Ruby libraries are installed. But it points to /usr/lib, which is returned by puts Config::CONFIG["libdir"]. Tips most welcome here too.
OK, no problem. I'm a hacker, right? Jerome Pansanel pointed me to the KDE cmake modules. FindRUBY.cmake was there, so that's one step. Something that was missing was a module to detect the Korundum KDE/Ruby bindings, so I added FindKorundum.cmake. Since I am not a CMake experienced hacker, things might be off; comments most welcome!
However, when I add a find_package(KDE3), I get the error:
CMake Error: KDE3_DIR is not set. It must be set to the directory containing KDE3Config.cmake in order to use KDE3.And I have no idea on how to address that.
Additionally, I have struggle with the FindRUBY.cmake. I would expect ${RUBY_LIBRARY} to point to the directory where Ruby libraries are installed. But it points to /usr/lib, which is returned by puts Config::CONFIG["libdir"]. Tips most welcome here too.
Monday, September 11, 2006
KDE::HTMLPart GUI for tagging cloud
Everyone seems to blog about Ruby. Well, now do I too. Today I wrote three Ruby scripts to that allow me to tag my PDFs, just like I do with webpages using my del.icio.us account, something I wanted to do for some time already. In KDE4 keyword support mockups I suggested to do this with xattr, so I did. This is using a ruby xattr wrapper.
The first script allows adding a keyword. It is a simple script and allows adding one keyword per call. Syntax: thisisabout [tag] [file]. The code:
Removing a tag is done with a similar script:
The third script is where KDE comes in. It has a --nogui option if you don't want to GUI too show up. The code:
The obligatory screenshot:

In due time I will put this in KDE SVN, but I need to make a reasonable cmake script yet. Anyone who can tell me how I can have cmake check wether the required Ruby libraries are installed? There are other things to do too:
Because I have my PDFs in a SVN repository and share them between some work places, the first todo would mean I could share my tags too. The second would just mean a serious speedup.
thisisabout
The first script allows adding a keyword. It is a simple script and allows adding one keyword per call. Syntax: thisisabout [tag] [file]. The code:
#!/usr/bin/ruby
# Copyright (C) 2006 Egon Willighagen
# License: GPL
require 'xattr'
tag = ARGV[0]
file = ARGV[1]
if (file == nil)
p "syntax: thisisabout [TAG] [FILE]"
exit
else
description = File.get_attr(file, "keywords")
if (description != nil)
words = description.split
if (words.include?(tag))
p file + " already has the tag " + tag
else
description = description + " " + tag
end
else
description = tag
end
File.set_attr(file, "keywords", description)
end
thisisnotabout
Removing a tag is done with a similar script:
#!/usr/bin/ruby
# Copyright (C) 2006 Egon Willighagen
# License: GPL
require 'xattr'
tag = ARGV[0]
file = ARGV[1]
if (file == nil)
p "syntax: thisisnotabout [TAG] [FILE]"
exit
else
description = File.get_attr(file, "keywords")
newdescription = ""
if (description != nil)
words = description.split
words.each do |word|
if (word == tag)
# skip word
else
if (newdescription.length > 0)
newdescription = newdescription + " "
end
newdescription = newdescription + word
end
end
else
description = tag
end
File.set_attr(file, "keywords", newdescription)
end
whatsthisabout
The third script is where KDE comes in. It has a --nogui option if you don't want to GUI too show up. The code:
#!/usr/bin/ruby
# Copyright (C) 2006 Egon Willighagen
# License: GPL
require 'getoptlong'
require 'rdoc/usage'
require 'Korundum'
require '/home/egonw/bin/whatsthisabout'
class MainWindow < KDE::MainWindow
def initialize( name, counts )
super(nil, name)
setCaption("What's This About??")
vbox = Qt::VBox.new( self )
@browser = KDE::HTMLPart.new( vbox )
setCentralWidget(vbox)
@browser.begin()
counts.each {|key, value|
fontSize = (6*value)/2
@browser.write("");
@browser.write( key )
@browser.write(" ");
}
@browser.end()
end
end
opts = GetoptLong.new(
[ '--nogui', '-n', GetoptLong::NO_ARGUMENT ],
[ '--help', '-h', GetoptLong::NO_ARGUMENT ]
)
startPath = nil
gui = "yes"
opts.each do |opt, arg|
case opt
when '--help'
RDoc::usage
when '--nogui'
gui = "no"
end
end
if ARGV.length == 1
startPath = ARGV[0]
elsif ARGV.length == 0
startPath = '.'
else
RDoc::usage
exit 0
end
wat = WhatsThisAbout.new
counts = wat.getKeywords(startPath)
if (gui == "yes")
about = KDE::AboutData.new("whatsthisabout", "What's This About??", "0.1")
KDE::CmdLineArgs.init(about)
a = KDE::Application.new()
window = MainWindow.new( "What's This About??", counts )
window.resize( 600, 300 )
a.mainWidget = window
window.show
a.exec
else
counts.each do |bla, bla2|
puts bla + " " + bla2.to_s
end
end
The obligatory screenshot:

In due time I will put this in KDE SVN, but I need to make a reasonable cmake script yet. Anyone who can tell me how I can have cmake check wether the required Ruby libraries are installed? There are other things to do too:
- make a backup/restore facility
- use a database instead of recursively finding tags
Because I have my PDFs in a SVN repository and share them between some work places, the first todo would mean I could share my tags too. The second would just mean a serious speedup.
Saturday, September 09, 2006
KryoMol and KOpenBabel
I have not been posting here as much lately as I had hoped to, but have been quite busy with other things. So no Strigi plugin for Bioclipse yet (Strigi is still gaining momentum), and no new release of kfile_chemical.
However, there is progress on the KDE desktop other than the evolution of Kalzium: Armando Navarro Vázquez released a new version of KryoMol and Jerome Pansanel setup a SourceForge project for a KDE GUI to OpenBabel.
However, there is progress on the KDE desktop other than the evolution of Kalzium: Armando Navarro Vázquez released a new version of KryoMol and Jerome Pansanel setup a SourceForge project for a KDE GUI to OpenBabel.
Wednesday, August 30, 2006
Newsforge discusses Kalzium
Newsforge discusses Kalzium, OpenBabel:
And the Blue Obelisk Data Repository:
Cheers, Carsten!
Niehaus and code developer Benoit Jacobs recently began working on a new way of displaying chemical information with Kalzium: the 3-D model. The team uses Open Babel 2.1, a free software application used to convert chemical file formats. They tweaked the package to suit their specific needs. By using Open Babel, Niehaus says Kalzium will be able to display "pretty much every 3-D file out there, including chemistry file formats such as .mol, .pdb, and .xyz."
And the Blue Obelisk Data Repository:
A much more subtle, but no less important, addition is the merging of Kalzium's data with the XML-based data of the Blue Obelisk project. Blue Obelisk is a collaborative effort of chemists worldwide who contribute to a variety of open chemistry-based projects.
Cheers, Carsten!
Sunday, July 30, 2006
Qt-Java bindings: opportunities for chemistry
Duncan Mac-Vicar P. pointed me to this: Trolltech released a beta of Jambi (see this overview), which makes the Qt widget environment accessible from the Java programming language. One interesting tool of Jambi, is the tool that automatically builds a Java API to C++ libraries. Have not tried it yet, but hope to do so soon, as it might be useful for the ghemical plugin for Bioclipse. According to the press release, it also allows mixing C++ and Java code, which might offer interesting options to integrate CDK with Kalzium, which Carsten is heavily working on for the KDE4 release.
Monday, July 10, 2006
New kfile_chemical adds chemicalMIME support
Jerome Pansanel released kfile_chemical 0.12 today. This release depends on chemical MIME for making KDE registering the chemical MIME types. The next step is to convert the build process to make use of CMake.
Saturday, July 01, 2006
Overview of earlier blogs
Because I posted quite a few items in my chem-bla-ics blog on my involvement in desktop and KDE integration of chemistry. Here's an selection:
- KDE4 keyword support mockups, 2006-06-25
- Strigi gets kfile plugin support, 2006-06-20
- KDE desktop search: Kat, Strigi and Tenor, 2006-06-17
- Molecular indexing on the KDE and OS/X desktops, 2006-05-26
- Download statistics for chemblaics components, 2006-04-23
- More chemistry in KDE, 2006-03-11
- Kalzium Wins Award; Carsten Niehaus Interviewed, 2006-02-13
- Scons and bksys for kfile_chemical, 2005-11-10
- kfile_chemical gets XYZ, Mol2, SMILES, VMD and GenBank support, 2005-10-29
- InChI meta data with kfile_chemical, 2005-10-18
Thursday, June 29, 2006
Spin off from my chem-bla-ics blog
I decided that having these Strigi/KDE messages in my chem-bla-ics blog does not make sense. Therefore, this new blog, with KDE related blog items. The title is a pointer to the KDE name and my chemistry background.
Subscribe to:
Posts (Atom)