compatibility

Easy way to guarantee binary compatibility for C++ library, C linkage?

二次信任 提交于 2019-11-30 00:08:12
问题 I don't know exact way to guarantee binary compatibility for C++ library on both Windows and Linux. But I think if I make all exposed APIs with a C linkage I think I can easily guarantee this compatibility on both Windows and Linux. It's like below : extern "C" int SomeAPI(); Rest of the functions surely will be written in C++. Only the APIs exposed to outter world will have C linkage. And the exposed API's must be pure C function - no exceptions, no C++ types are used. Am I right or wrong?

Unable to override onCreateOptionsMenu in ListFragment

▼魔方 西西 提交于 2019-11-29 22:58:49
I created an app that supports both phone and tablet version so i use the android-support-v4.jar library. My activity extends the ListFragment and I tried to override the onCreateOptionsMenu(Menu menu, MenuInflater inflater), as in the following link: http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentMenuSupport.html I previously called setHasOptionsMenu. Unfortunately, it seems that I cannot override onCreateOptionsMenu(). This is the error message: The method onCreateOptionsMenu(Menu menu, MenuInflater inflater) of type MyFragment must

Check Browser HTML5 Compatibility with PHP

给你一囗甜甜゛ 提交于 2019-11-29 22:30:59
问题 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="" /> 回答1: PHP is really the wrong place to be doing this kind of detection. There are any number of reasons

.NET 4 Program written/compiled on Windows 7 machine won't run on XP

只愿长相守 提交于 2019-11-29 21:03:34
问题 I have an app that I wrote using C# .NET 4.0 in Visual Studio 2010 on my Windows 7 Ultimate machine. This app works fine on both Vista and other Windows 7 computers, but whenever someone running Windows XP tries to run it it crashes. In order to reproduce this I've tried running it on my Win XP VMWare machine and it crashes for me in there. Unfortunately it doesn't give me any specific error, just informing me that the program has crashed and needs to close. One other user sent me the

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

时间秒杀一切 提交于 2019-11-29 20:34:54
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 namespaced and non-namespaced versions in parallel? Should I just create fork in repository and keep

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

吃可爱长大的小学妹 提交于 2019-11-29 19:33:30
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 behave more like Python 3.x ? Lets assume we have the latest Python 2.x (2.7.2 at the moment, I believe) at

Which HTML5 tags can I use without worrying about browser compatibility?

为君一笑 提交于 2019-11-29 18:41:33
I am building a web app for use on PCs. What are the HTML5 tags to stay away from to prevent compatibility issues with Browsers like IE8 and above? Note: Most questions are 1-3 years old on this subject. iConnor You asked what HTML5 tags to stay away from. Well Some of the tags from HTML5 from my knowledge were made for semantic reasons. like the following for example. <article> <section> <aside> <nav> <header> <footer> ..ect These are almost fine to work with, and just require a bit of CSS eg. display: block; to work normally in most browsers, though in older browsers ie. Internet Explorer

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

只谈情不闲聊 提交于 2019-11-29 17:48:17
问题 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

JDK, JRE an JARs compatibility

别说谁变了你拦得住时间么 提交于 2019-11-29 17:37:38
问题 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

vbNewline vs Chr(10) as linebreak delimiter in Windows vs. Mac OSX

∥☆過路亽.° 提交于 2019-11-29 16:00:50
I have an Excel sub that uses the Split() function to split CSV data from a cell into an array. However, depending on the version of Excel/OS I'm using, the character used as the line break delimiter changes: Excel 2011 / Mac OSX: fullArray = Split(CSV, vbNewLine) 'successfully returns array fullArray = Split(CSV, Chr(10)) 'fails and returns only a single cell Excel 2007 / Windows 7: fullArray = Split(CSV, Chr(10)) 'successfully returns array fullArray = Split(CSV, vbNewLine) 'fails and returns only a single cell Anyone else noticed this/has an explanation why this is going on? If you need to