DEPRECATION WARNING: Dangerous query method: Random Record in ActiveRecord >= 5.2

If you want to continue using order by random() then just declare it safe by wrapping it in Arel.sql like the deprecation warning suggests: Model.order(Arel.sql(‘random()’)).first # PostgreSQL Model.order(Arel.sql(‘rand()’)).first # MySQL There are lots of ways of selecting a random row and they all have advantages and disadvantages but there are times when you absolutely must … Read more

DeprecationWarning: firefox_profile has been deprecated, please pass in an Options object

Here is the documentation for this: https://www.selenium.dev/documentation/webdriver/capabilities/driver_specific_capabilities/#setting-a-custom-profile I tried this locally and it worked: EDITED: I’ve changed the code, so there are no deprecation warnings from selenium.webdriver import Firefox from selenium.webdriver.firefox.service import Service from selenium.webdriver.firefox.options import Options profile_path = r’C:\Users\Administrator\AppData\Roaming\Mozilla\Firefox\Profiles\y1uqp5mi.default’ options=Options() options.set_preference(‘profile’, profile_path) service = Service(r’C:\WebDriver\bin\geckodriver.exe’) driver = Firefox(service=service, options=options) driver.get(“https://selenium.dev”) driver.quit()

Is `shouldOverrideUrlLoading` really deprecated? What can I use instead?

Documenting in detail for future readers: The short answer is you need to override both the methods. The shouldOverrideUrlLoading(WebView view, String url) method is deprecated in API 24 and the shouldOverrideUrlLoading(WebView view, WebResourceRequest request) method is added in API 24. If you are targeting older versions of android, you need the former method, and if … Read more

variantOutput.getPackageApplication() is obsolete

variantOutput.getPackageApplication() is being caused by a changed variant API. changing output.outputFile.parent to variant.getPackageApplicationProvider().get().outputs.files[1] is at least a temporary workaround. source: @Selvin. variant.getExternalNativeBuildTasks() is being caused by the io.fabric plugin. the next version of the io.fabric plugin will use variant.getExternalNativeBuildProviders(). source: 116408637; the confirmation for a promised fix (1.28.1). These are caused by com.google.gms.google-services: registerResGeneratingTask is … Read more

Preprocessing in scikit learn – single sample – Depreciation warning

Just listen to what the warning is telling you: Reshape your data either X.reshape(-1, 1) if your data has a single feature/column and X.reshape(1, -1) if it contains a single sample. For your example type(if you have more than one feature/column): temp = temp.reshape(1,-1) For one feature/column: temp = temp.reshape(-1,1)

getCurrentPosition() and watchPosition() are deprecated on insecure origins

Because switching to HTTPS can be painful or impossible depending on your architecture, I found a workaround solution: you can use the Google Maps Geolocation API. Although it has usage limits, it does the job. You will need an browser API key, so don’t forget to limit it’s usage to your page hostname. I use … Read more

tech