How to give auto custom header on codeblocks? - codeblocks

Every time when I open a new file in codeblocks, it is an empty file. But I want my files to have this headers (shown on the image file) which will be there, whenever i will create a new cpp file. But i didn't find any option to create this. Googled but didn't find where is this option in codeblocks
this is the headers

I use my own Made tools to get rid of these problem. You can add that tools in codeblocks then you can easily open new file with custom header/skeleton. You can check that out here. Github link.. If you have any issue with it.. feel free to ask. Thanks.

Related

Xcode does not allow me to specify file name when adding in SPM

I have a stand alone SPM (local) in my project. When ever I add any new files to this package Xcode does not show the prompt to specify the name. Usually when adding files in a project it requests the location which allows to specify a name. But when adding in a SPM it straight away creates a file with File.swift always.
I don't mind renaming but its just that the header is also having a generic File.swift
//
// File.swift
//
//
// Created by McDuck, Scrooge on 02/06/89.
//
Any work arounds ?
I have tried on Xcode 13.4 as well
#user5381191 I had the same problem. I did some searching and found this answer.
The file you want to edit is located in:
/Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates/Source/Package Swift File.xctemplate. Edit the TemplateInfo.plist.
As a test I just copied the TemplateInfo.plist file from the Multiplatform/Source/Swift File.xctemplate and it worked. EDIT: For some reason it worked, and then stopped working?
Copy the suggested plist text from the link above into your template file and it works!
Once I did that, I get a new file type "Package Swift File" in the New File dialog.
Instead of the standard file dialog, it gives a dialog for entering the file name. Better than before!
Make sure to save your old template file before making your changes, just in case you need to revert.
It doesn't insert the package name in the header. That might be a nice thing to try and get working, but I'm happy with this for now.
Actually it works as promised (according to Apple guidelines).
In this scenario (as shown on demo) a menu command without ellipsis (...), so no dialog expected.
Once file created Xcode enters edit-name mode, so we can specify a file name which we need.
The file hat is different question and can be edited in templates if needed, or not. Usually depends on project and might even not include file name at all, but for default template - yes we need to change it to align.
Tested with Xcode 13.4

VsCode include Path errors are impossible to solve

The other answers i've seen proved to be ineffective.
I'm using c++ and it gives me error(red squiggle) when i include vector or string.
It tells me that my include path is not updated so i click on the lightbulb and try to edit intellisense configurations.
In this window there's an include path section, inside the box there's this string: ${workspaceFolder}/**.
So is this string the problem?
I've tried to put in this box the following path as well:
/usr/local/include but it doesn't change anything...
Please what should i change about this include path??
What is there supposed to be in it?
Press Ctrl+Shift+P to open the Command Palette
Start typing "C/C++" and then choose Edit Configurations (UI) from the list of suggestions. This opens the C/C++ Configurations page. When you make changes here, VS Code writes them to a file called c_cpp_properties.json in the .vscode folder.
Find the Compiler path setting. VS Code will attempt to populate it with a default compiler based on what it finds on your system. For Clang on macOS, the path should look like this: /usr/bin/clang.
The Compiler path setting is the most important setting in your configuration. The extension uses it to infer the path to the C++ standard library header files. When the extension knows where to find those files, it can provide lots of useful information to you as you write code.
Set IntelliSense mode to ${default}, which on macOS is clang-x64.
You only need to modify the Include path setting if your program includes header files that are not in your workspace or in the standard library path.
On macOS, you must set the macFrameworkPath to point to the system header files.
Visual Studio code places these settings in .vscode/c_cpp_properties.json.
Original documentation here!

Add contextual menu to .config files

I'm currently trying to add a contextual menu (right click menu) on a specific extension : .config
I managed to add a contextual menu to all files, unknown files, .jpg, and every other extension I've tried, except for .config, and I don't know why.
I even tried to use some external tools to do it. These tools worked for everything I tried, except .config again.
The .config register key has a master file type named config_auto_file.
I tried to create a \shell\My_command\command key on each of them (HKEY_CLASSES_ROOT\.config and HKEY_CLASSES_ROOT\config_auto_file) with no success. I'm now out of ideas.
An easy, similar test would be .jpg, which has a master file type too (jpegfile). And it works on this one while doing the exact same thing.
I'm on windows 7 and windows 10.
Thanks for your time on this.
I managed to do it thanks to another post on stackoverflow.
The "AppliesTo" on HKEY_CLASSES_ROOT* worked for me.

Xcode "Cannot parse contents of Info.plist"

I just hit a brick wall with xCode not wanting to parse my Info.plist file. I've replaced the file several times with older (identical) versions of the file that I had previously backed up, and I'm still getting the same error.
Here is the complete error message:
couldn't parse contents of '/Users/...Info.plist': The data couldn’t be read because it isn’t in the correct format.
I'm clueless on this one. I'm using xCode 5.0.1, Mavericks
This is one of the best way to detect on which line the error is occurring.
Just go the directory where the plist file is present then write this command on terminal->
plutil filename.plist
Another cause of this issue can be from attempting to put URLs (really just slashes etc.) in your app-Info.plist.
Get around it by simply raising the -traditional flag inside of the Info.plist Other Preprocessor Flags option in your project build settings.
I think you have used source-control tools, you can use basic text-edit tool without Xcode to open this plist, command + F to find "<<<<<" or ">>>>>", then you will probably find error string such as:
<<<<<<< .mine
>>>>>>> .r605
select the correct string, and delete the other one, error is resolve!
Looks like replacing the file with a backup, then deleting the derived data for the project in Organizer was the cure. Hope this helps someone else later on.
I personally ruined the file when git merge raised conflicts. .plist is an XML file and git conflict added <<<< and >>>> in there to tag the differences.
Find the .plist file in Finder (in one of your project's folders). Open it in a text editor, find the lines that don't look like proper XML, remove them and be sure to remove the duplicate XML line/node (due to pre and post git recorded changes).
This may also simply happen because you have moved the Info.plist file into a new folder, or removed it from a folder (basically, if its path changed).
Go to Build Settings and search for "Info.plist file". Edit the value. For instance, if you have moved your plist file from the main folder to a subfolder called Resources, you will have to do the following change:
Before:
TargetName/Info.plist
After:
TargetName/Resources/Info.plist
When building for iOS, the Info.plist may be corrupted whenever Default Orientation is set to Auto Rotation. The Info.plist file is created properly on the first build, but subsequent builds results in...
<key>UIInterfaceOrientation</key>
<string></string>
</string>
... at this point Xcode fails to build the project.
I was having the same error, and realized the issue was that I had a URL (e.g. http://example.com/something) as a value in my Info.plist, and I just switched on pre-processing for it (without the -traditional flag). Apparently Xcode will treat the // as a comment marker, and omit the rest of the line.
A work-around I found is to embrace the pre-processor, like so:
http:/${}/example.com/something, which breaks up the // by putting an empty string substation in the middle so it doesn't look like a comment to Xcode, but after pre-processing it's back to a normal URL.
This error comes whenever Xcode preprocessor is not able to parse the info.plist file.
So to find out the error in the specific line do the following steps :
Open your project.xcworkspace in Xcode
Go to the project's navigator
Inside your project click on the info file, if an error exists then it will popup the dialog with the line number where the error exists
You can see the below image of the popup dialog for reference, which is in my case was showing the error on line 35
Hope this will help you or somebody else. Thanks!
Happy Coding :-)

Renaming namespaces in windows phone

Is it possible to rename the namespace, projectfolder, solution name in windows phone? I have a paid version and free version of app. The free version of the app has minor modification. So I tried copying the whole project folder of the paid version and tried renaming the namespace, solution name, foldernames. I landed up in a bag full of errors!!
Is there any way i can do this? or do I have to do it the hard way?, have to create a new project and files and Ctrl+C the whole content???
Could someone help me on this?
Alfah
Why do you want to rename the solution and project? If you want to change the name of the app, you just have to edit the manifest file.
If you really want to change the namespace, you can use Visual Studio's refactoring features: http://msdn.microsoft.com/en-us/library/6kxxabwd.aspx
Yes, but it's a 3-step process:
Rename all the namespaces, references, configuration etc (basically, everything you can find through full solution code search). Make sure it compiles.
Close solution. Rename files on the disk. Open the solution file in the Notepad, update the renamed folder references. Make sure that after opening the solution in VS it opens correctly.
In the project properties, select the Startup Object (http://www.jayway.com/2011/10/12/fixing-wp7-app-not-starting-after-project-rename/)
Yes definitely you can!
Please refer following steps
Open LocalizedStrings.cs and refactor namespace from it.
Rename project solution
Expand properties and open AppManifest file
Change the display name and tile title
Right click on solution file and select clean solution from contextual menu.
Here you are ready with your project with new name! Enjoy!

Resources