Editing functions with psql [closed] - postgresql

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
When using \ef <function_name> to edit a function with psql, it puts the modified function (which can be over 100 lines in some cases) into the query buffer to execute. Works great! But, then when I up-arrow to scroll through history, the whole function pops back up, and in a couple of cases is longer than the terminal window and it's kind of mess. Is there anyway to keep the actual "create or replace function" out of history?
Just an annoyance here, but it really bugs me, and I'm obviously either the only one or I can't figure out the right Google search for how to fix. :\
note: I do understand that I can go into the .psql_history file and manually remove the entries. It would just be nice to not have to do this.

No there is not possibility to filter history in psql - and what I know, there is no plan to change it.
Sorry for offtopic - write only adhoc function in psql. Don't use psql or pgAdmin for writing plpgsql functions. These tools has this functionality, and it is not bad, but much more preferable way is writing to file (mainly for nontrivial functions) - use your favourite editor and import this file to Postgres.
files can be simply versioned - use Git, ...
code in files can be logically modularized
code in files can be much richer commented
use "make", "Makefile" for import
with git or other similar tool - code can be simply shared in team - anybody can know who and what did in code.

Related

How do I restore deleted code inside a file? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 12 months ago.
Improve this question
I'm using autosave in vscode and I accidently deleted important code and I can't restore it anymore even using CTRL + Z
Is there any solution to restore the lost code?
If it is no longer possible with CTRL + Z and you have not initiated a version software for your project, it is no longer possible to reconstruct the code.
An unlikely case would be if you have not yet saved the file you have edited, the original code would at least still be contained in the file. But I guess that's not the topic here because you use autosave.
Is your project perhaps under version control? If yes, you could grab the missing code from the previous state of the project. If not, I suggest you look into code version control systems, mainly git (https://en.wikipedia.org/wiki/Git), it will prevent similar situations from arising in the future, plus it enables multiple people to work on the same code.

I have a problem with the cursor in visual studio code [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I have a problem probably totaly beginners level but anyway it drives me crazy so please help.
I can´t edit any code in the program when i try it looks like i´m in "insert" mode with like a block cursor.
I can´t delete anything or write anything. What could it be? and how do i fix it?
I am on a macbook pro.
I believe the reason is that you installed vim extension in vscode by mistake as it puts you in the insert mode by default until you press (i) to edit text. uninstall vim extension and things should go back to normal. or refer to this vim cheatsheet for more information about using vim as a text editor.

What is the most safe way to protect Word document from editing and copying [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 10 months ago.
Improve this question
I need to protect my Microsoft Word document against text copying.
I have found a solution in restricting the permissions described here.
Instead of "No Changes (Read only)", I use "Filling in forms" and then insert the password.
My question is: is this way really safe? Can't someone hack my password?
PS: I have read that it is possible to save the document as HTML and then to find the hex version of pass in the code of the document. But I myself couldn't decrypt it.
As long as anybody can read it, there's no way you can prevent people from copying and pasting it in another file with a 100% success.
Even if selection is disabled, you would still need to deal with the analog hole. In layman's terms, there's nothing you can do to prevent people from, for example, printing it then OCRing it to a new Word document, getting an editable version that way.
That said, you're probably better exporting to PDF if you want to prevent most people from editing them.
I agree completely with what Marcos says. However there is a more secure way than using forms protection (which is in no way secure!) to prevent copying from within the Word application interface. Look up the term "Information Rights Management" in connection with the version of Office you're using.

Is it a good idea to put your hard drive under version control [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I am thinking of putting all my files under version control in order to be able to reset old files.
I will commit Every day or so adding or removing the changes that I did to the physical drive.
Are there any drawbacks to this? Will it be too space consuming?
Edit: I am thinking about branching capabilities.
Example: I have a branch with media, a branch with source code, a branch including personal files I wouldn't like to be accessible to every user of my PC, etc..
This would depend on what you have on your HDD. If you have your OS on it, then most likely not. OSes tend to create a lot of temporary files; your .git will be extremely big. Furthermore, applications also generate a lot of junk, which would be completely useless to put under version control.
But if this is a secondary HDD, and you don't have a lot of files constantly changing, then perhaps. Again for the same reason as above, your git diffs would be extremely large. Even though git compresses diffs, it would be almost as large if not more than your actual data (over time). Git isn't designed to be a backup system. Then there is also the concern of security depending where you hope to store your git repo. Making your system files publicly accessible is probably not a very good idea.
If you want something close to version-control, at my last workplace we used Crash Plan. Its pretty great. But there is a lot of similar options out there.

How to enable parallel PDF export in emacs org-mode [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Recently I start to write a long article using org-mode. My article contains pounds of images, tables and code. So when I import my org file to pdf, the emacs will freeze for more than one minute to produce the pdf file. However in my opinion, I would like to continue to write or correct my article during the exporting.
So here is the question, can emacs parallelly process the exports with multiple thread or multiple processors?
Of course you can, it's emacs!
(info "(org) The export dispatcher")
‘C-a’
Toggle asynchronous export. Asynchronous export uses an external
Emacs process that is configured with a specified initialization
file.
While exporting asynchronously, the output is not displayed. It is
stored in a list called “the export stack”, and can be viewed from
there. The stack can be reached by calling the dispatcher with a
double ‘C-u’ prefix argument, or with ‘&’ key from the dispatcher.
To make this behavior the default, customize the variable
‘org-export-in-background’.
So, you can export asynchronously to PDF like this: C-eC-alp.