PHP Warning: PHP Startup: Unable to load dynamic library

It means there is an extension=… or zend_extension=… line in one of your php configuration files (php.ini, or another close to it) that is trying to load that extension : ixed.5.2.lin Unfortunately that file or path doesn’t exist or the permissions are incorrect. Try to search in the .ini files that are loaded by PHP (phpinfo() can indicate which ones are) – one of them … Read more

While else statement equivalent for Java?

The closest Java equivalent is to explicitly keep track of whether you exited the loop with a break… but you don’t actually have a break in your code, so using a while-else was pointless in the first place. For Java folks (and Python folks) who don’t know what Python’s while-else does, an else clause on a while loop executes if the loop ends without … Read more

Convert float to double without losing precision

It’s not that you’re actually getting extra precision – it’s that the float didn’t accurately represent the number you were aiming for originally. The double is representing the original float accurately; toString is showing the “extra” data which was already present. For example (and these numbers aren’t right, I’m just making things up) suppose you … Read more

How to get POSTed JSON in Flask?

First of all, the .json attribute is a property that delegates to the request.get_json() method, which documents why you see None here. You need to set the request content type to application/json for the .json property and .get_json() method (with no arguments) to work as either will produce None otherwise. See the Flask Request documentation: … Read more

Android getResources().getDrawable() deprecated API 22

You have some options to handle this deprecation the right (and future proof) way, depending on which kind of drawable you are loading: A) drawables with theme attributes You’ll obtain a styled Drawable as your Activity theme instructs. This is probably what you need. B) drawables without theme attributes You’ll get your unstyled drawable the old way. Please note: ResourcesCompat.getDrawable() is not deprecated! EXTRA) drawables with theme attributes from another theme