Wednesday, November 29, 2006

MathML support in Konqueror and Java?

Christoph Steinbeck used ASCIIMathML to extend HTML Slidy (see previous blog), to embed mathematical equations in his slides.

And it works like a charm... in a MathML supporting web browser like Firefox. The trick that ASCIIMathML uses, is that it converts a LaTeX-like syntax to MathML and let the browser handle that. Actually, the website mentions a true LaTeX syntax to MathML version too.

Konqueror?

Now, Konqueror does not support MathML (yet), and, therefore, cannot be used. The Konqueror website does not even mention MathML, though there were rumours about MathML in KHTML quite some time ago. Alfredo Beaumont implemented better MathML support in KFormula during this summer's Google Summer of Code. Is anyone actually embedding that into KHTML?

JGecko?

Roman Kennke is a Classpath developer and is currently doing an excellent job extending it with HTML rendering support. Are there opensource Java MathML renderers at all? And what are the chances seeing that embedded in the free Java HTML renderers? That is, can I expect JGecko to support MathML any soon?

Friday, November 03, 2006

Searching database from within Konqueror

Resal, who earlier released a KDE based GUI for GROMACS, described a recipe on how biochemical databases can be added to the search bar in Konqueror:

Click on the left side of Konq search box, a menu appears. At the bottom of this menu there is an option saying:
"Select search engines..."
click it and when the search engine dialog appears, select "New" and enter:

Search Provider Name: PDB
Search URI: http://www.rcsb.org/pdb/search/navbarsearch.do?newSearch=yes&isAuthorSearch=no&radioset=All&inputQuickSearch=\{@}&image.x=10&image.y=6&image=Search
URI Shortcut: pdb

Press Ok and again click "New" and these :
Search Provider Name: Entrez
Search URI: http://www.ncbi.nlm.nih.gov/gquery/gquery.fcgi?term=\{@}
URI Shortcut: ent

Press OK and then check the boxes at the right of PDB and Entrez in the search engine dialog to add them
to your Konq current list of search engines.

Hope to be useful
Reza Salari

http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=PubMed&cmd=search&term=1hhb

(These above bits are licensed GPL, with copyright by Reza Salari.)

An Alternative: Web Shortcuts


An alternative would be to use Konqueror's Web Shortcuts technology, to allow you to just type in the URL bar pdb:1CRN for the PDB database, or ent:1CRN for Entrez. To do this, click in Konqueror's menu Settings, and then Configure Konqueror.... Click the 'Web Shortcuts' icon in the left list, and click the New... button that then appears on the right. The shortcut is the 'pdb' or 'ent' used in the earlier crambin example. The URI is exactly the same as those given in Reza's write up.

Saturday, October 28, 2006

KDE interface for GROMACS

S. Reza is writing a KDE interface to GROMACS [wp:], simply called Gromacs GUI (GPL, currently at version 0.2). I have not tried it yet, but comments have been positive.

Friday, October 06, 2006

Kaffeine Wallpaper was missing the InChI

Over at kde-looks.org uveuve uploaded a nice caffeine wallpaper, which refers to a multimedia player for KDE called Kaffeine. But I just had to add the InChI to it:

It's in the bottom right corner. You can download the wallpaper here (GPL license).

Monday, September 18, 2006

Chemical MIME types hit Debian

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!

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:
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.

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:

  1. make a backup/restore facility
  2. 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.

Wednesday, August 30, 2006

Newsforge discusses Kalzium

Newsforge discusses Kalzium, OpenBabel:

    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.

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.