Getting OS X Terminal to behave

1 Comment

Last time I didn't write this down and this time I'm blogging about it so I don't forget it. OSX Hints has a good guide on how to set Terminal.app to work the way God Intended (great command line user that He is).

I am handy around the Terminal.app, but for me the main thing that I kept forgetting (and hurts me a lot since my muscle memory depends on it) is moving forward and backwards full word:

"\e[5C": forward-word
"\e[5D": backward-word

By the way, have I mentioned I no longer have to use PCs? Woot!

Update: Here is another guide you may want to take a look at. And another

technorati tags:, ,

Using Hibernate Validators with Spring and Hibernate

No Comments

In this article, Ted Bergeron shows you how to use the Validator component of Hibernate Annotations to build and maintain validation logic easily in your Web apps.

Hibernate can meet your validation needs

technorati tags:,

Editando código HTML en idiomas con marcas diacríticas

2 Comments

Como muchas personas de habla hispana, muchas veces me veo en la necesidad de editar código
HTML en idiomas con marcas diacríticas (como el Español). Mi esquema de teclado soporta
marcas diacríticas, pero dejar estas marcas en el código fuente
del HTML es un problema porque a veces los navegadores (o los programas de
manejo de contenido) tienen un código de página distinto al que
se utilizó para leer el archivo originalmente, lo cual hace a las marcas
diacríticas verse espantosas. Y tener que recordar los códigos de cada
letra acentuada rompe el tren de pensamiento.

Este artículo ayuda a solucionar este problema mediante macros que convierten tus caracteres diacríticos a entidades HTML.

More

Mac Tip: Avoiding .ds_store creation on your network drives

No Comments

From this item at macosxhints - Prevent .ds_store creation across multiple user accounts

it turns out its fairly easy to configure an OS X client to apply the setting for any user who logs in.You just need to run this command...

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

...under a single account, then copy the created plist to /Library/Prefrences.


The article also has other ways of going about this, including vetoing files on the samba share directly (clever!)

One-to-One relationships with Rails

1 Comment

This is a lot easier than I thought it would be and it actually took me longer than it should have because I was trying to do it manually.

More

Ant script for UMLGraph – separate packages and details views

No Comments

Here's how to call UMLGraph from ant.. Also, the documentation mentions Multiple Views, but it provides a makefile. Seeing that most java users use ant instead, I went ahead and incorporated this as well.

More

Using Jobs API and asyncExec

No Comments

Using the Jobs API (Job and IProgressMonitor) you can implement code that will run in a thread and update the standard Eclipse progress monitoring service as you go along in your thread.

To create a job, extend from org.eclipse.core.runtime.Job and implement the run method:

 
 
protected IStatus run(IProgressMonitor monitor) {
  int steps = 100000;
  monitor.beginTask("My Task", steps);
  for ( int i=0; i<steps ; i++ ) {
    monitor.subTask("Step "+i);
    monitor.worked(i);
    if ( monitor.isCanceled() ) break;
  }
  inputForTableViewer = Arrays.asList(new String[] {"One",
             "Two", "Three"});
  return Status.OK_STATUS;
}
 

To activate the job in MyClass (say it's a page with a tableViewer which we use to set the input), you do the following:

 
MySampleJob myJob = new MySampleJob();
myJob .addJobChangeListener(new JobChangeAdapter() {
  public void done(IJobChangeEvent event) {
    Display.getDefault().asyncExec(new Runnable() {
      public void run() {
        MyClass.this.tableViewer.
                        setInput(myJob .getInputForTableViewer());
      }
    });
  }
});
myJob.schedule();
 

Have fun!

Retrieving random lines from a file

Comments Off

A little class to retrieve a random line from a file.
More

Oracle tuning: Using Hints

Comments Off

Every once in a while you will get a query that no matter what you try, it doesn't use the indices. This is typically because the cost-based optimizer decides that an approach that is slower has a total cost that is lower than using the index and making it faster.

To solve this, you would use a hint. You can find an article on how to do this on dbasupport. But the basics are: More

Oracle tuning: Using explain plan

Comments Off

In order to make queries run faster, you should try to have oracle explain to you how the query should be performed.

The whole explanation for oracle tuning can be found on the Oracle Tuning guide, but here are the basics. More

Older Entries