compatibility

Is sizeof(size_t) == sizeof(void*) always true?

て烟熏妆下的殇ゞ 提交于 2019-11-30 17:17:07
Does the C99/C++11 standard guarantee that sizeof(size_t) == sizeof(void*) is always true? size_t f(void* p) { return (size_t)(p); // Is it safe? } void* f(size_t n) { return (void*)(n); // Is it safe? } No, that is not guaranteed. Use intptr_t or uintptr_t to safely store a pointer in an integer. There are/were architectures where it makes sense for that to be false, such as the segmented DOS memory model. There the memory was structured in 64k segments - an object could never be larger than a segment, so 16-bit size_t would be enough. However, a pointer had "segment" and "offset" parts, so

Build for Windows NT 4.0 using Visual Studio 2005?

泪湿孤枕 提交于 2019-11-30 17:15:48
An MFC application that I'm trying to migrate uses afxext.h , which causes _AFXDLL to get set, which causes this error if I set /MT : Please use the /MD switch for _AFXDLL builds My research to date indicates that it is impossible to build an application for execution on Windows NT 4.0 using Visual Studio (C++, in this case) 2005. Is this really true? Are there any workaround available? No, there are many applications built with VS2005 that have to support Windows XP, 2000, NT, the whole stack. The issue is that (by default) VS2005 wants to use libraries/exports not present on NT. See this

Groovy Superset of Java [duplicate]

删除回忆录丶 提交于 2019-11-30 17:08:05
问题 This question already has answers here : Is Groovy syntax an exact superset of Java syntax? (4 answers) Closed 3 years ago . Is Groovy a superset of Java yet? If not, what are the incompatibilities between Groovy and Java? By superset, I mean source backward compatibility, in the sense that: you can take a Java file and compile it as Groovy source file, and it would work just as before. It has been the goal of Groovy to make very similar to Java, to minimize the learning curve. However, until

How to debug app in compatibility mode on iOS 7?

自古美人都是妖i 提交于 2019-11-30 17:03:00
问题 So, iOS 7 was released and a lot of our users have already upgraded, even though we officially do not support iOS 7 and have asked everyone not to upgrade. Right now the app runs in compatibility mode and there are lots of issues being reported by our users. The problem is that I do not know how to debug in compatibility mode, so some of these issues are really hard to fix. I tried to Google for it, but so far I've had no luck. How can I debug an app on iOS 7 in compatibility mode? 回答1: I

Check Browser HTML5 Compatibility with PHP

≯℡__Kan透↙ 提交于 2019-11-30 15:29:02
I want to use input types or other features from HTML5. But not all browsers support these HTML5 features. How can I check if a user's browser is html5 compatible with PHP code only ?. By the way, I don't like modernizr . I have to figure out with PHP. Example: Html5 compatible browser: <input type="date" value="" /> Html5 incompatible browser: <input id="datepicker" type="text" value="" /> PHP is really the wrong place to be doing this kind of detection. There are any number of reasons why it's a bad idea, and they're well documented in many places. The key to successfully working with

JDK, JRE an JARs compatibility

为君一笑 提交于 2019-11-30 11:45:55
I know a bit about JDK and JRE source and binary compatibility (e.g. this and this ), but not sure about the following situation: Consider I have an application which is compiled using JDK5 and runs on JRE6. It uses some libraries (jars) which are also compiled using JDK5. Now I want to compile my application using JDK6. What new problems could arise in runtime in such a case (particularly, in compatibility with the "old" jars)? Should I fully retest the application (touch every library) or can rely on promised JDK/JRE compatibility? Normally no problems should arise if you set the compiler

Theme not applying to DialogFragment on Android

流过昼夜 提交于 2019-11-30 11:44:31
问题 I'm switching my old Dialogs to DialogFragment, but the themes and styles don't seem to be working. I'm using the DialogFragment from the compatibility library v4, and in the onCreate method I've tried calling setStyle(style, theme); with a lot of different themes, but the dialog always shows as an "old" dialog in the emulator running Android 4.0.3 (i.e., it does not shows in Holo theme). Is there anything else that I should be doing? Does using the compatibility library disables the Holo

“Compatibility Pack” for backporting new .NET Framework features?

走远了吗. 提交于 2019-11-30 11:35:33
For various reasons I often find it desirable to write code that is compatible with .NET framework 2.0 or 3.5 or compatible with the .NET Compact Framework, but it is a problem that there are numerous "small" features in new .NET frameworks that are not available in the older frameworks or Compact Framework. For example, I find extension methods are really useful, but the compiler depends on System.Runtime.CompilerServices.ExtensionAttribute for this. You can easily define this attribute yourself and then use extension methods in .NET Framework 2.0 (under C# 3.0+). Likewise, it isn't too hard

Strategy for developing namespaced and non-namespaced versions of same PHP code

两盒软妹~` 提交于 2019-11-30 10:27:03
问题 I'm maintaining library written for PHP 5.2 and I'd like to create PHP 5.3-namespaced version of it. However, I'd also keep non-namespaced version up to date until PHP 5.3 becomes so old, that even Debian stable ships it ;) I've got rather clean code, about 80 classes following Project_Directory_Filename naming scheme (I'd change them to \Project\Directory\Filename of course) and only few functions and constants (also prefixed with project name). Question is: what's the best way to develop

How to write Python 2.x as much compatible with Python 3.x as possible?

流过昼夜 提交于 2019-11-30 10:15:26
问题 There are many ways to include Python 3.x features in Python 2.x , so code of Python 2.x scripts could be easily converted into Python 3.x in the future. One of these examples is replacing print statement with print() function: >>> from __future__ import print_function Is there any list or resource that could give one some ideas how to make Python 2.x code as close to Python 3.x as possible? Could you give examples of other useful imports or definitions that can make Python 2.x look and