compatibility

Unpickling python2 datetime under python3

╄→尐↘猪︶ㄣ 提交于 2019-12-01 04:48:17
I chose to use pickle (+base64+TCP sockets) to communicate data between my python3 code and legacy python2 code, but I am having trouble with datetime objects: The PY3 object unpickles well on PY2, but the reverse raises a TypeError when calling the datetime constructor, then a UnicodeEncodeError in the load_reduce function. A short test program & the log, including dis output of both PY2 and PY3 pickles, are available in this gist I am using pickle.dumps(reply, protocol=2) in PY2 then pickle._loads(pickled, fix_imports=True, encoding='latin1') in PY3 (tried None and utf-8 without success)

Why is NotificationCompat needed?

一世执手 提交于 2019-12-01 04:29:26
Specifically, I think anything done with NotificationCompat can be done using the default API (level 8). What am I missing here? What does NotificationCompat introduce that cannot be done using 2.2 API? Source: http://developer.android.com/sdk/compatibility-library.html#Notes You can use things like NotificationCompat.Builder#setLargeIcon(Bitmap) to allow you to take full advantage of Android 3.0+ with things like the large icon, while maintaining compatibility on versions of Android prior to 3.0 that do not support such things. Though its old question, now NotificationCompat can also be used

Facebook Connect and HTML5, xmlns available?

对着背影说爱祢 提交于 2019-12-01 03:08:00
Facebook Connect and their "Social Widgets" documentation mention that you need to add an xmlns attribute to your <html> tag on the page where it will be used. I understand that xmlns is for XML Name-spacing, and have used such with XHTML before. However, with all the recent talk about HTML4 / HTML5, without having read through the entire spec, is the xmlns attribute compatible with valid HTML5? What about HTML4? If I've looked over an obvious mention of this in the docs, I'm sorry... point it out? EDIT: A couple docs references/cites: http://developers.facebook.com/news.php?blog=1&story=198

Unpickling python2 datetime under python3

安稳与你 提交于 2019-12-01 02:09:44
问题 I chose to use pickle (+base64+TCP sockets) to communicate data between my python3 code and legacy python2 code, but I am having trouble with datetime objects: The PY3 object unpickles well on PY2, but the reverse raises a TypeError when calling the datetime constructor, then a UnicodeEncodeError in the load_reduce function. A short test program & the log, including dis output of both PY2 and PY3 pickles, are available in this gist I am using pickle.dumps(reply, protocol=2) in PY2 then pickle

Xcode Set Compatible Devices

亡梦爱人 提交于 2019-12-01 00:12:37
I have released my first app on the iOS App Store a few days ago and told my friends to download it. However, they have told me that it is not compatible with the iPod Touch 2G running iOS 4.2.1. Why is this? And how do I fix this? I am using Xcode 4.2 with iOS SDK 5.0, but my deployment target is iOS 4.0, so it should work. On the iTunes page for my app, it says: Requirements: Compatible with iPhone 3GS, iPhone 4, iPhone 4S, iPod touch (3rd generation), iPod touch (4th generation) and iPad. Requires iOS 4.0 or later. How do I include the iPod Touch 2G in this list? I have an iPod 3G as one of

different versions of git between developers

淺唱寂寞╮ 提交于 2019-11-30 21:42:46
if I have installed version of GIT 1.9.4 and the repository on server is using 1.8.2 would there be a problem? Are there any issues with working using different versions of GIT? Does every person in a team should have the same version or does it not matter? Could find any info on that in docs, I'd be grateful for your help. zessx 1.9.4 and 1.8.2 are pretty close, but there may have a few problems between different git versions, mainly varying behaviors. If you want to know what have changed, you can check git repository ( https://github.com/git/git ). Clone it locally, and search for

Groovy Superset of Java [duplicate]

旧街凉风 提交于 2019-11-30 21:31:31
This question already has an answer here: Is Groovy syntax an exact superset of Java syntax? 4 answers 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 Groovy 1.7 that was no support for anonymous inner classes and such. I have seen some articles making such claim, but I

How to debug app in compatibility mode on iOS 7?

限于喜欢 提交于 2019-11-30 21:22:19
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? I figured out a way to do it. This is what I did: Install Xcode 5 from App Store. (Skip this step if it's already

Android ActionBar compatibility: MenuItem.setActionView(View)

社会主义新天地 提交于 2019-11-30 20:43:46
I'm using the appcompat7 lib for ActionBar backwards compatibility. Now I have a MenuItem that I retrieve, and then want to set an ImageView myView as its icon. The way how to do it from API level 11 is: MenuItem menuItemRefresh = menu.findItem(R.id.refresh); menuItemRefresh.setActionView(myView); For API levels lower than 11 this doesn't work, the second line will show an error. Is there an option to do this in compatibility mode? Look at MenuItemCompat : http://developer.android.com/reference/android/support/v4/view/MenuItemCompat.html There is a static function setActionView(MenuItem item,

whats the equivilent of getCheckedItemCount() for API level < 11?

我与影子孤独终老i 提交于 2019-11-30 19:31:31
I am using this method to check how many items on a list a checked and I get this error that this method is not available for any SDK older than 11. What is the equivalent this in API level 8 vharron getCheckedItemIds().length seems to do the trick The accepted answer didn't work for me (always returns 0), I had to use the following code: public static int getCheckedItemCount(ListView listView) { if (Build.VERSION.SDK_INT >= 11) return listView.getCheckedItemCount(); else { int count = 0; for (int i = listView.getCount() - 1; i >= 0; i--) if (listView.isItemChecked(i)) count++; return count; }