The following articles were authored by mipme_kampfkoloss

Aloha Editor: How to create toggling Toolbar Buttons?

As we are preparing our new admin section at me’kono, i was looking for a new up-to-date WYSIWYG Editor to use and finally thought to go with the aloha editor Version 2. To my disappointment the documentation at the time of writing is quite… ah, well… not the best – and simple questions popped up quite fast. So in this first post we’d like to share our findings and how to create toggling formatting buttons for your toolbar in the Aloha editor.

Let’s start where Leap 3 in the very short docs leaves you.

So you got your buttons defined like this:

and your jQuery event handler looks like this:

Now these event handler can set the selection to bold, italic, underline, etc. but don’t reset the style if you click once again. If you have a look at the predefined array of commands, there are no is no help either:

But the unformat object uses a method removeFormatting and after having a look at that, you can figure out how tags are applied on a basic level.

This can be applied to our click handler so we use the Editing.wrap  method too:

Short explanation:

  • aloha.ui.commands  are objects consisting of at least an action property – a function, which gets called. We create this on the fly on lines 5-9.
  • To calculate the tag to wrap around the selection we use the node property of the command in uppercase.
  • To get the clicked command we substract ‚action-‚ from the buttons class property

Well, this should now do the same as before. So what’s the deal here? It’s simple – just change the last parameter of the wrap method call to false and you and up with a toggling formatting button. We do this by checking if the clicked formatting button has the active property – which you should have if you have gotten to Leap 5: Update Button States in the tutorial and simply set an extra active attribute . So our final code looks like this:

So, we hope this helps you create a toolbar for your Aloha Editor with toggling format buttons.


Permalink Aside

So you could not resist getting yourself that free upgrade to OS X 10.9 Mavericks and now your local development environment went south? Or you are thinking of upgrading, but first want to know what problems you will have to face? So here is a short list of problems i ran into, what their causes are and how to fix them:

What’s not working (for me)

After upgrading these things were not working anymore:

  • no virtual hosts
  • no php
  • no mysql
  • no mcrypt
  • Zend generating timeouts in various modules

Detecting the first two was quite obvious, but why Zend framework resulted in timeouts was somewhat of a mystery in the first place. Mysql server worked nicely, as i checked that with Sequel Pro – contecting worked fine, all the data was there. So here are the reasons why stuff did not work on my machine:

Reasons for not working

  • no virtual hosts because the upgrade moved my vhost-file to a backup file and did not replicate the already created ones
  • no php because similar happened to the httpd.conf file where by default php module is commented out
  • no mysql (via php) because the default connection sockets are not set in the php.ini, where the previous version also got backup-ed
  • no mcyrpt because it is not completed in the new version coming with OS X 10.9 Mavericks, which is PHP 5.4.17 (at the moment)
  • the Zend timeout occurred because of the missing mysql socket of php

How to fix these problems

So, know that we know the reasons for the errors here are the links and ways to get your development mac up and running again:

  • Go to /private/etc/apache2/extra and check your httpd-vhosts.conf file or another where you have stored your virtual hosts. Usually it simply requires copying the old version indicated by ~orig at the end and renaming it the desired .conf file.
  • Check your httpd.conf (/private/etc/apache2) and enable php5 by uncommenting the line starting with LoadModule php5_module.
  • Reenabling Mysql: there are various websites on the net explaining how to enable mysql on php5 on a mac – so follow that or simply compare your /private/etc/php.ini.default (currently used) with your original from before the upgrade (/private/etc/php.ini-5.2-previous~orig, or similar). Especially watch out for instructions like „mysqli.default_socket = “ where the new version is empty.
  • Ok, installing mcrypt is a longer process. I followed the instructions from Neil Gee and it just worked – many thanks!
  • After your mysql socket is working properly Zend should also be humming again…

Hope this helps everybody who is keen to do the step to Mavericks – it really paid of for me. Just one simple fact to undermine my excitement: 10 GB extra space on my hard drive!!

How to create Waterfall or Pie-Charts and Treemaps in R

Getting things done in R: Waterfall aka Bridge Charts, Multi-level Pie Charts, Bullseye Charts and Sankey diagrams. This is a short round-up of useful pages and resources.

charts and diagrams to impress your audience

If you are hunting for best poster award or want to impress the audience with your presentation at a conference, graphs, charts and diagrams can be a key asset. In contrast to this, my experience from conferences has shown that presenters pay almost no attention how to communicate and visualise their research results. Therefore this post shall introduce you to some amazing but uncommon charts and diagrams and discuss some aspects to consider for creating amazing visual presentations.

Permalink | 1 Comment Link

Your research is amazing and your findings are ground-breaking? Then your presentation should emphasise your results by transporting your message in a sufficient and easy-to-follow manner. One way to achieve this, is to use beautiful typography for headlines.

These fonts are usually called ‚display fonts‘ and if you are not stuck in any kind of corporate design enforced by your institute / company, you should definitely check out a recent article at featuring some amazing display fonts – and they are all for free: Free Fonts : A Walk on the Grunge Side

Although some might be to rugged, most of them would definitely go well on 1 or 2 slides stating your main message. Just imagine using for instance the font ‚Protest Paint‘ to shout out: „Global Warming is real!“ or „Stop Smoking now!“ and nothing more on one slide. Your audience will definitely remember you as having a clear and valuable statement!

My personal favourite is Wicked Grit, which will be in my next presentation.

What do you thing? Do you have the freedom to use your own presentation layout at conferences?



one month later: me’kono lists more than 100 academic institutions

August passed by fast, but the crew at me’kono did not waste too much time: we are now listing more than 100 academic entities and research institutions! – and most of them organise a conference. So plenty of choice already here!

The 100th institution happened to be the University of Porto or ‚Universidade do Porto‘. Although not the oldest, it is the largest and best ranking university in Portugal. R&D seems quite fruitful since the university’s members are responsble for 20 % of all Portugiese papers published. By coincidence the Universidade do Porto celebrated 100th birthday this year – so congrats to you guys! Porto is a beautiful city with lots of history, a unique atmosphere and of course the great desert wine is produced there. So, definitely worth a visit.

What else happened in the mean time? After releasing the first version of the plattform me’kono some bugs and misconceptions are removed now and i hope the website got more userfriendly. We especially focused on enhancing the locations section. We hope you like it.

At the moment some internal optimisations are the main focus. And, at the end of September we will introduce some new features for the conference pages. So stay tuned & any feedback very much welcome!


First public version online – 50 conference already listed

Me’kono is finally online! And we are already listing 50 conferences and research events with facts to location, organisors and deadlines. Milestone #50 was set by the SAANZ Annual Conference entitled „Looking Forward: Trends, Horizons and Utopias“ organised by the School of Social and Cultural Studies at the Victoria University of Wellington in New Zealand.

At the moment me’kono is just a conference database with an ever increasing number of entries. But we have more comming. And all conference submitters will profit from these new services. So, submit your conference or research event and start promoting it using me’kono pages.

get the least / greatest from multiple columns in mysql 5.x

Looking for the lowest or biggest value in multiple columns in a mysql table? There are two handy function in mysql, namely LEAST and GREATEST, which return the lowest / biggest value from the given list of parameters. Therefore, if you like to get the absolute minimum or maximum in the whole table over multiple rows, you could combine these two functions with MIN or MAX and use the following SQL statement:

SELECT MIN(LEAST(column1, column2, column3, column...)) FROM table1

But LEAST and GREATEST have some limitations concerning their handling of NULL values:

  • GREATEST returns NULL if any of the values is NULL
  • LEAST returns NULL if all values are NULL

The problem in my case was, that some columns in my table were not required and had to stay NULL and my statement – especially for retrieving the absolute maximum – failed to deviler the proper values. Searching for a solution was quite tedious, so I thought to share it, since it turns out to be pretty simple – just turn it around:

SELECT LEAST(MIN(column1), MIN(column2), MIN(column3), ...)) FROM table1

Permalink Aside

It is time to announce our existence. mé’kono is in development and has reached private beta status. Friends and foes of us are testing the upcoming first release of the mé’kono conference platform and we hope to deliver it to the general public soon.

So stay tuned!

Greetings from sunny Vienna,