Users mess with Clion - windows-10

I have a problem with Clion:
I was using an administrator account (X) on my pc, and then I create a new account (Y) and gave it administrator power, too.
I am using the Y account and saving my projects in
**C:\Users\Y\ClionProjects\**
but every file I create is generated in
**C:\Users\X\.CLion2016.2\system\cmake\generated\**
and in the first line of the .h or .cpp appears the comment
*"Created by X the dd/mm/yyyy"*
When I run the program, in the run tab it says the documents belong to a directory into X user.
I looked for some option to modify the path or the creator name (i found a question on stackflow where they suggest to press Alt+Enter with the cursor on the comment but it doesn't work for my version).
I unistalled Clion, deleted .CLion2016.2 in X user and then installed again the program.
Now it compiles with the right path but it still writes the "created by X" stuff
and doing some actions requires me to create again the .CLion2016.2
I hope to have explain the problem crearly
Thanks a lot for your help

Related

IntelliJ Project Tool Window Shows Different Folders Than Before

Say my current project is called project_x. Normally, in the Project ToolWindow the outermost directory displayed would be the directory project_x, alongside things such as External Libraries. Kind of the default, as one would expect.
However, IntelliJ displayed a message that I cannot exactly remember, but which said something like "an external change has occured". It then asked me whether to rebuild the current project, and I did.
Problem: now, the outermost directory displayed is my User folder, i.e.: Username [project_x] -> IdeaProjects -> project_x
I find this annoying, and would like to know how to revert back to the default settings. Help would be appreciated.
What it currently looks like (it contains my entire user-dir):
What it should look like (ignore the theme):
Edit: Well, while it did work for the above project, it did not work for the other one (made matters worse tbh). So this probably is not a solution in general.
Ok, I figured it out.
I noticed that the blue square next to a directory means that it's the source root. (Both my users directory and my actual project directory had such a blue square, the former obviously not wanted...).
So I did some googling on how to remove such a source root. I didn't find the right answer, but got close enough to figure it out on my own (no idea if I caused any damage to my project though):
Go to File -> Project Structure -> Modules
After looking around I noticed that on the left side I had two modules, one of them having my users directory as source root. I deleted that one, which solved my problem.
I'd still appreciate it if somebody could explain to me why this happened, and how to avoid this in the future, because in the time between asking and answering this question, it has happened to me again...

Android Studio: 'sudo' is not recognized as an internal or external command, operable program or batch file

As a possible solution to my Android Studio "could not expand zip" problem, I would like to run this command from the Terminal window in Android Studio:
sudo chmod -R 777 /your/project/path
However, when I try it, I get this error:
'sudo' is not recognized as an internal or external command, operable
program or batch file.
How to solve? (I am running Android Studio 2.1.2 on Windows 7.)
sudo is a *nix utility, not something you'll find on Windows. Ditto chmod.
With that said, the command in question is just adjusting privileges on the project folder using a simple bitmask. From the chmod man page:
-R, --recursive change files and directories recursively
Numeric mode:
From one to four octal digits
Any omitted digits are assumed to be leading zeros.
The first digit = selects attributes for the set user ID (4) and set group ID (2) and save text image (1)S
The second digit = permissions for the user who owns the file: read (4), write (2), and execute (1)
The third digit = permissions for other users in the file's group: read (4), write (2), and execute (1)
The fourth digit = permissions for other users NOT in the file's group: read (4), write (2), and execute (1)
The octal (0-7) value is calculated by adding up the values for each digit
In your command, the first digit is missing so is assumed to be 0. The second, third and fourth are 7, which translates into read/write/execute access for the directory owner, anyone else in the file's group, and anyone else not in the file's group. The -R switch recursively applies those privileges to every file and folder within /your/project/path.
On Windows, the equivalent command is within Explorer. Navigate to /your/project (not /your/project/path) and right-click /path. Choose Properties and a properties dialog will appear. Switch to the Security tab within that dialog.
From here, there are a few ways you could do this. You could simply click your user account from the Group or user names list, hit the Edit button at the bottom of the list, and give yourself any missing privileges.
For a more thorough privilege adjustment, including the recursion your sudo command gives you, choose Advanced instead of Edit. A new dialog, Advanced Security Settings for /path, will appear. Press Change Permissions. The same dialog will reappear, but Change Permissions will be replaced by an Add button and an Edit button. At the bottom, there will be a checkbox labeled Replace all child object permissions with inheritable permissions from this object. Make sure that's checked - that's the -R. Now select your username from the list and choose Edit. Check every checkbox and hit OK. Keep hitting OK all the way back out of the dialogs. With any luck that will be enough to solve your permissions problem.
If you'd like a simpler fix, just run Android Studio as admin, as suggested by the accepted answer in your question. That's somewhat less likely to break things than manually adjusting permissions and is usually enough to work around permissions-related issues in the first place.
Also worth noting, the accepted answer suggests making sure you have write permissions on the android-sdk and Android Studio directories. Only the sudo answer suggests tweaking privileges on /your/project/path. For the sake of the answer I have focused on the Windows equivalent of the command you asked about; you may want to do similar privilege adjustment on android-sdk and Android Studio rather than just /your/project/path.
Finally, be sure android-sdk isn't installed in %PROGRAMFILES%, as write access can be a problem there:
Click Start > All Programs > Accessories , right-click Notepad , and click Run as administrator . For protection against malware, Windows 7 doesn't allow normal processes to change files in the Program Files folder.
Android Studio can safely be installed there, but android-sdk cannot.

Error on using Vim-latex ("can't find file ~")

I'm not sure if this question is appropriate here but I have nowhere else to ask. I recently started to typeset some 'mathsy' stuff using Latex and it became a hobby for me. I've been using TeXnicCenter for this, but feeling that I've got familiar with Latex language, I decieded to improve 'efficiency' of typesetting by changing the editor.
So I decided to use Vim (latest version, 7.4) with Suite-Latex. I've just installed Vim and Suite-Latex, following exactly what was instructed here. I made every necessary changes mentioned here, and it seemed to me that installation was successful (I got what was expected on Step 4)
Then I started to work through this tutorial and everything went fine until this section.
When I press F9 for autoreference, I see that Vim is working on something for split seconds and red error message refering to "can't find [some file name]" in my user/appdata/local/temp directory. The "file name" changes every time I do this (so its kind of temporary file as its directory suggests?). And then it produces a new window with title __ OUTLINE __ where 2 empty lines are showing up.
If I press n (in the new window described above) error message saying "E486: Pattern not found: rf" pops up and pressing j results in going down one row. If I press enter key, message ":call Tex_FinishOutlineCompletion()" pops up.
More frustratingly, if I try to compile a file by entering command \ll, a new window pops up where there are two lines saying:
1.ll I can't find file `newfile.tex'. newfile.tex
2.ll Emergency stop
and below these is a message saying
[Quickfix list]: latex -interaction=nonstopmode -file-line-error-style newfile.tex
So I thought it maybe is something to do with VIM not being able to find files in my computer (so something wrong with grep?), and I tried to resolve it by downloading a software called "cygwin" on which developers said their tests were successful, but it changed nothing.
But I think the two problems are related.
As it is, I am completely newbie in this type of editing environment (or any kind of programming) but I really would like to learn some Vim seeing how efficient it is in typesetting etc. Sorry for not being a pro at typing codes here. Thanks for reading!
I believe you need a latex compiler---I've had this issue and well, one thing that's left out of the conversation a lot is the compiler (pdflatex, latexmk, etc). As of now, you should download a compiler since vim-latex (latex-suite) doesn't actually come with a compiler (that I know of) and it's just a plug in with some cool stuff in it, but not what you need to make a file.pdf out of your file.tex.
It happened to me before. I found out that this problem may happen when you have special characters (such as white space and other symbols) in your file name or folder path. Try again with file name and path only in English letters.

Corflags.exe cf001 Could not open file for wiriting

I am trying to edit the corflags file so that I can run 32bit applications on a 64 bit pc but everytime I try to edit the file using something like corflags.exe assembly /32bit+ it comes up with the error message cf001 could not open file for writing.
Now I have tried a lot of different options such as:
Running in administrator mode;
Finding the file using a search and checking read only is not ticked
Checking that user full control is ticked
Tried to set the whole folder to non read only
When trying the whole folder, it goes through looking like it has set read-only, but then I click OK and re-right click on the whole folder, the box is filled in (not ticked) does this mean that part of the folder is read only and why does it reset to read only?
I just faced the same problem and have tried the same things.
Run cornflags from an elevated ("Run as administrator") Visual Studio Command Prompt. I did the same for a copy of the original .exe just to make sure no other process was using the program.
Create a copy of the file you intend to target with CorFlags.
(e.g. "WcfServiceHost.exe" --creates--> "WcfServiceHost - Copy.exe")
Rename the original file to something else:
(e.g. "WcfServiceHost.exe" --> "WcfServiceHose_Original.exe")
Rename to copy to the original file name
(e.g. "WcfServiceHose - Copy.exe" --> "WcfServiceHost.exe"
For my purposes, I created copies and named them describing their configuration:
Example:
WCFServiceHost_With32BitOn.exe
WCFServiceHost_With32BitOff.exe
Now I can destroy the WCFServiceHost.exe files and create them from these pre-modified copies. No more CorFlags operations necessary.
Note: this is basically a more verbose version of #RMalke answer and that answer should be marked as the answer.
I realise this is years later, but for anyone else looking, I found that the quickest way was to copy cmd and corflags.exe into the same folder as the one you want to edit. Then run cmd as admin from there.

Error installing cab file on Windows CE

I'm having trouble using macros in my .inf file that I'm using to create my cab, specifically when setting the InstallDir string. If I do something like this:
InstallDir=\<PathToProgramFiles>\MyAppName
then everything works fine. However, if I do this:
InstallDir=%CE1%\MyAppName
then I get the following error when trying to install the cab (double tapping it on my device): "MyAppName was not installed successfully. Please run Setup again."
This only seems to apply to the built-in macro strings. I can use %AppName% without any problems. Maybe there is some registry setting that isn't properly set that would normally resolve the %CE1% macro?
Any ideas about what is going on?
Edit: My device doesn't have a \Program Files directory. It seems the %CE1% macro always resolves to that path and if the InstallDir specified in the inf file doesn't exist (with the exception of the last directory portion then the install fails. Manually creating \Program Files fixed the issue. Since a lot of the devices I'm working with have different paths for their Program Files directory, is there a generic way to get the installer to default to the actual Program Files dir? I guess my only other option is to not specify a path and force the user to choose one?
First, in this link you can find the shortcuts and their meaning (the %C..%), goto appendix B. The Windows CE5 MSDN link.
You can add a Setup Dll to your CAB installaer that will check the directory structure and will create a folder in case it does not exist. You may find this SO question useful.
A warning: If you are targeting regular Windows CE devices, beware where you place the files as it can be to a RAM based file system and then the files will disappear after reboot.

Resources