a blog about coding & IT

  • Edge Browser Bing Chat GPT over 100% GPU Usage

    Bing Chat (GPT-4) on Microsoft Edge Browser is using over 100% GPU usage on a MacBook Pro 2020 laptop (154% in my case) causing the fans to spin up to a high RPM. Switching to another tab on Edge, not showing the Bing Chat tab, GPU usage drops down to single digits for Microsoft Edge…

  • Epson EF-12 Dolby Digital / DTS output on ARC

    The Epson EF-12 laser projector (Android TV) can output / passthrough 5.1 digital surround sound to your A/V home theater receiver over its HDMI2 ARC connection for both Dolby Digital AC3 and DTS movies & media using Kodi player, but with some big caveats. First, the settings in Kodi player to output 5.1 digital surround sound…

  • Android Genymotion Mock Location Google Play

    To get Android Genymotion Mock Location Google Play fused location provider working in an emulator these are the necessary components and steps.  (For Genymotion 2.5.x emulator versions) Download: Genymotion ARM Translation v1.1 Google Apps / Play Store for a Genymotion emulator running SDK 5.1 (API Level 22) Steps Install these two zipped APK archive files by…

  • Spring Boot SSL with Android Retrofit

    To setup Spring Boot SSL with Android Retrofit connecting on HTTPS 443: In Spring Boot <your project>/src/main/resources/application.properties – add the following values (not the “1.” which is just WordPress ordered list numbering) security.require-ssl=true server.port=8443 server.ssl.key-store=src/main/resources/private/keystore server.ssl.key-store-password=changeit server.ssl.key-password=changeit create and add an SSL key to the location specified by server.ssl.key-store. Note: the SSL certificate file is…

  • Android Studio Permanently Change Debug Configuration for Working Directory $MODULE_DIR$ and app:assembleDebugUnitTest

    On Mac OS X, Android Studio’s default debug Unit Test build configuration generally doesn’t run with default settings complaining that: AndroidManifest.xml not found or not a file; it should point to your project’s AndroidManifest.xml To fix this error you need to edit your debug configuration to set Working Directory as $MODULE_DIR$ and it makes builds…

  • Android AsyncTask return result

    To get Android AsyncTask to return a result use a callback method (Observer pattern) by following these steps. Define a constructor for our async class which extends AsyncTask (we’re required to subclass/extend AsyncTask for use). Let’s call our AsyncTask class MyAsyncTask. Constructor parameter takes a class which will handle the AsyncTask result.  Usually an Activity or Fragment,…

  • Retrofit error 415 400 object with Date field Fix @JsonFormat annotation

    Retrofit error 415 or error 400 on an object with a Date field can be fixed by using @JsonFormat annotation with the proper date pattern format specified in the annotation. java.util.Date toString() (for my locale/region) returns a string date format of MMM dd, yyyy hh:mm:ss aa Example: Oct 22, 2015 11:09:55 PM For Retrofit /…

  • H2 Web Console to In Memory Database – Spring Boot

    To get an H2 Database Web Console accessing an in-memory database running on Spring Boot: Register H2’s WebServlet (with UrlMapping /console/*) to your Spring project in a Configuration annotated class. Restart your Application. Open a web page to http://localhost:8080/console/ Be sure you’re accessing the correct database JDBC URL (default would be jdbc:h2:mem:testdb) (Credit: Spring Framework Guru)   import org.h2.server.web.WebServlet;…

  • Robolectric reference

    Robolectric Android testing Fragments and more private ReminderManagerFragment startReminderManagerFragment() { final ReminderManagerFragment fragment = new ReminderManagerFragment(); SupportFragmentTestUtil.startVisibleFragment(fragment); return fragment; } @Test public void reminderManagerTest() throws Exception { // by default there should be 3 Reminder rows ReminderManagerFragment fragment = startReminderManagerFragment(); assertThat(fragment).isNotNull(); Button addButton = (Button) fragment.getView().findViewById(R.id.reminder_add_button); assertThat(addButton).isNotNull(); List<Reminder> reminders = getReminders(TestValues.BillyUser); assertThat(reminders.size()).isEqualTo(3); // add a…

  • PendingIntent requestCode getBroadcast useless doesn’t work

    Android PendingIntent requestcode on getBroadcast() method is useless.  It won’t be used at all for making a unique PendingIntent. Use other fields such as Data (Intent.setData(“someStringPerhapsInteger.valueOf(RequestCode)”)) to make your PendingIntent unique for use with AlarmManager for Notifications for example. http://stackoverflow.com/a/33203752/2301224

Got any book recommendations?