Orgmode exporting table to csv throws error - emacs

I have this code which used to work with org-table-export, but now It throws an error message at me:
'No such transformation function csv'
#+PROPERTY: table_export_file filename.csv
#+PROPERTY: TABLE_EXPORT_FORMAT csv
| 1 | 2 |
| a | b |
What could be wrong? I'm on Org 8.3.4 with ubuntu 16.04.

I figured it out by trying to change the default value for the variable with M-x customize variable RET org-table-export-.. (Tab completion), which showed me that I had apparently set it wrong to start with; my property should have looked the following way:
#+PROPERTY: TABLE_EXPORT_FORMAT orgtbl-to-csv
Mystery solved.

Related

Can't import a CSV file into PostgreSQL

Summary
I failed to import CSV files into a table on PostgreSQL.
Even though it says that the import was successfully completed, there's no rows created.
How did this happen, and how can I fix this? Thank you.
Details
1. The CSV file I (failed to) imported, is like this 1. CSV file imported
| number | ticket | category | question | answer | url | note |
|--------|------------|-----------|--------------------------|-----------------------|----------------|----------|
| 1 | #0000000 | Temp>123 | *confirming* | Would you...? | https:///....a | - |
| 2 | #1234567 | AAA / BBB | "a" vs "b" | If A, "a". If B, "b". | https:///....b | #0000000 |
| 3 | #1234567-2 | AAA>abc | Can we do sth using "a"? | Yes, blah blah blah. | https:///....b | - |
And this is the table on PostgreSQL
numberr : numeric
ticketr : char
category : char[]
question : char
answer : char
url : char
note : char
2.\ The message after the import
Even though it says that the import was "successfully completed"
When I hit “More details” of the import pop up (3. Message - Completed)
--command " "\\copy public.test (\"number\", ticket, category, question, answer, url, note) FROM '/Users/alice/Desktop/test.csv' DELIMITER ',' CSV HEADER ENCODING 'UTF8' QUOTE '\"' ESCAPE '''';""
3. The message when I made sure that the file was actually imported
When I click "Count Rows", it says "Table rows counted: 0"
I tried the following script in Query Tool of the table, and it shows no rows created
SELECT * FROM (table name)
For references
Created Postgres Log, but only the header is created.
Screenshot
4. No row created / 1. CSV file imported / 2. Import Preference / 3. Message - Completed / 5. postgres_log
After changing the name of a column from "number" to "consecutive", the error message showed up in Query Tool (not in Import/Export)
Tried Query Tool instead of Import/Emport
--> the situation didn’t change
Changed the first column name from “number” to “constructive” in both csv and psql table
--> the situation didn’t change
Tried Query Tool
copy public.test (consecutive, ticket, category, question, answer, url, note) FROM '/Users/alice/Desktop/test5.csv' DELIMITER ',' CSV HEADER ENCODING 'UTF8' QUOTE '"' ESCAPE '''';""
--> the situation didn’t change
Tried Query Tool
copy public.test (consecutive, ticket, category, question, answer, url, note) FROM '/Users/alice/Desktop/test5.csv' DELIMITER ',' CSV HEADER ENCODING 'UTF8'
—>got error message
ERROR: could not open file "/Users/alice/Desktop/test5.csv" for reading: Permission denied
HINT: COPY FROM instructs the PostgreSQL server process to read a file. You may want a client-side facility such as psql's \copy.
SQL state: 42501
check columns settings in tab at 2. Import Preference image
right from options tab
there you should set columns order as in your file
also check more details at 3. Message - Cpmpleted
This is a file permission issue.
Open a shell terminal, go to the directory where the data file is stored, and run chmod +rx * and retry loading the data file into your DB.

VS Code Extension Settings CLI

I want to create an automated script for setting up VS Code.
Part of this is the installation of the extensions and configuring them as necessary.
So I was able to install the extensions via CLI, but can't find how to change the extension settings by only using the command line.
For example - I want to change Jest Runner settings. I found this on their readme:
Jest Runner will work out of the box, with a valid Jest config.
If you have a custom setup use the following options to configure Jest Runner:
| Command | Description |
| --- | --- |
| jestrunner.configPath | Jest config path (relative to ${workFolder} e.g. jest-config.json) |
| jestrunner.jestPath | Absolute path to jest bin file (e.g. /usr/lib/node_modules/jest/bin/jest.js) |
| jestrunner.debugOptions | Add or overwrite vscode debug configurations (only in debug mode) (e.g. `"jestrunner.debugOptions": { "args": ["--no-cache"] }`) |
| jestrunner.runOptions | Add CLI Options to the Jest Command (e.g. `"jestrunner.runOptions": ["--coverage", "--colors"]`) https://jestjs.io/docs/en/cli |
| jestrunner.jestCommand | Define an alternative Jest command (e.g. for Create React App and similar abstractions) |
| jestrunner.disableCodeLens | Disable CodeLens feature
| jestrunner.codeLensSelector | CodeLens will be shown on files matching this pattern (default **/*.{test,spec}.{js,jsx,ts,tsx})
But don't know how to access it via cmd.
Any thoughts on how to do this?
Thanks!
Was able to find a solution now.
So it turns out that the settings are actually stored in:
<userFolder>\AppData\Roaming\Code\User\Settings.json
From there I can open up the json file and add in the commands as specified by the extension's readme.

Auto reload file and in neovim and auto reload nerbtree

I'm using neovim for coding C++. I have some trouble when coding with it.
I often use file to read and write data. When I run C++ file by command g++ -o data data.cpp && ./data, output file don't reload in neovim.
I try use
set autoread
au CursorHold * checktime
but it doesn't work.
I don't want to type :e to reload everytime I run code
Additionally, I want to know how to set auto reload nerbtreee when I create new file or folder on Explorer.
Environment:
nvim: 0.4.3
Ubuntu 18.04 LTS
I solved it.
Thanks for spacetime-continuum on Reddit
This is how I configure for this problem:
" trigger `autoread` when files changes on disk
set autoread
autocmd FocusGained,BufEnter,CursorHold,CursorHoldI * if mode() != 'c' | checktime | endif
" notification after file change
autocmd FileChangedShellPost *
\ echohl WarningMsg | echo "File changed on disk. Buffer reloaded." | echohl None
Here is how I auto-read buffers using lua Config
vim.o.autoread = true
vim.api.nvim_create_autocmd({ "BufEnter", "CursorHold", "CursorHoldI", "FocusGained" }, {
command = "if mode() != 'c' | checktime | endif",
pattern = { "*" },
})

OrientDB: Cannot find a command executor for the command request: sql.MOVE VERTEX

I am using orientdb community edition 1.7.9 on mac osx.
Database Info:
DISTRIBUTED CONFIGURATION: none (OrientDB is running in standalone
mode)
DATABASE PROPERTIES
NAME | VALUE|
Name | null |
Version | 9 |
Date format | yyyy-MM-dd |
Datetime format | yyyy-MM-dd HH:mm:ss |
Timezone | Asia/xxxx |
Locale Country | US |
Locale Language | en |
Charset | UTF-8 |
Schema RID | #0:1 |
Index Manager RID | #0:2 |
Dictionary RID | null |
Command flow:
create cluster xyz physical default default append
alter class me add cluster xyz
move vertex #1:2 to cluster:xyz
Studio UI throw the following error:
014-10-22 14:59:33:043 SEVE Internal server error:
com.orientechnologies.orient.core.command.OCommandExecutorNotFoundException:
Cannot find a command executor for the command request: sql.MOVE
VERTEX #1:2 TO CLUSTER:xyz [ONetworkProtocolHttpDb]
Console return a record as select does. I do not see error in the log.
I am planning a critical feature by using altering cluster for selected records.
Could anyone help on this regard?
Thanks in advance.
Cheers
move vertex command is not supported in 1.7.x
you have to use switch to 2.0-M2
The OrientDB Console is a Java Application made to work against OrientDB databases and Server instances.
more

Emacs source code navigation features

I am working on a large c++ project. I am working with emacs for the last six months.
I have try to configure CEDET so as to be able to navigate easily but i have found some problems.
1.- Sometimes semantic does not find some symbols and sometimes he don't ... i do not know clearly which files is semantic indexing.
I have tried to use EDE (following the instructions in this paper http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html), but i have found some problems also...
I have multiple version ( Releases) of the same project, each one in its own folder. How can i tell emacs which project i am working with?
How can i tell ede where to look for my header files? Can I specify just a root directory and semantic will search for header files in all the subdirectories?
2.- I was working with vim+cscope some time ago and i remember there was a way to navigate back in the stack of symbols (Ctrl-t). Is there anything like this in emacs?
P.D.> Some data to make the question more clear.
I have multiple releases of the same project.
Each one has its own root directory.
Each project has multiple modules each one inside a subdirectory.
There are headers file in each module.
/home/user/
|
\Release-001
| |
| \makefile
| \ Module-001
| | |
| | \makefile
| | \subdir-001
| | | \header-001.h
| | | \header-002.h
| | \subdir-002
| | | \header-003.h
| \ Module-002
| | |
| | \makefile
| | \subdir-003
| | | \header-004.h
| | | \header-005.h
| | \subdir-004
| | | \header-006.h
|
\Release-002
| |
| \makefile
| \ Module-001
| | |
| | \makefile
| | \subdir-001
| | | \header-001.h
| | | \header-002.h
| | \subdir-002
| | | \header-003.h
| \ Module-002
| | |
| | \makefile
| | \subdir-003
| | | \header-004.h
| | | \header-005.h
| | \subdir-004
| | | \header-006.h
This is the configuration about EDE i have in my .emacs
;; Cedet load commands
(add-to-list 'load-path "~/emacs-dir/cedet/cedet")
(load-file "~/emacs-dir/cedet/cedet/common/cedet.el")
;; EDE: activating mode.
(global-ede-mode t)
;; Projects definition
(ede-cpp-root-project "Release-001"
:name "Release-001"
:file "~/Release-001/makefile"
:include-path '("/"
)
:system-include-path '("~/exp/include")
:spp-table '(("SUSE9" . "")
)
)
(ede-cpp-root-project "Release-002"
:name "Release-002"
:file "~/Release-002/makefile"
:include-path '("/"
)
:system-include-path '("~/exp/include")
:spp-table '(("SUSE9" . "")
)
)
Just to let you know ... I am working with the console version ( -nw) of emacs.
Your configuration is basically correct, except for the :include-path for your projects.
If a given source file says:
#include "Module-001/subdir-002/header-003.h"
then it is ok. If the include says:
#include "subdir-002/header-003.h"
then your :include-path should have
:include-path '("/Module-001" )
in it.
As for which things does semantic index, it will index your current file, and all includes it can find. Use the semantic-decoration mode to see which headers EDE has found for you to determine if your configuration is accurate.
It will also index all files in the same directory as the one you are editing, but only in idle time, so if you don't let Emacs be idle, it won't get around to it.
You can speed the indexing operations up if you use CScope as Bozhidar suggests. You can then enable the CScope support in both EDE and the Semantic database. The inclusion of CScope support in Semantic DB is recent, however, so you would need the CVS version of CEDET. That would make sure the whole thing was indexed.
To navigate backward, investigate the help for semantic-mru-bookmark-mode. This tracks your progress through your files on a named location basis that is quite handy and always works.
I had used in the past the Emacs Code Browser when working on C++ projects and I found it very satisfactory - in a addition to great files and code structure navigation you get excellent VCS integration(different icons according to current state of a file in the project). In conjunction with ECB I used cscope for Emacs, since you mentioned in for vim, you'll probably want to use it in Emacs as well.
Alternatively if you want a simpler solution you might have a look at Emacs Nav. It supports some fancy stuff as well and has no dependency to semantic and speedbar - you'll only have to use etags/ctags to index your project.