backport

javax.swing.grouplayout not exist in jdk 1.5

末鹿安然 提交于 2019-12-04 09:36:22
I developed a java application with netbeans. It used jdk 1.6. It works fine. But now the requirement is I need to build the jar for the application from the .java files in another machine without netbeans and where jdk 1.5 is used. I cannot upgrade that machine to jdk 1.6. Is there any way I could make my java files compile and work in jdk 1.5 machine with a possible minimal change to my source code.. The error is javax.swing.grouplayout not available in jdk 1.5 Please help... Use the netbeans preferences and select org.jdesktop...., update manually the generated code by right-click in the

How to backport functionality in Qt?

半世苍凉 提交于 2019-12-03 20:31:44
Suppose that there is a project that uses Qt, and depends on the features (e.g. added class members) present in a new version of Qt. The project is meant to be built with a "system"/distribution version of Qt that may be older than the version the project depends on. The naive approach results in the preprocessor hell: void Class::foo() { #if QT_VERSION >= QT_VERSION_CHECK(...) QClass::newFangled(); #else QClass::oldFangled1(); blurble(); #endif } Is there a cleaner approach that won't depend on preprocessor macros at the point of use of the feature? I.e. we do not want: // THIS IS BLAH #if QT

Easy way to backport Java 6 code to Java 5?

荒凉一梦 提交于 2019-12-03 13:00:31
We've been developing a windows based application using Java for a while now, but NOW we want to make a mac port and have to reverse of code from Java 6 and Java 5. Is there any easy way to do this rather than re-coding Java 6 specific code? We'd like to keep our code up to date. There are a couple of libraries out there which can help you. Unfortunately I haven't tried them myself, because I've never run into such a situation. Retroweaver Retrotransaltor backport-jsr166 See here: http://en.wikipedia.org/wiki/Comparison_of_backporting_tools I tried retrotranslator from 1.6 to 1.4.2 and it

debugInfoEnabled for Angular 1.2

痞子三分冷 提交于 2019-12-03 11:27:00
Angular 1.3 introduced a new debugInfoEnabled() method that can provide a boost in performance if called with false in the application config function : myApp.config(['$compileProvider', function ($compileProvider) { $compileProvider.debugInfoEnabled(false); }]); Also, Angular 1.3 dropped IE8 support. And this is a problem for me, my application have to run on IE8. Hence, I cannot upgrade to angular 1.3 and have to live with 1.2. Is there a way to achieve the same functionality with angular 1.2? In particular, at least a part of what debugInfoEnabled() does: prevent creation of ng-scope / ng

python backports for some methods

情到浓时终转凉″ 提交于 2019-12-01 10:54:21
Is there any backport for the following methods to work with python 2.4: any, all, collections.defaultdict, collections.deque Well, at least for any and all it's easy: def any(iterable): for element in iterable: if element: return True return False def all(iterable): for element in iterable: if not element: return False return True deque is already in 2.4. As for defaultdict , I guess you can emulate that easily with setdefault() . Quoting from Alex Martelli`s (and others') highly recommended Python Cookbook : This is what the setdefault method of dictionaries is for. Say we’re building a word

python backports for some methods

老子叫甜甜 提交于 2019-12-01 08:14:46
问题 Is there any backport for the following methods to work with python 2.4: any, all, collections.defaultdict, collections.deque 回答1: Well, at least for any and all it's easy: def any(iterable): for element in iterable: if element: return True return False def all(iterable): for element in iterable: if not element: return False return True deque is already in 2.4. As for defaultdict , I guess you can emulate that easily with setdefault() . Quoting from Alex Martelli`s (and others') highly

Backport Java 5/6 features to Java 1.4?

若如初见. 提交于 2019-11-28 08:42:36
We are stuck with Java2SE v1.4 till the end of 2010. That's really nasty, but we can't help it. What options do we have to use some of the new features already now? I can think of several ways like changing the bytecode, e.g. using Retrotranslator or Retroweaver . backport of libraries, e.g. Concurrent Backport , but this does not help for generics. emulation of Java 5 features, e.g. checked Collections, Varargs with helper methods, etc. changing source code by precompilation, stripping all 1.5 stuff before final compilation, e.g. using Declawer can do this. I am most interested in very

How can I use BitmapRegionDecoder code in android 2.2.2 (Froyo)?

白昼怎懂夜的黑 提交于 2019-11-28 06:17:14
I was reading an answer to a different question on SO, in which @RomainGuy commented that one could (please correct me if I'm paraphrasing incorrectly) back-port code from later versions of android to earlier versions. Specifically, I am interested in back-porting code for BitmapRegionDecoder from Android version 2.3.3 (Gingerbread) to version 2.2.2 (Froyo). I would have rather asked the question more generally as what is the best practice / what should be avoided when back-porting code from newer versions of Android to older versions, but stackoverflow hinted that my question might be closed

Backport Python 3.4's regular expression “fullmatch()” to Python 2

不打扰是莪最后的温柔 提交于 2019-11-27 23:48:39
问题 Python 3.4 introduced the new regex method re.fullmatch(pattern, string, flags=0). Has anyone back-ported this new method to older Python versions? 回答1: To make sure that the entire string matches, you need to use the \Z end-of-string anchor: def fullmatch(regex, string, flags=0): """Emulate python-3.4 re.fullmatch().""" return re.match("(?:" + regex + r")\Z", string, flags=flags) The \A anchor is not necessary since re.match() already anchors the match to the start of the string. 回答2: Here

python 2.7 functools_lru_cache does not import although installed

江枫思渺然 提交于 2019-11-27 21:53:57
When I try to import matplotlib I get an error Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/matplotlib/__init__.py", line 128, in <module> from matplotlib.rcsetup import defaultParams, validate_backend, cycler File "/usr/local/lib/python2.7/dist-packages/matplotlib/rcsetup.py", line 29, in <module> from matplotlib.fontconfig_pattern import parse_fontconfig_pattern File "/usr/local/lib/python2.7/dist-packages/matplotlib/fontconfig_pattern.py", line 32, in <module> from backports.functools_lru_cache import lru_cache