software development for the
existentially challenged
Older | Newer
Turn Off Tooltip Previews in Skim
comment share
Skim has a "feature" that drives me insane: a large preview tooltip when the cursor is hovering over any link within the document or in the Table of Contents.

Instinctively, I'll move the pointer along the table of content to hold my place and this giant (relatively) image hovers over a large portion of the list I'm trying to browse through.

(The screenshot made the tooltips partly transparent, and not as annoying as they are in reality). Fortunately there's a hidden preference you can change using defaults. Do this:
defaults write net.sourceforge.skim-app.skim SKDisableTableToolTips 1
The wiki page that documents this has a bunch of other interesting settings on the page as well.

This may have been my unfamiliarity with using defaults, but the default type for boolean is 0/1. If you wish to use "true/false" or "yes/no", you need to explicitly pass -type boolean.

Also, I couldn't get defaults to find the app using just "Skim", but your results may vary and the invocation above works just fine.
one:many: Add the Child, Save the Parent
comment share
I always forget this and always go nuts for a while. It's obvious and basic but I forget, so sue me.

Creating a one:many relationship using an ordered List, instead of the default Se, when you are ready to save the new child, you have to remember to
  1. Create the child
  2. Add the child to the parent
  3. Save the PARENT
You cannot first create and save the child first then add it to the parent.
Say this is your ChildController's save() method:

    // Do THIS
    def save = {
        def childInstance = new Child(params)
        Parent parent = childInstance.parent
        if ( true) ...
    // Don't THIS in the name of all that is holy
    def save = {
        def childInstance = new Child(params) true)
If you do it the wrong way, Grails will explode with
org.hibernate.PropertyValueException: not-null property references 
a null or transient value: Child._Parent_childrenBackref
Remember: create the child, add it to the parent, and then save the parent.

This is mentioned in the Grails Reference Documentation under 5.2.4 Sets, Lists and Maps but as an "oh by the way" and doesn't actually give you the error above (though you can also get this error as well):
When using a List, elements must be added to the collection before being saved, otherwise Hibernate will throw an exception (org.hibernate.HibernateException: null index column for collection):

What is this site?!

t (a professional software developer for a big company) writes about software development and stuff. Unix, Java, Groovy, OS X, and lots of open source libraries and tools.