How I learned about Google Play App Signing Keys.

Recently, I received an email from Google Play services. “Your app has been removed from the Google Play Store for a policy violation”, or something like that. How odd, I thought. I don’t remember doing anything against their terms of service. The email revealed that I didn’t have a valid privacy policy inside the app or on the store listing.

Oh. Right.The GDPR fiasco. It was time to write some privacy policies. After doing so, I began the process of digging up old files to old apps to make the necessary changes to the code. After about 2 hours of reinstalling Android Studio (my hard drive was wiped as some readers may remember), I began the arduous process of exporting the app from Unity to an .APK.

Eventually, I was able to upload the finished .APK to Google’s servers. However, the Play Console threw an error at me; “The signatures do not match”. Wait, what? It’d been too long since I’d actually done this process. I googled the error and broke out into a cold sweat.

Apparently, you generate a .keystore file upon first creating an Android app to sign the application with. It prevents people from uploading versions that aren’t from you I guess? In the unlikely event that a developer’s account got hacked, or something. There was no way to recover said .keystore file if you didn’t have it anymore, meaning there was no way to update my app. Ever. A full, in-depth system scan revealed no .keystore files. Luckily, with the two brain cells that were still functioning, I managed to remember that the other day I had deleted the app-which-I-was-updating’s Android version off my hard drive, because there was no real difference between the iOS and Android version, and I thought it was redundant. Perhaps it was in there?

I checked my Recycle Bin and breathed a sigh of relief. I hadn’t emptied it. It was still there. Opening the folder, the first thing I saw was a “user.keystore” file at the very bottom of the file list. A quick test later confirmed that was the one. Phew.

Apparently those things are important. Don’t lose ’em, kids.


HEY, LISTEN! It’d be really cool if you checked out the app here on the play store, since it just got updated. 😉


My Patreon | My Website

What is Ray Tracing?

With the advent of Nvidia’s new GPUs coming out, the inevitable question was asked of me by friends: What is ray tracing?

Over the past decade or so, graphics in video-games have made enormous leaps and bounds, and it’s now trivial to simulate hundreds of thousands of physics objects all at once with a very standard graphics card. However, the huge leaps in processing power have slowed somewhat, and now small tweaks and improvements to what we already have are being made. This includes hair, water, and light.

Light is one of the hardest things to simulate correctly. There are many ways to fake it, and game developers have gotten very good at certain techniques to make you believe that the sun is over there and casting shadows here, and so on. However, ray tracing is a method that attempts to actually simulate the behavior of the photons of light. Sounds cool, right? You can imagine how intense of a calculation that would be for many light rays. Because of this, it’s not possible for a real-time rendered game or simulation to process it quickly enough to display on a normal computer. Ray tracing is currently only used in pre-rendered films or animations.

Without going into the actual physics of how light and photons work, interesting read here, ray tracing is an expensive operation (takes a lot of computational power). Nvidia is taking steps to make it more feasible and possible in the future by providing “ray tracing upgrades” to their graphics cards. We will have to wait and see how much of an actual improvement they’ve made.


My Patreon | My Website

I’ll stick to ice cream.

I code stuff. That means it’s expected that I drink coffee. I’d like to, but I’ve never gotten around to trying it.

I came close the other day, however. I was walking with an old friend to a small coffee stand right outside where I was taking classes. Standing to the side while she ordered, my eyes quickly took in the delicious looking menu of different ways to drink your coffee. “Raspberry Mocha”, “Irish Mint Frappuccino” (which is apparently frappe and cappuccino put together, who knew), and “Blueberry Cream” jumped out at me. That sounds delicious, I thought longingly, in a wistful sort of way. Plus, I am pretty tired right now.

Even to someone who doesn’t drink, that looks good. There’s something about steaming hot drinks that’s comforting in a way. I imagine the taste to be something akin to coffee ice cream, even though I’ve only had that once. I’ve been informed by my friends that I’m completely incorrect, but that won’t spoil my fantasy. Iced coffee sounds even better.

I’m afraid to start, now. I don’t have the money to buy a new graphics card, let alone coffee all the time to feed my addiction. I’ll leave the coffee drinking to the pros, and stick with my ice cream.


My Patreon | My Website

How to ask good Stack Overflow questions.

Many programmers have low opinions of Stack Overflow. For those of you who don’t know, Stack Overflow is a Q&A site meant specifically for coders. However, it has a reputation for… how shall I say it… being a bit of an elitist gatekeeper-esque very beginner unfriendly place. On the flip side, Stack Overflow is the largest repository of developer answers and questions on the internet, and it’s one of the most visited websites for coding questions by developers, if not the most.

Continue reading How to ask good Stack Overflow questions.


My Patreon | My Website

A small PSA.

This morning, I received an email from a scrambled Outlook email address that claimed they had explicit recordings of me and to pay them Bitcoin. Their proof? A password of mine from a few years ago. They’d probably acquired it in one of the numerous database leaks that happen all the time. Here’s the message with sensitive information removed:

I do know, [OMITTED], is your password. You do not know me and you're most likely thinking why you are getting this mail, right?

In fact, I actually setup a malware on the adult vids (sexually graphic) site and do you know what, you visited this website to experience fun (you know what I mean). While you were watching video clips, your internet browser began functioning as a RDP (Remote Desktop) with a keylogger which provided me with accessibility to your screen and cam. Immediately after that, my software gathered all of your contacts from your Messenger, Facebook, and email.

What exactly did I do?

I created a double-screen video. First part shows the video you were watching (you've got a nice taste lol . . .), and next part displays the recording of your webcam.

What should you do?

Well, in my opinion, $3900 is a fair price tag for our little secret. You will make the payment via Bitcoin (if you don't know this, search "how to buy bitcoin" in Google).

BTC Address: [OMITTED]
(It is cAsE sensitive, so copy and paste it)

Note:

You have one day in order to make the payment. (I've a special pixel within this e mail, and now I know that you have read through this email). If I don't get the BitCoins, I will, no doubt send your video to all of your contacts including close relatives, coworkers, and so on. Nonetheless, if I receive the payment, I will destroy the video immidiately. If you need evidence, reply with "Yes!" and I definitely will send out your video to your 12 friends. It is a non-negotiable offer, so please do not waste my personal time and yours by responding to this e mail.

There are a few things wrong here, which is why I immediately knew it was scam.

  1. A keylogger records keystrokes, it doesn’t provide people with the ability to look at my screen and webcam. There are methods to gain access to these, but it is not called a keylogger.
  2. I don’t have a webcam.
  3. Browsers do not have the authority to share my desktop.
  4. I don’t use Messenger or Facebook.
  5. I have 2 friends on my Facebook account, not 12.
  6. Numerous spelling mistakes all throughout the email.
  7. The generic mention of “adult vids”. Yeah, sorry. No.

But I do have to wonder how many others fell for, and do fall for this kind of scam. Always make sure your antivirus is up to date, use common sense, and make sure you keep your passwords updated.


My Patreon | My Website

I’m a fast learner.

Last post I complained about Unity’s apparent inability to garbage collect its own textures that it loads. I originally thought it was my problem, and wasted a lot of time trying to fix a problem that wasn’t there. Once I knew it was a Unity issue, I could build a workaround.

So when I ran into the error “Encryption and decryption failed”, I spent about five minutes looking through what I wrote before thinking, Hold on, last time it was Unity’s fault. Let me check that first. Guess what? It was a Unity issue.

To put it simply, TLS is a method of keeping your data safe from hackers or whoever. It stands for Transport Layer Security, and is updated from time to time to increase the security and implement new methods of encryption. Unity implements a version of Mono that does NOT have support for the latest version.

When was the version that Unity doesn’t support released? 10 years ago. Mhm. That was my reaction too. Implementing support for that wasn’t fun, and required some refactoring of my code to work around the issue.

If you stumbled upon this issue because you’re in the same conundrum, use the UnityWebRequest instead of the C# WebClient or WebRequest method. However, you have to run it in a Coroutine that can yield to the download, otherwise it won’t complete.


My Patreon | My Website

Memory leaks and Unity.

Last night, I dealt with an annoying memory leak issue on my YouTube Downloader. For those that don’t know what a memory leak is, basically my program used more and more memory, without ever freeing it, so it would eventually use all available memory on my computer. By memory, I’m talking about volatile memory, or RAM (Random Access Memory). Every single time I loaded an image into memory, the RAM usage would increase. I first noticed the problem when the application complained that it was out of memory. I export it as a 32 bit app so that the maximum possible audience is able to make use of it. However, one restriction of 32 bit apps are their limited use of RAM (4 GB). So that meant I was filling up 4 Gigabytes of RAM while trying to load a few images. That didn’t seem right. I exported it as a 64 bit application to check what was going on, and the Downloader filled up 15 GB of my RAM in about 4 seconds. Whoops. I started digging through my code. What was never getting freed? I tried manually calling the garbage collector. Nothing. I spent hours commenting out lines and lines of code, watching Task Manager like a hawk, seeing whether the code I had changed would make any difference. And the memory usage kept climbing. Eventually, it didn’t. Turns out it was a Unity function. After some more reading, it turns out that texture.LoadImage (replaced by ImageConversion.LoadImage) is not automatically garbage collected, for whatever reason. In fact, it’s never unloaded at all unless you call Destroy() on it. Once I set it up to Destroy the textures after they weren’t needed, the memory usage dropped to around 70MB instead after downloading the songs. Much better. In the process of trying to find the bug, I made my original code much more efficient, because I thought it was the issue at first. I’m not really sure what there is to learn from this, but it sure was frustrating.


My Patreon | My Website

How to change the refresh rate of your monitor dynamically.

I’m pretty insistent on things working how I see fit when it involves technology. I spent a while trying to figure out how to customize my start menu with custom tiles without using third party apps or routing the apps through another application. Eventually I figured it out, and the results look quite nice. The point is that when I want something done, usually if I can’t do it in the computer already, I create a way to do it.

I recently purchased a new laptop with a 144hz screen. It looks amazing, but I don’t want to run the 144hz on battery power, because usually on battery I’m simply browsing the web, reading reddit, or coding. However, if I plug my laptop in, that’s when I would be doing activities that would benefit from the extra hertz. Surely there’s a way to switch the frequency of the screen when I plug in the laptop, right? Wrong. Windows is missing what seems like pretty obvious things sprinkled all over the place. I hear a few people out there saying, “Well maybe it’s too difficult for them to add it! They have other things to work on, you know.” I would respond that perhaps you’re right, if it didn’t take them more than a year to fix a widespread stutter bug involving discrete GPUs. That’s a whole ‘nother story, but it’s quite annoying without a work around like TrayPwrD3. Anyway, I decided to fix it myself. Perks of being a software engineer. You know how long it took me to write a program to detect if you’re on battery and switch the screen frequency between 144 or 60 depending on the power state? About 30 minutes. Then another 30 to clean it up, make it a background process, and task Task Scheduler to run it upon connecting or disconnecting AC power. A few more hours to add a few other features and bug test it, and I had solved my problem.

Want it? No problem. Join my Patreon or just purchase it for $0.99 here. Documentation for said program exists here.


My Patreon | My Website

How to only run a program when your laptop is plugged in.

Here’s a tricky one. How do you run a program ONLY when your Windows laptop is plugged in? Additionally, you’d want it to automatically exit when your laptop was unplugged and you were using battery power. I recently stumbled across this problem when I wanted to run Rainmeter on my laptop when it’s plugged in.

The answer is to use the Task Scheduler.

Here’s what you’ll need to do.

  1. Open Task Scheduler.
  2. Click “Create Task…” under Task Scheduler Library.
  3. Name your task and give it a description.
  4. If your application needs admin privileges, make sure to check the box at the bottom, “Run with highest privileges”
  5. Open the Triggers tab at the top. Click “New…” at the bottom.
  6. Change the Begin the task value to “On an event”.
  7. Under “Settings”, change the radio button selection from “Basic” -> “Custom”.
  8. Click “New Event Filter…”.
  9. Disregard the “Filter” tab, and instead change the tab to “XML”.
  10. Check the box at the bottom that states “Edit query manually”.
  11. Paste this XML in:
<QueryList>
  <Query Id="0" Path="System">
    <Select Path="System">*[EventData[Data[@Name='AcOnline']='true']]</Select>
  </Query>
</QueryList>

Click “OK”, and then “OK” again.

Once back on the main page, you may now configure your “Actions” tab to launch your program of choice.

Once finished, proceed to the settings tab and make sure you have these settings:

 

Congratulations! You can now test it by plugging in your laptop and watching your program launch itself. Unplugging it should quit it instantly.


My Patreon | My Website