Posts

Windows Task Manager is lying to you, and I don't know how to make it stop

Image
If you use Windows, you might be intimately familiar with Windows Task Manager, which has a performance tab that shows the utilization percentage of various hardware in your system. Today, we're looking at CPU utilization. It looks a bit like this: The problem is that the meaning of the word utilization is very tricky. There can be multiple meanings: At the current time, with the current settings, what fraction of time is it executing instructions vs lying idle? At any time, with the most optimum settings, this CPU could practically complete a number a instructions at a certain rate. What percentage of that rate is it currently working at? I think the Windows Task Manager is currently using definition #1 above. This is useful for a person to look at the graph and understand "is there a runaway process on my system that is pegging my CPU"? However, consider the alternate use-cases: I am trying to run a long-running program, am I getting my money's worth out of this CPU

Setting coordinates in Phaser where the body and the sprite are offset from each other

Image
If you're using Phaser with matter physics , sometimes you might need to set a body of a different size from your sprite. That's pretty easy, simply by setting the width and height of the body. But if your physics body is offset from where the sprite is, then one has to use the setOrigin method to fix this. This can be tricky. This diagram might help explain how origin is used, where 'visual' is the sprite, and 'body' is the physics hitbox: And finally, if you do some algebra to find the origin, you can use the following code: // SPDX-License-Identifier: Apache-2.0 const visualX = 150; const visualY = 150; const visualWidth = 120; const visualHeight = 120; const bodyX = 200; const bodyY = 200; const bodyWidth = 180; const bodyHeight = 180; const originX = (bodyX - visualX) / visualWidth + 0.5; const originY = (bodyY - visualY) / visualHeight + 0.5; const sprite = this.matter.add.sprite(bodyX, bodyY, '

Laptop Surprises: Lenovo Yoga Slim 7i

I recently bought a Lenovo Yoga Slim 7i (Model 14ITL05). I really like it. I am trying to write down everything that surprised me about the laptop in here. These are mostly things that did not understand about the machine from the product page on Lenovo when ordering. I'll start off with the pleasant surprises: There is some sort of radar sensor on the top on the screen, in the webcam area. When I come and sit on my chair in front of the laptop, it wakes the screen and then Windows Hello logs me in with face ID. This is great! There is a feature called Battery Conservation Mode . What it does is: it pauses charging the battery when it reaches somewhere between 55 and 60%. So you can get the full performance out the CPU without adding a lot of wear on the battery. It allows the CPU to go to full performance with all the wattage coming from the AC adapter without worrying about battery wear. However, I would like to know more about this, and exactly why the battery percent

How not to make customers happy

Image
I recently moved to Bangalore and subscribed to Vodafone. About a week and a half into the subscription, I get this SMS at 5:45 am, clearly designed to be as missable as possible. I hadn't subscribed to any such service. This seems flat out illegal. Anyway, I followed the message and immediately sent a STOP to the number. What followed is a hilariously intentionally vague UX: What do you have to respond? I was almost tempted to respond with "1, 2, 3" but instead did the 'logical' thing and punched in 1. I got a confirmation that it has been disabled. I have no idea what the silk service is, or whether I will be charged for it in my next bill. Let's see. EDIT: They did charge me for it, but I was able to call customer service and reverse the charge. It turns out that the imgur app for Android was injecting bad ads in the background that signed up the device for these things. My suggestion: do not use the imgur app on vodafone mobile data.

Trouble installing KB2881553

EDIT: The error is back :( These instructions did not help. EDIT 2: The error is mysteriously gone :) I think Microsoft did some magic on their end. I am back on automatic updates! For a long time, I was having trouble installing KB2881553: Update for the English Input Personalization Dictionary on Windows 8.1. These are rough notes on how I resolved it . The problem: KB2881553 is supposed to be only offered on machines that have a touch keyboard with lots of usage. I think it was offered on my desktop accidentally, because I also use a tablet PC with touch on the same Microsoft Account. If you hide the update, it doesn't go away, because a new version of the file is offered on Windows Update within a few days, on the same KB number. The error code was 6B2. The solution: I was mostly guided by this very helpful post . The gist of the problem is that the previous update .msi cannot be found, so you have to convince Microsoft that either (i) your package is up to

Dark Fonts and Colors for light theme in VS 11

Image
Update: The VS 2012 Color Theme editor has a lot more options and subsumes the functionality of this settings file. Check it out! ——————————————— Visual Studio 11 comes in two themes: dark and light. I like how the code looks in the dark theme (since it is easy on the eyes), but I like how the menus and toolbars look in the light theme (the buttons look sufficiently different from each other.) So if you want to use the colors and fonts of the dark theme with the light theme UI, you would think you could just export out the fonts, change the theme, and import them back in. However, this has the bizarre side effect of causing all the fonts to become bold. So I went into the theme file and manually changed all the BoldFont="Yes" invocations, and finally I have a theme I like. You can download this settings file if you like, it has only the Fonts and Colors, so it should not mess up any of your other settings. Download Visual Studio 11 Dark Fonts and colors settings fi

Rhyming Harry Potter kweezz

A long time ago, I had made a Rhyming Harry Potter kweezzz. It was archived on kweezzz.com, but it has since been domain squatted. So I decided to post it here for safekeeping, thanks to archive.org for the data. Theme: Harry Potter Rhyming Quiz (All questions will rhyme, the answers may or may not) Date: 16th Oct, 2010 Kweezzz-master: @sushovande