Trouble creating symlinked folder - command-line

I am following the DrizzlexReact tutorial # https://truffleframework.com/tutorials/getting-started-with-drizzle-and-react
I've reached a point where I have to symlink my contract folder using the command: 'mklink \D contracts ....\build\contracts'.
When typed as is from the tutorial I get a "The syntax of the command is incorrect" error.
I've even tried quotes around the file names/paths. Nothing.
Any advice? Thanks

It was a '/D, as per mklink docs & not '\D', as per the tutorial.

Related

File not found error when using cyberduck CLI for OneDrive

I want to upload encrypted backups on OneDrive using cyberduck to avoid local copys. Having a local file called file.txt I want to upload in folder Backups from OneDrive root, I used this command:
duck --username <myUser> --password <myPassword> --upload onedrive://Backups .\file.txt
Transfer incomplete…
File not found. /. Please contact your web hosting service provider for assistance.
It's not even possible to get the directory content using duck --username <myUser> --password <myPassword> --listonedrive://Backups command. This also cause a File not found error.
What I'm doing wrong?
I exactly followed the documentation and have no clue why this is not working. Cyberduck was installed by using chocolately, current version is Cyberduck 6.6.2 (28219)
Just testing this out, it looks like OneDrive sets a unique identifier for the root folder. You can find that by either inspecting the value of the cid parameter in the URL of your OneDrive site or I found it by using the following command
duck --list OneDrive:///
Note, having three slashes is important. It would appear the first two are part of the protocol name and the first specifies you want the root. The result should look like a unique id of some sort like this: 36d25d24238f8242, which you can then use to upload your files like:
duck --upload onedrive://36d25d24238f8242/Backups .\file.txt
Didn't see any of that in the docs... just tinkering with it. So I might recommend opening a bug with duck to update their docs if this works for you.
What happens if you use the full path to the file, it looks like it is just complaining about not finding the file to uploads so could be you are in a different directory or something so it needs the full path to the source file.

Doxygen Search and Replace Output

I am working on generating a compiled help file (CHM) for using a C#-based API from IronPython.
In the output I have the type "Ironpython.Runtime.List" which won't make any sense to the Python users. I would like to change this to "PythonList" or something else.
Is there a simple way to do this?
Note - I am using doxygen 1.8.14 on Windows. Thanks!
Hmmm... well I solved it with the following batch file.
set hhc=C:\Program Files (x86)\HTML Help Workshop\hhc.exe
doxygen "%cd%\Doxyfile.cfg"
"%cd%\fnr.exe" --cl --find "IronPython.Runtime.List" --replace "List []" --dir "%cd%\html" --fileMask "*.html" --includeSubDirectories
"%hhc%" "%cd%\html\index.hhp"
fnr.exe is available from: http://http://findandreplace.io

Copying a CSV file to a table in PostgreSQL

I'm getting this error:
ERROR: syntax error at or near "\"
LINE 1: \COPY "Staging_Budget" FROM 'C:\Users\My.Name\Desktop\RD - F...
^
********** Error **********
when I try to execute this simple command:
\COPY "Staging_Budget" FROM 'C:\Users\My.Name\Desktop\RD - Facilities Management (001321).csv';
Can anyone tell me why that is?
Also, can anyone tell me why none of the examples online have the drive (C:) or the file type (.csv) listed in the filepath like I do?
Postgres version is 9.5 and my OS is Windows 7.
Thank you!
UPDATED:
I'm trying to run this statement instead:
COPY "Staging_Budget" FROM STDIN 'C:\Program Files (x86)\PostgreSQL\9.5\data\csv\RD - Facilities Management (001321).csv';
I read here that I needed to move the CSV file to the postgres CSV file directory. I didn't have one, so I created it in the filepath in the statement above. Now I get this error message:
ERROR: syntax error at or near "'C:\Program Files (x86)\PostgreSQL\9.5\data\csv\RD - Facilities Management (001321).csv'"
LINE 1: COPY "Staging_Budget" FROM STDIN 'C:\Program Files (x86)\Pos...
^
I don't understand why postgres doesn't like the apostrophe when it's given in every example I've found online and in the reference guide.
The problem is that you can either COPY "Staging_Budget" FROM STDIN or COPY "Staging_Budget" FROM 'C:\etc', but not both. Since you're on Windows, you can ignore everything people are saying about cat. You don't want to copy from STDIN, you want to copy from a file.
Also \copy and COPY are not the same thing. In your case it looks like you want COPY (no backslash), which is the source of your original error.
Note that you can only use 'COPY .. FROM' by referencing an external file whenever you're in the server. I mean, the file must be accessible to the postmaster instance.
One technique I always apply in Linux is 'COPY .. FROM STDIN', by issuing a cat before psql.
Take a look at the reference guide:
http://www.postgresql.org/docs/current/static/sql-copy.html
I was able to get this statement to work:
COPY "Staging_Budget" FROM 'C:\Program Files (x86)\PostgreSQL\9.5\data\csv\RD - Facilities Management (001321).csv' (DELIMITER ',');
I guess postgres had a problem with the apostrophe used with STDIN? Also, having the CSV file in a folder called CSV within the Data folder was needed. Lastly, I needed to make sure that "(DELIMITER ',')" was at the end of the statement - even though the reference guide says that a ',' is the default when using CSV files...I'm not sure why I had to explicitly state it as the delimiter.

postgreSQL COPY command error

Hallo everyone once again,
I did various searches but couldn't gind a suitable/applicable answer to the simple problem below:
On pgAdminIII (Windows 7 64-bit) I am running the following command using SQL editor:
COPY public.Raw20120113 FROM 'D:\my\path\to\Raw CSV Data\13_01_2012.csv';
I tried many different variations for the path name and verified the path, but I keep getting:
ERROR: could not open file "D:\my\path\to\Raw CSV Data\13_01_2012.csv" for reading: No such file or directory
Any suggestions why this happens?
Thank you all in advance
Petros
UPDATE!!
After some tests I came to the following conclusion: The reason I am getting this error is that the path includes some Greek characters. So, while Windows uses codepage 1253, the console is using 727 and this whole thing is causing the confusion. So, some questions arise, you may answer them if you like or prompt me to other questions?
1) How can I permanently change the codepageof the console?
2) How can I define the codepage is SQL editor?
Thank you again, and sorry if the place to post the question was inappropriate!
Try DIR "D:\my\path\to\Raw CSV Data\13_01_2012.csv" from command line and see if it works - just to ensure that you got the directory, file name, extension etc correct.
The problem is that COPY command runs on server so it takes the path to the file from the server's scope.
To use local file to import you need to use \COPY command. This takes local path to the file into account and loads it correctly.

How to use Google's Sparse Hash

In my project, I am asked to use Google's Sparse Hash. But I don't even know where to start. These are steps that I take and do not get my code even compiled:
The sparsehash-1.11 code is in the same directory with where my code is.
I typed "#include " at the beginning of my code.
The error is
Multiple markers at this line
- fatal error: google/sparse_hash_map: No such file or directory
- Unresolved inclusion: <google/sparse_hash_map>
I really don't know what to do. Waiting for your helps.
Sorry if this is obvious, but if your google hashmap source is already in the same directory as your code is, you should probably try:
#include "sparse_hash_map"
instead of
#include <google/sparse_hash_map>
Worse case, include -I</directory/to/google/sparse_hash_map> in your compile command line.
Good luck!
You could locate sparse_hash_set in your computer ( locate sparse_hash_set ) and create a symbolic link from the directory where sparse_hash_set is installed to google/sparse_hash_map.
test#ubuntu:~# updatedb # To update the locate database
test#ubuntu:~# locate sparse_hash_map
/usr/include/google/sparsehash/sparse_hash_map
test#ubuntu:~# ln -s /usr/include/google/sparsehash/sparse_hash_map /usr/include/google/sparse_hash_map