Does any one know what CPS is as mentioned in SDLMain.h
23 /* Use this flag to determine whether we use CPS (docking) or not */
24 #define SDL_USE_CPS 1
25 #ifdef SDL_USE_CPS
I can't seem to find it searching the docs
Phil Hassey had some experience with porting-galcon-fusion-to-the-mac-app-store that mentions the use of this flag as being undocumented. I wasn't able to come across any other relevant information. He essentially suggests just commenting it out, if his situation applies to yours.
Related
(I've looked far and wide but I can't even find anyone having the same problem, not to mention a fix or anything. Closest is this thread which just announces the feature...)
The way it currently works for me, the VS2019 code lens integration of P4VS (for C++ at least) is almost completely pointless. Each function has an indicator added, but the information in each is identical - namely the change history of the entire file:
According to this Microsoft article, I would expect to either get function-level change information that pertains only to that function or a single change summary of the file at the bottom of the editor. But instead I get the worst combination of both.
I'm mainly surprised that I can't find anyone else talking about this, so I assume something is misconfigured on my part. Can't find anything in the configuration options though...
Is this just a bad implementation by Perforce or is something wrong on my end?
I have just found out that it can be turned off by Visual Studio options.
How to turn off CodeLens-References
Text Editor > All Languagues > CodeLens
I'm creating a simple editor in Mac OS X and I've come to the point where my editor needs to do some highlighting of code, for example, comments.
I am using Regex to find all comments, which I initially thought, was slow. Turns out, it does rather amazing job. For example, for 387 comments, regex needs "only" 0.008404 s to find them and returns array of NSRanges.
But here comes disaster. When I try to set different color to my text with method setTextColor:range: it completes very slow. It needs additional 9.872964 s (for those 387 comments I mentioned before) and it gets worse really fast when number of comments is increased.
So... Is there any way to do this faster? With NSAttributedStrings, perhaps?
I'm really sorry guys, but stackoverflow gave me suggestion on similar question (which I didn't found when I was searching).
It turns out you simply have to tell NSTextViews TextStorage that you will begin doing some editing. And when you finish, you commit those changes. Code looks like:
[textView.textStorage beginEditing];
// do some stuff here
[textview.textStorage endEditing];
Now I ran code with 456 comments, Regex needed 0.013887 s and coloring 0.215761 s, which is amazing drop!
Anyway, I hope someone will find that useful.
I'm looking at this image/walkthrough of the PE format: https://i.imgur.com/LIImg.jpg
It seems to have some discrepancies from the official definition in WinNT.h though.
*#1: The 'signature' field in 'PEHeader' isn't in the PE header in the official definition. This discrepancy doesn't seem like it would make much of a difference.
*#2: In the 'Optional Header', there's two 4-byte fields between 'AddressOfEntryPoint' and 'ImageBaseAddress' in the official documentation that are not shown in the walkthrough. This one seems like it could make or break a file... The walkthrough does show 'AddressOfEntryPoint' as taking 8 bytes when it should be 4 though.
MSDN says there are 2 flags you can pass to IWbemClassObject::GetObjectText, WBEM_FLAG_NO_FLAVORS and WBEM_FLAG_NO_SEPARATOR.
But I can't seem to find where they are defined. I tried googling them, but I can only find that NO_FLAVORS is equal to 0x1. The only results for NO_SEPARATOR are the MSDN GetObjectText page (or verbatim copies on 3rd party sites). Does anyone know what it is?
http://msdn.microsoft.com/en-us/library/windows/desktop/aa391448(v=vs.85).aspx
I found this constant just doing a search in the win SDK, hope it helps.
WBEM_FLAG_NO_FLAVORS = 0x00000001
I didn't find the other, however.
I was looking for a solution to store program settings or options or configuration in C++. These could be settings that are exposed in a GUI and need to be saved between runs of my code.
In my search I came across boost.PropertyTree which seemed to be a good choice. I know boost is well respected code so I'm comfortable using it and so I started developing using this. Then I come across boost.program_options which seems to allow you to do the same thing but also looks more specialized for the specific use-case of program settings.
Now I'm wondering which is the most appropriate for the job? (or is there a 3rd option that is better than both)
EDIT:
fyi this is for a plugin so it will not use command line options (as in, it's not even possible).
UPDATE
I ended up sticking with boost.PropertyTree. I needed to be able to save changed options back to the INI, and I didn't see a way of doing that with boost.program_options.
Use boost::program_options. It's exactly what it's for. In one library you get command line options, environment variables options and an INI-like configuration file parser. And they're all integrated together in the Right way, so when then the user specifies the same option in more than one of these sources the library knows the Right priority order to consider.
boost::property_tree on the other hand is a more generalized library. The library parses the text stream into a uniform data model. But You need to do the real parsing -- that of making sense of the blob of data for your needs. The library doesn't know when to expect a parameter when it sees a particular option string, or to disallow specific values or types of values for a particular option.
After some digging around I think boost.PropertyTree is still the best solution because it gives me the capability to save the options after changing them from within the program which is a requirement.
There is a non-Boost possibility too. Config4Cpp is a robust, simple-to-use and comprehensively documented configuration-file parser library that I wrote. It is available at www.config4star.org.
I suggest you read Chapter 3 (Preferences for a GUI Application) of the Practical Usage Guide manual to read an overview of how Config4Cpp can do what you want. Then open the Getting Started Guide manual, and skim-read Chapters 2 and 3, and Section 7.4 (you might prefer to read the PDF version of that manual). Doing that should give you sufficient details to help you decide if Config4Cpp suits your needs better or worse than Boost.
By the way, the indicated chapters and sections of documentation are short, so they shouldn't take long to read.