Tech and travel

Posts

Highlight the current line in Vim

2007-08-15

To highlight the current line in Vim, you have to set the cursorline setting. :set cursorline :set cul These two are the same. This can also be set in your _vimrc file, you don’t need the colon then. Here’s an extract from my vimrc file: set cursorline set nowrap set ic " Ignore case set ai " autoindent set tabstop=4 set shiftwidth=4 set expandtab set cul " Cursor highlight map <f1> ^hhxxj0 map <f2> ^i <esc>j0 The last 2 entries add mappings for F1 and F2, to dedent and indent the current line.

Substituting from this line to the end of the file (in Vim)

2007-08-07

In vim, if you want to change something from the current line until the end of the line, you can use .,$ as the range segment of the s command. :.,$s/COMPILE/COMPILE BODY/g Substituting over the full file is done by using the % range, which is a shortcut for 1,$, ie from the first to the last line. :%s/COMPILE/COMPILE BODY/g

Selecting random rows

2007-08-01

If you want to select random rows from a table, you can order the rows using the dbms_random.value function : SELECT column FROM table ORDER BY dbms_random.value To get 20 random rows from the table, we can add a condition on rownum. This selects the first 20 rows : SELECT column FROM ( SELECT column FROM table ORDER BY dbms_random.value ) WHERE rownum < 21 With thanks to this site.

Recompiling database objects

2007-07-26

The DBMS_UTILITY package has a function called compile_schema that compiles all procedures, functions, packages, and triggers. EXEC DBMS_UTILITY.compile_schema(schema => 'SCOTT'); You can also use the UTL_RECOMP package, but I haven’t tried that one yet. With thanks to this ORACLE-BASE article.

Jerusalem

2007-07-23

A day trip to Jerusalem while in Israel for work is a no-brainer.

View of the city walls

View of the city walls

Copyright (c) 2025 Michel Hollands