Kirsle.net logo Kirsle.net

Tagged as: Rant

Time Zones
August 3, 2018 by Noah

Probably one of the most frustrating things to deal with as a software developer is time. Specifically time zones and daylight savings time and all that nonsense. Tom Scott has a video about it but I have a recent story of my own.

This week at work, we lost about two days of effort trying to make our web application timezone-aware. Apparently, time zones are so ridiculously complicated, that it's basically impossible to store a time with an arbitrary time zone in your database while remembering what the time zone is.

Don't believe me?

The web stack in this story involves JavaScript, Python and PostgreSQL, with PostgresSQL's problems being applicable to any backend stack.

Read more...

Tags: 0 comments | Permalink
Music Management
July 29, 2016 by Noah

Manually managing a music collection of MP3 files on disk is such a pain in the ass that I felt like blogging about it.

First, you have cloud music services like Google Play Music which can't detect duplicates properly.

Read more...

Tags: 4 comments | Permalink
Principle of Least Astonishment
March 22, 2016 by Noah

In user interface and software design, the principle of least astonishment states that "if a necessary feature has a high astonishment factor, it may be necessary to redesign the feature." It means that your user interface should behave in a way that the user expects, based on their prior knowledge of how similar interfaces behave.

This is a rant about Mac OS X.

Read more...

Tags: 0 comments | Permalink
Event Loops
November 27, 2015 by Noah

This is something I wanted to rant about for a while: event loops in programming.

This post is specifically talking about programming languages that don't have their own built-in async model, and instead left it up to the community to create their own event loop modules instead. And how most of those modules don't get along well with the others.

Read more...

Tags: 0 comments | Permalink
Brief GNOME 3.14 Review
December 18, 2014 by Noah

I jumped ship from GNOME 2 to XFCE when GNOME 3 was announced and have ranted about it endlessly, but then I decided to give GNOME 3.14 (Fedora 21) a try.

I still installed Fedora XFCE on all the PCs I care about, and decided my personal laptop was the perfect guinea pig for GNOME because I never do anything with that laptop and wouldn't mind re-formatting it again for XFCE if I turn out not to like Gnome.

After scouring the GNOME Shell extensions I installed a handful that made my desktop somewhat tolerable:

Screenshot (Click for bigger screenshot)

And then I found way too many little papercuts, some worse than others. My brief list:

Settings weren't always respected very well, and some apps would need to be "coerced" into actually looking at their settings. For example, I configured the GNOME Terminal to use a transparent background. It worked when I first set it up, but then it would rarely work after that. If I opened a new terminal, the background would be solid black. Adjusting the transparency setting now had no effect. Sometimes, opening and closing a tab would get GNOME Terminal to actually read its settings and turn transparent. Most of the time though, it didn't, and nothing I could do would get the transparency to come back on. It all depended on the alignment of the stars and when GNOME Terminal damn well feels like it.

Also, I use a left handed mouse, and GNOME Shell completely got confused after a reboot. The task bar and window buttons (maximize, close, etc.) and other Shell components would be right handed, while the actual apps I use would be left handed. So, clicking the scrollbar and links in Firefox would be left-handed (right mouse button is your "left click"), and when I wanted to close out of Firefox, I'd instead get a context menu popup when clicking the "X" button. Ugh!

I wanted to write this blog post from within GNOME but it just wasn't possible. With different parts of my GUI using right-handed buttons and other parts using left-handed ones, I had context menus popping up when I didn't want them and none popping up when I did. After a while I thought to go into the Mouse settings and switch it back; this didn't help, instead, the parts that used to be right-handed switched to left-handed, and vice versa. It was impossible to use. I just had to painstakingly get a screenshot off the laptop and to my desktop and deal with it over there instead.

These things just lead me to believe the GNOME developers only develop for their particular workflows and don't bother testing any features that other mere mortals might like to use. All the GNOME developers are probably right-handed, and they have no idea about the left-handed bugs. All of the GNOME developers don't use transparency in their terminals, evidenced by the fact that the transparency option disappeared from GNOME 3.0 and only just recently has made a comeback (in GNOME 3.12/Fedora 20).

XFCE is going back on this laptop.

Tags: 0 comments | Permalink
Android can apparently delete your Camera folder without warning
August 11, 2014 by Noah

So I took a few pics with my Nexus 5 this morning, and when viewing them in the Gallery app they appeared to have not saved correctly (there was a solid dark grey placeholder image for each one I took). If I opened the Camera app and swiped over to see them, there they were. But the Camera app also popped up a toast saying "Insert an SD card to save photos."

The Nexus 5 has no SD card.

And then I probably shouldn't have rebooted my phone (the Camera was being an idiot, so I thought rebooting would fix it), cuz when the phone came back up, the Camera folder was entirely deleted. Like, it didn't show up in the Gallery, and swiping in the Camera app did nothing. /mnt/sdcard/DCIM/Camera didn't exist anymore. Take a new picture, and the Camera folder was remade but only had the one new picture in it.

So, Life Pro Tip: Android can do this sometimes. If you get those kind of symptoms, hopefully try making a backup of the Camera folder (using like Astro or Root Browser), before rebooting the phone. You'll probably still lose the newly taken/corrupted pictures but at least Android shouldn't delete all your other camera pictures.

I think the Camera app was still able to see the pictures even though they weren't saved because they were kept in some sort of temporary in-memory cache of the Camera app. Probably the best way to save them would've been to take screenshots of them from within the Camera app.

All the other folders that had pictures in them were left alone, i.e. pictures saved through Snapchat and other photo albums.

Update:

I used a recovery program to restore all the deleted photos/videos on my phone. Site I used. Some of the pictures were corrupted but I was able to get all the ones I cared about back. :) Most of the deleted files were Snapchats that I already had non-deleted copies of.

Also, the selfies that I took this morning that "caused" this whole entire mess were recovered as well, so that's double-good-news. :P One of the pics that literally broke my camera:

Pic that literally broke my camera

Tags: 0 comments | Permalink
My ISP is cheating on speed tests
June 5, 2013 by Noah
My ISP in Los Angeles is Time Warner Cable, and I'm pretty sure they're cheating on my speed tests. I pay about $39 a month for either 15 Mbps down or 20 (I don't remember which), and when I run speed tests on sites such as speedtest.net, I always get a download speed between 15 and 20, usually around 17 on average.

But, the entire rest of the Internet totally sucks. I'm using Google's DNS (because Time Warner Cable's have been absolutely useless, like making me wait several minutes just to resolve a domain name), so that's not part of the problem either. It seems also that on the general Internet, the entire network drops in pulses every 30 seconds for 5 seconds at a time. So if I'm on Reddit, and click to expand a dozen imgur links with my RES extension... all of the links take a while to load, and then all of a sudden they all load at the exact same time.

I was reasonably sure that Time Warner Cable was using traffic shaping to "put on a good show" for Speedtest.net, and throttling my network speeds for all the other sites. So that if I called and complained about my slow Internet, they'd say "go to Speedtest.net and see for yourself that you're getting your 15-20 megs down that you're paying for" when instead, they're cheating on speed tests and slowing me down on every other site in the world.

I just had to find a way to prove it. The idea I came up with was to proxy my speed test through a fast web server. My web server, though, wouldn't cut it. My server got 900 megs down, but only like 12 megs up... which I thought was absurd, because a web server's entire purpose in life is to upload web content to the end users. A server's upload speed is the bottleneck that controls your maximum download speed when downloading data off of it.

I migrated to a new web server that gets much better results on speed tests, and its upload speed is higher than my quoted download from my ISP. So, I used it to try and test whether my ISP is cheating on me.

The tools I used: speedtest-cli, a command line Speedtest.net client (so I don't have to worry about trying to proxy Adobe Flash traffic, which is notoriously difficult to do), and proxychains, a Unix tool that lets you force any other program through a proxy regardless if the program wants it or not. This way I could proxy speedtest-cli to run through my web server instead of directly hitting up Speedtest.net.

My web server is hosted in Kansas City, MO, which is a bit of a drive away from Los Angeles, so to remove any geographical bias from the equation, when I ran my speed tests from my web server, I selected Speedtest servers here in Los Angeles. This showed me that my web server was able to download and upload reasonably fast from Kansas City to LA, and that the opposite should be true as well.

Hypothesis:

Time Warner Cable is aware of the entire list of Speedtest.net servers, and when it sees traffic downloading or uploading to one of these servers, they shape the traffic to give you your quoted speeds. All other servers besides these on the list, they slow your traffic speeds immensely.

Expected results:

Assuming my ISP was honest, I would expect my speed test running through proxychains to be similar (perhaps a couple megs less) than a direct speed test, given the overhead of an SSH socks tunnel and network travel between my apartment and my server in Kansas City.

Experiment:

Run a Speed Test by proxying through a third party server that Time Warner Cable is not aware of, in such a way that the ISP does not know I am running a speed test, and therefore they do not know to shape my traffic in a way that gives me my quoted transfer speeds.

I'll let the results speak for themselves (note: I'm hosting these images here locally because I'm not sure speedtest.net hosts the results on their server forever. Clicking the images though will take you to the link that speedtest.net gave me). I did two rounds of tests for redundancy.

  • PC Speedtest: A speed test from my local PC to a local Speedtest server in Los Angeles.
  • Server to LA: A speed test from my server in Kansas City to a Speedtest server in Los Angeles.
  • Proxychains: A speed test from my local PC, proxied through my server in Kansas City, to a speed test server near Kansas City (local to the server).
PC Speedtest Server to LA Proxychains
PC PC PC
PC PC PC
I also ran a non-scientific test of simply downloading a very large file from my web server (I picked the Android 4.0 VirtualBox ISO from one of my blog posts which weighs in at 243 MB). The download speeds shown in wget initially spiked to about 500 some entire kilobytes per second (about 4,000 kilobits or 3.9 megabits) before quickly dropping to between 100 and 200 KB/s (or 800-1600 kilobits/s) for the remainder of the file transfer. Overall it took 22 minutes, 46 seconds to download. Given my quoted download speed of ~17 Mbps, and my server's upload speed of 35 Mbps upload to Los Angeles, this is inexcusable.

For those who like the dirty details, I copy/pasted my terminal outputs from speedtest-cli and you can see them here: speedtest-cli.txt. So you understand what you're looking at:

  • The hostname aerelon is my local PC.
  • The hostname debian is my web server.
  • The command proxychains ./speedtest-cli --share is me running the proxy through my web server.
My proxychains configuration, less comments:
[kirsle@aerelon ~]$ cat .proxychains/proxychains.conf | grep -v '^#'
strict_chain
quiet_mode
proxy_dns 
tcp_read_time_out 15000
tcp_connect_time_out 8000

[ProxyList]
socks5	127.0.0.1	8080
Where 127.0.0.1:8080 is a SOCKS5 proxy over SSH to the web server.
Tags: 10 comments | Permalink
Windows 8 Rant
April 18, 2013 by Noah
So, I thought I liked Windows 8 a bit. The OS itself isn't absolutely horrible once you get used to it. I even bought the $40 upgrade to Windows 8 for my main PC, where I promptly spent 100% of my time on the desktop and not in the Metro apps. ;)

But, I just bought my first computer that actually had Windows 8 preinstalled on it: a Samsung Series 5 Ultrabook. It has a touchscreen and some nice features, and I wanted to dual-boot Windows 8 and Fedora Linux on it (giving Windows the smaller half of the hard drive, of course). Microsoft apparently went to great lengths to make this darn near impossible.

I came to find out, when you have Windows 8 pre-installed on your computer, it's probably the Windows 8 "Core" Edition. The only Win8 install DVD I had laying around was the Professional edition that I bought for $40. It was logical to me that I should be able to hopefully reinstall Windows 8 on the ultrabook from this DVD, maybe even using the same OEM product key that the laptop came with and not having to worry about any activation issues.

Apparently, Windows 8 PCs have their product keys "baked in" to the BIOS ROM. If you boot a Windows 8 installer of any edition, the installer looks for this product key in the ROM, and if the key is for a different edition than what the installer is intended for, it gives you some ugly error message about, "The product key you entered doesn't correspond to any of the install images. Enter a different product key." -- except it doesn't let you enter a product key anywhere, and just restarts the setup process from the beginning.

There also apparently is no Windows 8 Core ISO floating around the Internet -- not one that I would trust downloading, anyway. With the baked-in product key, the only Win8 installer that would work would be a Core edition installer, which doesn't exist. You can't install Windows 8 Pro on your computer, because the installer simply won't allow it.

Long story short, Microsoft has basically forced me to forego dual-booting completely and just install Linux on the entire hard disk. The built-in Windows 8 OS came bundled with a bunch of Samsung's crapware, and there's no way to "start fresh" with Windows 8 -- your only option of "reinstalling" is to use the Control Panel feature, which restores "to factory settings", which means your Samsung crapware is still gonna be there after the reinstall is done. And you can't install from scratch from a DVD for the aforementioned reasons.

You can even completely remove Windows 8 from your computer, maybe install Windows 7 or Linux across the whole drive, and you still won't be allowed to put Windows 8 back on there from an install DVD or USB again.

There is a workaround, though: if you make a bootable USB for Windows 8, you can add a text file to it where you specify the product key to use. For me to do this, however, I'd need to buy an additional Windows 8 Pro license, and that's not worth it to me. So, good riddance Windows 8, I don't care to have you on my ultrabook anymore, anyway.

Tags: 4 comments | Permalink
Linux of the 90's
September 27, 2012 by Noah
Let's look at some very, very old* desktop environments, which lack in some features we've had for at least a good decade now.

Gnome Shell

What sorts of things does this clunky old desktop environment not allow us to do, which every other desktop does (and has for a decade)?

  • We don't have a customizable panel. There's a panel on the top, and it stays there; can't be moved, hidden, changed in any way...
  • We can't change the widget (GTK) themes on the fly. The desktop environment itself provides no way of changing the theme at all, and changing it via a third-party tool requires you to log out of your desktop and back in for the change to take effect. How old school is that!
  • The same goes for the window manager theme. Every other window manager in the history of ever lets you re-theme it "live" without logging out. Not good old Metacity, though!
That's enough ragging on this one, let's look at another one!

Cinnamon

This one is based on Gnome Shell. Some people didn't like Gnome Shell and they wanted to make it look and feel like a more functional desktop environment known as Gnome 2. So let's compare it to that!

  • Oh no. The panels aren't hardly configurable. You have 3 options: one panel on top, one on bottom, or both. And changing that setting requires you to log out and back in. How ancient.
  • Panel applets? I hope you only want one of each applet, and that you're fine sticking them into pre-designated slots on your panel. You can't customize them beyond that. The applets don't even have their own settings--your app menu will say "Menu", and you can't change that.
  • Metacity strikes again! You can't change the window manager theme without logging out and back in.
Wait, what ever happened to Gnome 2, anyway? I used to like that guy!

Actually...

*These desktop environments aren't very old at all. They're current. Gnome Shell is the default desktop environment of Fedora, and Cinnamon is one of the defaults of Linux Mint. And who's really at fault for these two desktop environments being so 1995, anyway? The GNOME dev team of course!

Gnome Shell is just so, so awful that Cinnamon was spawned as a way to get a more traditional (read: Gnome 2-like) desktop environment out of the utter mess that is Gnome Shell, except that Shell's bad design decisions are rotten to the very core and Cinnamon has to suffer for it as well.

Just to pick on one specific problem, Metacity no longer supports re-theming the window manager without logging out and back in. How many window managers in the world follow this behavior? Let's count them:

  1. Metacity 3.x
Oh? And which window managers do allow being re-themed live?
  • Metacity from Gnome 2 and back
  • XFWM4 (the window manager for XFCE)
  • KWin (window manager for KDE)
  • OpenBox, Blackbox, Fluxbox, FVWM, . . .
That's right, damn well every single one of them.

I was very impressed with the MATE desktop environment when I tested it on Linux Mint... it is the exact same Gnome 2 that I used to love. The panels behaved the same way (read: fully effing configurable and requiring no log-outs to see your changes take effect), it had all the same applets and didn't come with the high-and-mighty "we know better than you and you may have ONE of each applet at most" attitude that Cinnamon has... and it doesn't use Metacity 3 so that all kinds of theming takes effect immediately.

So there's MATE, XFCE, KDE, LXDE and a good handful of window managers that exist here in the 21st century, and then there's Gnome Shell, and by extension Cinnamon, stuck back in 1995 which is the only place that their lack of features can possibly fit in.

</rant>

Tags: 3 comments | Permalink
Chrome's Omnibar
June 28, 2012 by Noah
I don't understand why people all over the Internet like to talk up the omnibar in Google Chrome and say how much better it is than everything else out there (the omnibar is Chrome's address bar). They say it's better than Firefox's, and I'm absolutely sure that everybody who thinks so has never used Firefox. Here's why.

What does Chrome's Omnibar do for you? It lets you type in URLs to websites like any other address bar, and it lets you search Google by typing in a search query instead of a URL. Oh and when you're typing the URL to a page you frequently visit, it auto-completes it for you. Is that all?

Well, Firefox's AwesomeBar (their word for the same feature) does all of the above just as well, and then some. Want to search Google? Just type in your search query. It all works exactly the same way as Chrome. Firefox has been doing this before Chrome even existed. Auto-completing URLs? Firefox does this too.

But then Firefox goes way beyond. You saw a post on Reddit 5 months ago, and you know it's somewhere in your history and you wanna find it? Just type one or two words that appeared in the page title. Firefox's AwesomeBar will show suggested results as you type based not only on the URLs, but also on the page titles. Bam. You can find any page in your history just by typing a word from the title. With Chrome, the only way to find an old page is to begin typing its URL out. This requires you to know a lot more about the link than you need to know for Firefox.

For a Reddit example, say you want to look up a post you saw recently about the Galaxy Nexus Android phone. Was it posted to /r/android? Or was it /r/technology? Maybe it even was mentioned on /r/apple? You don't remember, you just remember the post was about the Galaxy Nexus. Just type "galaxy" in your AwesomeBar and you'll probably find the link in 2 seconds or less. With Chrome, you'd have to begin typing out, "reddit.com/r/android" and try all the various subreddits that it might have been posted to. You're better off opening the history window and searching for it. There's just no easy way.

Firefox 1, Chrome 0.

Tags: 1 comment | Permalink