Alright, so let’s get to it: How to debug a realm database running on a physical device:
Unfortunately, you cannot debug a realm database running on a physical device if it is already in production.
Hopefully this saves someone out there a ton of heartache, but after you have pushed your app out in to production, you can’t just open up a .realm file from your device using Realm Studio due to security restrictions. So if you happen to find yourself struggling to open a realm database that’s running on your personal device, and can’t seem to access the .realm file to debug it, it could be that your device isn’t allowing access to the file because it is a production app and is not debuggable via USB and Android Studio, etc.
If you need to be able to debug and inspect Realm database instances running on live production versions of your app, this may be possible with Realm’s new Realm Cloud product. However, I haven’t checked out Realm Cloud and Realm Sync just yet as I’m still getting my feet wet with Realm DB.
Fret not distressed developer! Using the ON DUPLICATE KEY UPDATE feature of SQL with Python, MySQL, and mysql.connector can be a bit of a doozy once you add in parameterizing your queries. This personally took me quite awhile to figure out since most of the SQL references regarding ON DUPLICATE KEY UPDATE do not include the Python/mysql.connector specific aspects, and most of the Python/mysq.connector references do not mention ON DUPLICATE KEY UPDATE.
So here is the trick, you won’t be passing the SQL query values like usual with %s for the UPDATE part of your query. Instead you will write something like VALUES(name_column). For reference, here is a little snippet of code from one of my projects which should guide you in the right direction:
# Create MySQL Database Connection
host="22.214.171.124", # dummy ip address
"myTransactionType") # single tuple will hold one row worth of database data
Tonight I started hacking on an old project on which I’m currently bringing back to life, a chrome extension which saves all of the pages you visit to the Internet Archive’s Wayback Machine. It’s called The Internet Archivist’s Intrepid Extension.
After an hour or so of hacking I’ve put together a pretty simple prototype and thought maybe I should share the source code here on the blog in case anyone else is stumbling around the internet looking for a solution. Enjoy!
<inputid="urlInput" type="text" size="40" placeholder="Enter URL to Archive">
urlInput.value="";// clear url text input field
alert("ERROR 0001: PC LOAD LETTER");
return;// kill, do not run rest of function
// json data which we will be sending to the server via ajax
Your privacy is important to me. It is my (Christopher Pedersen) policy to respect your privacy regarding any information I may collect from you on my app, FatCamp.
I only ask for personal information when we truly need it to provide a service to you. I collect it by fair and lawful means, with your knowledge and consent. I also let you know why I am collecting it and how it will be used.
I only retain collected information for as long as necessary to provide you with your requested service. What data I store, I will protect within commercially acceptable means to prevent loss and theft, as well as unauthorized access, disclosure, copying, use or modification. I don’t share any personally identifying information publicly or with third-parties, except when required to by law.
My app may link to external sites that I do not operate. Please be aware that I have no control over the content and practices of these sites, and cannot accept responsibility or liability for their respective privacy policies.
You are free to refuse our request for your personal information, with the understanding that I may be unable to provide you with some of your desired services.
Your continued use of my website will be regarded as acceptance of our practices around privacy and personal information. If you have any questions about how I handle user data and personal information, feel free to contact me (email@example.com).
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with –verbose flag for more details.
Unable to install C:\Users\you\Desktop\YourApp\android\app\build\outputs\apk\debug\app-debug.apk
com.android.ddmlib.InstallException: INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.yourapp signatures do not match previously installed version; ignoring!
O man, what a doozy!?! Okay so here’s what’s probably going on, or at least what has been going on the several times I’ve run into this error. I happen to do development on several different computers, but use the same physical android device to test my app. So what happens is, the signature attached to the app installed on our physical android device, doesn’t match the signature of the computer that we’ve moved to and are now working.
However, the fix is fairly simple. All you need to do is delete the app from your physical device, then re-build/run your app again and all shall be well!
In this post I want to talk a little bit about HTTP vs HTTPS, the lock symbol or lock icon that appears next to your website’s address in the web browser, and how you can add all this encrypted goodness to your website for free with Certbot!
That’s it! Pretty nifty right?
I currently happen to be working on a personal finance app called Moolabeast at the moment, so that’s why I decided to publish this post. After releasing the latest version of the app I noticed a bug that was causing some of my financial transactions to format something like $ 34.089999999999996 , yikes! Thus the interest in this topic.
If you’d like a reference to play around with, check out my “definitive guide” below:
(UPDATE 11/26/2019: It looks like the regex was for adding commas, whoops! If you need commas, which I assume you do, check the last section of the code sample below for the regex magic.)
(UPDATE: 11/30/2019: The regex magic described above does not work with floating point numbers represented as strings. One could write a regular expression that does work with whole numbers, however, I’m not very good with writing regular expressions. Therefore, I’ve included a little function which I wrote in case anyone needs to add commas to whole numbers.)
Playing around with Redux this morning and didn’t like the fact that you have to use npm and whatnot to compile modules to run the simple example? Seemed overly complicated, so here’s a little demo with no compilation or development server required: