how to enable neocomplcache quick match? - vim-plugin

I don't know how to enable quick match in the neocomplcache vim plugin. I put
let g:neocomplcache_enable_quick_match = 1
in my .vimrc, but it's useless. When I press - nothing happens.

According to the help file, there is no quick fix feature anymore. You need to use unite for that:
A: Quick match feature had been removed in latest neocomplcache
because quick match turned into hard to implement.
But you can use |unite.vim| instead to use quick match.
imap <expr> - pumvisible() ?
\ "\<Plug>(neocomplcache_start_unite_quick_match)" : '-'

Related

Formatting SQL Query Inside an IPython/Jupyter Notebook

I want to show some SQL queries inside a notebook. I neither need nor want them to run. I'd just like them to be well formatted. At the very least I want them to be indented properly with new lines, though keyword highlighting would be nice too. Does a solution for this exist already?
If you set the cell as Markdown one you can write the sql query as code specifying the language (e.g. mysql)
``` mysql
SELECT *
FROM table_a AS a
LIMIT 10;
```
This produces:
It highlights the keywords. Unfortunately, it doesn't seem to deal with indentation which seems to be the main issue you are trying to deal with but maybe this helps.
If you - like me - find yourself here because you want to highlight (and run) the %%sql magic, you're best of with the technique of this answer. Posting it here cause it took me quite some time before I found the correct keywords to my answer :)
require(['notebook/js/codecell'], function(codecell) {
codecell.CodeCell.options_default.highlight_modes['magic_text/x-mssql'] = {'reg':[/^%%sql/]} ;
Jupyter.notebook.events.one('kernel_ready.Kernel', function(){
Jupyter.notebook.get_cells().map(function(cell){
if (cell.cell_type == 'code'){ cell.auto_highlight(); } }) ;
});
});
I found that this fixed the issue I was having.
``` sql
Produced styled code in edit mode but not when the cell was run.
``` mysql
Produced correct styling

How to comment script in Datamapper Mule

I have a XML to XML mapping in DataMapper. Obviously soon after mapping done script will be present. How to I comment any line in script( Example here output.status line).
I have tried like this // but not seems to be commented.But could see by default Mule commented //MEL.
//MEL
//START -> DO NOT REMOVE
output.__id = input.__id;
//END -> DO NOT REMOVE
output.vendorReference = input.Ref;
output.status = input.overallStatus;
We know can remove the mapping or delete in script. But is there a any way we can comment it. Please suggest. Thanks in advance.
I could not understand why you want to comment the output status line.
Generally the scripting will allow // for commenting. In case of any filtering to be done then there are many features supported by MULE. Can you please elaborate your requirement so that we can help better.
http://blogs.mulesoft.com/7-things-you-didn%E2%80%99t-know-about-datamapper/
https://developer.mulesoft.com/docs/display/current/Datamapper+User+Guide+and+Reference#DatamapperUserGuideandReference-Examples

Elasticsearch search analyzer

I am playing with indexing an articlenumber in Elasticsearch.
Here i provide a working example:
https://found.no/play/gist/557202b3542be157d813
i dont understand why i get a different score if i change the value for "product_number.search"
if i change the value from "ak454" to "ak 454" the score changes.
i thought that if i am using a search_analyzer the value "ak 454" will be transformed to "ak454" (its mapped using the searchable_id).
you can also look at the analyses tab to see my tokenizer:
https://found.no/play/gist/557202b3542be157d813#analysis
thanks.
The term-query (and filter) does not do any text analysis.
The match-query does, and can achieve what you want.
I adapted the example: https://found.no/play/gist/2de967d844c5fbc14d2f
Setting explain to true is very useful when working with problems like this, as you see exactly what Lucene is doing when it's scoring.

Every velocity tool escape function working except url()?

I can get $esc.html to work, but not $esc.url, it just comes up literal even though I follow example at: http://velocity.apache.org/tools/devel/generic/EscapeTool.html
Interestingly enough, on that page the url() section's head is "$attrib.name" instead of url().
Any ideas?
Thanks.
Worked for me in Tools 2.0. Maybe you have old version?
$esc.url("bread & butter") = bread+%26+butter

Lucene Jackrabbit

Recently we have added Lucene(2.4.1) support to our application which worked with Jackrabbit(1.6.2). We have done all like it was described in jackrabbit tutorial. And all works almost fine. But I noticed some strange behavior and can't find any docs about it. I decided to ask you about it.
For example: I have following text in Node(jcr:content) in jcr:data property
The quick brown fox jumps over the lazy dog
!##$%^&
travmik!
tra!vmik
My XPath query is the following:
String query = "root/element(*,my:documentBody)
[jcr:contains(*/*/element(*),'*" + param +"*')]";
Then I try to search:
"q", "qu", "qui", "quic", "quick", "k", "ck", "ick", "uick", "quick brown fox", "quick fox", "tra", "travmik", "mik" - all found ok
"tra!vmik", "travmik!", "!##$" - nothing
And, yes I escaped all special characters from this.
What did I do wrong?
P.s. I have one more question - in Lucene docs says that "You cannot use a * or ? symbol as the first character of a search", but I use and it works. Why?
I found the problem. It was some misunderstanding with Extractors which are used in jackrabbit for indexing content. I don't want to go into details, but can say that this piece of code from one of Extractors is the cause of all my problems:
if (!Character.isLetterOrDigit(c)) {
if (!space) {
space = true;
buffer.append(' ');
continue;
}
continue;
}
If someone is interested in this - I can explain in greater detail.