Clang_complete not worrking - clang

unfortunately I can't manage to make clang_complete work and I could need your help.
I've already compiled vim 7.4 with python support. Here is the output of vim --version | grep python:
+cryptv +linebreak +python/dyn +viminfo
-cscope +lispindent +python3/dyn +vreplace
I followed this guide: https://vtluug.org/wiki/Clang_Complete
Please note that I've started from a clean installation (i.e. no other plugins and no further entries in my .vimrc (except for those shown in the guide above)).
According to the tutorials I've seen so far everything should be working.
However, if I try to get code completion for the following example nothing happens. If I press <c-x><x-u> I receive the error "completefunc not set".
#include <string>
int main()
{
std::string s;
s.
}
Moreover, I've installed the newest version of clang from source and it in my $PATH.
Is there a way to verify that clang_complete is actually installed?
What might cause this problem?
Any help is much appreciated.

Add
filetype plugin indent on
to your vimrc, its missing from the vimrc snippet in the link. This tells vim to do filetype detection and fire autocommands related to those file types. Without it you won't run the following autocommands.
au FileType c,cpp,objc,objcpp call <SID>ClangCompleteInit()
au FileType c.*,cpp.*,objc.*,objcpp.* call <SID>ClangCompleteInit()
Which probably initalize ClangComplete.

Related

OperationalError: no such module: fts4

Hi I´ve tried to run a fuzzymatcher code and the error below pops up:
OperationalError: no such module: fts4
Any suggestions? Thanks in advance
Edit: I've already tried downloading the sqlite zip from the website and saving it in DLLs files but it still does not work. Do I have to activate it somehow?
I´m using Anaconda3 64 bit.
Thanks
Confirm that the DLL files have been added in the correct place; if you are using Windows it will be C:\ProgramData\Anaconda3\DLLs.
you can try to load the extensions:
import sqlite3
conn = sqlite3.connect(':memory:')
cur = conn.cursor()
conn.enable_load_extension(True)
for (val,) in cur.execute('pragma compile_options'):
print (val)
It will show some results similar to these:
COMPILER=msvc-1500
ENABLE_BYTECODE_VTAB
ENABLE_COLUMN_METADATA
ENABLE_DBSTAT_VTAB
ENABLE_FTS3
ENABLE_FTS4
ENABLE_FTS5
ENABLE_GEOPOLY
ENABLE_JSON1
ENABLE_RTREE
ENABLE_STMTVTAB
MAX_TRIGGER_DEPTH=100
TEMP_STORE=1
THREADSAFE=1
As mentioned by #Ahmed and #Jeremy in the previous answer,
Confirm that the DLL files have been added in the correct place
However, make sure that it is indeed the correct place. For example, if you're working in a virtual environment, the location is not C:\ProgramData\Anaconda3\DLLs.
Check where python is installed to find the correct place.
You can copy the downloaded sqlite files in C:\Users\ (usernamefolder)\anaconda3\DLLs and check for the enabled extensions using the following syntax in jupyter notebook.
import sqlite3
conn = sqlite3.connect(':memory:')
cur = conn.cursor()
conn.enable_load_extension(True)
for (val,) in cur.execute('pragma compile_options'):
print (val)
This will give the list of extensions which are enabled and FTS-4 will be one of them. In case you tried and it still hasn't been enabled you can uninstall and reinstall anaconda package and try repeating the procedure.
This is what worked for me
install this in anacoda prompt using the comand below
conda install -c conda-forge sqlite-fts4

How to transform gyb files into swift code

I'm reading the swift source code on github and I have noticed there are files with the extension gyb e.g. Swift github Integers.swift.gyb.
I did a bit of research and I think (correct me if i'm wrong) gyb is a preprocessor that the swift team wrote so that they dont have to write repetitive code e.g. dont have to write many different version of code for different int types, which only vary slight from each other.
But I dont really understand the python code in which the gyb files are written in. Is there any way that I can transform those gyb files into swift code? so it is possible study how swift e.g. Int type is implemented?
What you can do is:
Obtain the Swift source code, following the instructions at https://github.com/apple/swift.
Install the prerequisites for compiling the source code (cmake, ninja, ...)
Then compile the source code with the "verbose option":
cd swift-source/swift
utils/build-script --verbose
This shows all commands which are executed, including those to preprocess the .gyb
files. In particular you'll find something like
/usr/bin/python /path/to/swift-source/swift/utils/gyb -DunicodeGraphemeBreakPropertyFile=/path/to/swift-source/swift/utils/UnicodeData/GraphemeBreakProperty.txt -DunicodeGraphemeBreakTestFile=/path/to/swift-source/swift/utils/UnicodeData/GraphemeBreakTest.txt -DCMAKE_SIZEOF_VOID_P=8 -o /path/to/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/stdlib/public/core/8/Integers.swift.tmp Integers.swift.gyb && /opt/local/bin/cmake -E copy_if_different /path/to/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/stdlib/public/core/8/Integers.swift.tmp /path/to/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/stdlib/public/core/8/Integers.swift && /opt/local/bin/cmake -E remove /path/to/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/stdlib/public/core/8/Integers.swift.tmp
which shows that the Python script swift-source/swift/utils/gyb is called to
preprocess the Integers.swift.gyb file, and the result is copied to
/path/to/swift-source/build/Ninja-DebugAssert/swift-macosx-x86_64/stdlib/public/core/8/Integers.swift
You can also call the script yourself, using the above commands as a template:
cd swift-source/swift/stdlib/public/core
/usr/bin/python /path/to/swift-source/swift/utils/gyb \\
-DunicodeGraphemeBreakPropertyFile=/path/to/swift-source/swift/utils/UnicodeData/GraphemeBreakProperty.txt \\
-DunicodeGraphemeBreakTestFile=/path/to/swift-source/swift/utils/UnicodeData/GraphemeBreakTest.txt \\
-DCMAKE_SIZEOF_VOID_P=8 \\
-o Integers.swift.tmp Integers.swift.gyb

Error while generating make latexpdf with sphinx

I am currently using sphinx 1.4.9 for documents creation. While giving make latexpdf, I get the following error.
(/usr/share/texmf/tex/latex/upquote/upquote.sty)
(/usr/share/texmf/tex/latex/float/float.sty)
(/usr/share/texmf/tex/latex/graphics/graphicx.sty
(/usr/share/texmf/tex/latex/graphics/graphics.sty
(/usr/share/texmf/tex/latex/graphics/trig.sty)
(/usr/lib/texmf/tex/latex/config/graphics.cfg)))
(/usr/share/texmf/tex/plain/misc/pdfcolor.tex)
(/usr/share/texmf/tex/latex/hyperref/hyperref.sty
(/usr/share/texmf/tex/latex/hyperref/pd1enc.def)
(/usr/lib/texmf/tex/latex/config/hyperref.cfg)
(/usr/share/texmf/tex/latex/oberdiek/kvoptions.sty)
****! Package keyval Error: pdfencoding undefined.****
See the keyval package documentation for explanation.
I have searched for pdfencoding in the sphinx.egg, also it only appears in sphinx.sty.
but I don't know how to define this pdfencoding. whether to edit conf.py or how to do.
Your hyperref is outdated. Sphinx 1.4.x series was tested to work with Ubuntu Precise (Debian/TeXLive 2009). I can not try it but here is a hack which may help you out. However, perhaps other parts will fail as your TeX install is really old...
put
'passoptionstopackages' : """
\\let\\originalPassOptionsToPackage\\PassOptionsToPackage
\\makeatletter
\\def\\PassOptionsToPackage#1{%
\\def\\#tempa{#1}\\def\\#tempb{pdfencoding=unicode}%
\\ifx\\#tempa\\#tempb\\expandafter\\#gobbletwo
\\else\\expandafter\\originalPassOptionsToPackage\\fi {#1}}
\\makeatother
""",
inside the latex_elements configuration variable of conf.py. Could work ...

Emacs haskell-mode: "Searching for program: no such file or directory, ghci"

For some reason emacs is not able to find my ghci. I am running Ubuntu 16.04, and followed the instructions in this tutorial to the book.
Using which ghci I get the path /opt/ghc/7.10.3/bin/ghci. And executing M-: exec-path and M-: (getenv "PATH") I can see that path correctly printed.
I have tried to explicitly set the PATH variable in emacs like this, which changes nothing since as far as I could tell it was already there. From this answer.
(setenv "PATH" "/usr/local/bin:/usr/bin:/bin:/opt/cabal/1.22/bin/cabal:/opt/ghc/7.10.3/bin/ghci")
(setq exec-path (split-string (getenv "PATH") path-separator)
The same thing happens when I use
(custom-set-variables '(haskell-process-type 'cabal-repl)) namely the error: "Searching for program: no such file or directory, cabal"
I would greatly appreciate help. :) I have no idea what to do, and I haven't found any answers on the internet.
The issue was that I was adding the path to the actual executable, rather than the folder in which the executable sits.
So:
/opt/cabal/1.22/bin/cabal
should be
/opt/cabal/1.22/bin/
and:
/opt/ghc/7.10.3/bin/ghci
should be
/opt/ghc/7.10.3/bin/

Spanish chracter and some spaceial chracter not allowed in Imagmagick

Spanish chracter and some spaceial chracter not allowed in Imagmagick when creating images from pdf.
There is showing error message "no decode delegate for this image".
Can i ignore that text while creating images from pdf.
Any solution for this?
Thanks!
Try running the following:
convert -list configure | grep -i "DELEGATES"
What does that mean?
**convert -list configure** - displays your imagemagick configuration
**grep -i "DELEGATES"** - takes the results from above and does a case insensitive search for what you're looking for, in this case, you're looking for the section marked DELEGATES
This should return all of the packages that you need in order to run your command.
Using your favorite package manage ( apt, yum,brew, etc ), install those packages ( including their development packages ), then try again.
Here is a thread you can check out, where someone had a very similar issue:
http://www.imagemagick.org/discourse-server/viewtopic.php?t=22488
Hope this helps!

Resources