Posts on Pleasant Programmer https://pleasantprogrammer.com/posts.html Recent content in Posts on Pleasant Programmer Hugo -- gohugo.io en-us Thu, 16 Aug 2018 23:03:05 +0900 ISP Issues https://pleasantprogrammer.com/posts/isp-issues.html Thu, 16 Aug 2018 23:03:05 +0900 https://pleasantprogrammer.com/posts/isp-issues.html At the first office I worked at, we had 2 different ISPs. This was supposed to be for reliability, as one was fast but spotty, and the other was slow but reliable. Since they weren’t too expensive, we just went and got both. We have monitoring setup to watch our office IPs from the outside so we could see how often the connection goes down. The interesting thing we found was that the fast and spotty connection had perfect uptime. Audventure https://pleasantprogrammer.com/posts/audventure.html Sun, 19 Nov 2017 22:00:00 +0800 https://pleasantprogrammer.com/posts/audventure.html Sometime around 2013 I wrote a clone of the GBA game bit Generations SoundVoyager called audventure. SoundVoyager is actually a collection of mini-games where sound is the main focus. You can actually play the game blind, and at some point, that’s pretty much what happens. sound catcher The signature mini-game in SoundVoyager is sound catcher. In the mini-game, you can only move left and right at the bottom of the stage, while a “sound” falls from the top. OpenPrepPad https://pleasantprogrammer.com/posts/openpreppad.html Sun, 15 Jan 2017 19:31:00 +0800 https://pleasantprogrammer.com/posts/openpreppad.html Smart electronics and IoT (Internet of Things) are all the rage these days. You have a lot of companies sprout up trying to make the next big thing, which also leads to a lot of failures big and small. Pebble, the maker of my smartwatch, got bought out by Fitbit recently. This left watch owners without any official support, but thankfully, community members stepped up to continue maintaining it. Haproxy Charset https://pleasantprogrammer.com/posts/haproxy-charset.html Fri, 24 Jun 2016 00:00:00 +0000 https://pleasantprogrammer.com/posts/haproxy-charset.html A common problem we encounter is for things like ñ not showing up correctly. This actually caused some issues in the recent Philippine elections, but this isn’t about hash codes or anything like that. By default, we use UTF-8 for text storage and rendering. A problem is that browsers don’t assume UTF-8 as the default and you need to have either a <meta charset="utf-8" /> in the HTML or Content-Type: text/html; charset=utf-8 in the headers. Cloudflare Shenanigans https://pleasantprogrammer.com/posts/cloudflare-shenanigans.html Fri, 25 Dec 2015 00:00:00 +0000 https://pleasantprogrammer.com/posts/cloudflare-shenanigans.html An old client of ours managed to convince a telco to zero-rate the data for their app. In order to whitelist it though, we needed to use plain HTTP for domain whitelisting. For HTTPS, they can only whitelist by IP address. Like any good developer, we were using HTTPS. Also, like any good developer, we put our server behind Cloudflare. Now the problem is that Cloudflare can put you behind any IP they own, which is a huge range. TiddlyWiki in the Sky (or TiddlyWeb for TW5) https://pleasantprogrammer.com/posts/tiddlywiki-in-the-sky-or-tiddlyweb-for-tw5.html Thu, 24 Dec 2015 00:00:00 +0000 https://pleasantprogrammer.com/posts/tiddlywiki-in-the-sky-or-tiddlyweb-for-tw5.html I’ve always liked TiddlyWiki. Back when it first came out, it was really amazing. A wiki all in one file, that worked in the browser. It didn’t need a backend, it would just save itself as an all new HTML file with all your posts inside. I’ve used it a lot over the years, as a personal wiki/journal and a class notebook. I even had a blog with it at one point using one of the server-side forks. Is My Terminal Window Active? https://pleasantprogrammer.com/posts/is-my-terminal-window-active.html Sun, 07 Jun 2015 00:00:00 +0000 https://pleasantprogrammer.com/posts/is-my-terminal-window-active.html I’ve been working in OSX for almost 3 years now, but I recently switched back to Linux because of all the problems people encountered with Yosemite. There are some things I missed from OSX though. One of which is zsh-notify. It’s a zsh plugin that alerts you if your long-running task is complete, and whether it failed or not. It’s pretty convenient when you’re compiling something and then go on to browse reddit while waiting. Removing PLDTMyDSLBiz from the ZyXEL P-2612HNU https://pleasantprogrammer.com/posts/removing-pldtmydslbiz-from-the-zyxel-p-2612hnu.html Wed, 27 Nov 2013 00:00:00 +0000 https://pleasantprogrammer.com/posts/removing-pldtmydslbiz-from-the-zyxel-p-2612hnu.html I’ve always thought that people were just too lazy to change their SSIDs when I see “PLDTMyDSLBizCafeJapan”. It became apparent when we got our own PLDT line that it was because the bundled router/modem does not allow you to remove the prefix. This is not the kind of thing you expect as a business customer. Even for home customers, I feel it’s still a bit dishonest. I’d be fine if it was just the default SSID, but forcing people to have it as part of their SSID is like advertising that your company (I mean PLDT) is a douche. Console Keymap Switching https://pleasantprogrammer.com/posts/console-keymap-switching.html Tue, 29 Oct 2013 00:00:00 +0000 https://pleasantprogrammer.com/posts/console-keymap-switching.html At the office, we have some people who use DVORAK. Normally, this isn’t a problem. To each his own after all. It does become a bit problematic though, when we’re dealing with the servers around the office. We normally leave the servers on QWERTY. After all, most people start off as QWERTY typists and migrate to something else. That said, it’s apparently difficult to stay fluent in both. People tend to forget how to type in QWERTY once they learn DVORAK or something else. Geocoding Services https://pleasantprogrammer.com/posts/geocoding-services.html Wed, 25 Sep 2013 00:00:00 +0000 https://pleasantprogrammer.com/posts/geocoding-services.html A key component for any routing service is being able to do geocoding. Most people who are looking for routes most probably don’t know exactly where their start and end points are on the map. Even then, manually looking for a location on a map is a time-consuming task. The gold standard for doing geocoding right now is Google Maps. It’s hard to find a better location search experience. If they actually provided routing for jeeps here in the Philippines, I imagine there wouldn’t be that much you could do for the competition. Jeep and Bus Schedules https://pleasantprogrammer.com/posts/jeep-and-bus-schedules.html Sun, 28 Jul 2013 00:00:00 +0000 https://pleasantprogrammer.com/posts/jeep-and-bus-schedules.html Wouldn’t it be wonderful if there were no buses or jeepneys in the Philippines over the weekends? It would truly be a cyclist’s paradise. Imagine biking along EDSA, normally that would be a death sentence, but according to the GTFS data, you shouldn’t worry. I can assure you, it’s still a death sentence. The GTFS spec defines 2 ways of statically specifying trip schedules. You can define the exact times that a service will arrive at a stop. Highways in OTP https://pleasantprogrammer.com/posts/highways-in-otp.html Wed, 24 Jul 2013 00:00:00 +0000 https://pleasantprogrammer.com/posts/highways-in-otp.html One of the weird things that happens with OTP is sometimes it gives absurdly roundabout routes. Here is OTP’s suggested route for walking from UP to Ateneo: This is just so hilariously wrong. It’s much simpler to just walk along Katipunan Avenue. OTP couldn’t possibly be that dumb though, so there must be something we’re doing wrong. If you notice, Katipunan Avenue is colored red compared to the other streets. OTP seems to be avoiding any path that goes along Katipunan Avenue. Elevation Data in OTP https://pleasantprogrammer.com/posts/elevation-data-in-otp.html Tue, 23 Jul 2013 00:00:00 +0000 https://pleasantprogrammer.com/posts/elevation-data-in-otp.html One thing I hadn’t tested out last time was OTP’s support for elevation data. It makes use of this by showing the elevation you have to traverse while walking along the suggested route. It can also take it into account when suggesting bike routes. The 5 minute tutorial actually discusses the elevation data briefly, but a more in-depth thing you can look at is the GraphBuilder documentation. It suggests using the ASTER dataset which is free but requires registration. GraphServer https://pleasantprogrammer.com/posts/graphserver.html Tue, 23 Jul 2013 00:00:00 +0000 https://pleasantprogrammer.com/posts/graphserver.html Link: http://graphserver.github.io/graphserver/ One other routing webapp I saw was GraphServer. It’s actually more of a general purpose Graph library which supports GTFS and OSM data than an actual dedicated routing software like OpenTripPlanner. It’s also based off python and C instead of Java, so it feels a lot less heavy. The instructions on the website are already pretty good. There are just some minor errors with it. Where it says gs_gtfsdb_build, you should actually use gs_gtfsdb_compile. Transit Wand https://pleasantprogrammer.com/posts/transit-wand.html Mon, 15 Jul 2013 00:00:00 +0000 https://pleasantprogrammer.com/posts/transit-wand.html Link: http://transitwand.com Overall, this was the simplest of the open-source transit tools to actually get up and running. There’s already a deployed instance of the server, and you can easily download the phone app via the Play Store. Even running the server by yourself didn’t have any of the hiccups I had with GTFS Editor. The phone app is actually quite simple. It allows you to capture a trip, which will record your GPS coordinates as you ride public transit. Fare Data https://pleasantprogrammer.com/posts/fare-data.html Sat, 13 Jul 2013 00:00:00 +0000 https://pleasantprogrammer.com/posts/fare-data.html As part of the data released by the DOTC, we also have the fare matrix for aircon buses, ordinary buses and jeeps. All as wonderful images. The data is also actually available from the LTFRB website. Generally, the fare scheme is represented as “pay X pesos for the first Y kilometers, pay Z for every succeeding kilometer.” Instead of a table, we can simply represent this as a formula instead, GTFS Editor https://pleasantprogrammer.com/posts/gtfs-editor.html Wed, 10 Jul 2013 00:00:00 +0000 https://pleasantprogrammer.com/posts/gtfs-editor.html Link: https://github.com/conveyal/gtfs-editor TL;DR they really meant under development When I first saw the source of GTFS Editor, I was ecstatic. They used Play framework!!! Not only that, they’re targeting PostgreSQL as the main database. Those are our favorite tools for building webapps at By Implication. I was a bit sad though, when I saw it was on the 1.x release of Play though. I did have some experience with that release, but not as much compared to 2. One Bus (or maybe Jeep) Away https://pleasantprogrammer.com/posts/one-bus-or-maybe-jeep-away.html Tue, 09 Jul 2013 00:00:00 +0000 https://pleasantprogrammer.com/posts/one-bus-or-maybe-jeep-away.html Link: http://onebusaway.org/ TL;DR no routing; useless in Philippines OneBusAway is a transit information app. It provides data on what bus stops are near you, which buses pass by. You can also get schedules and the route of a particular bus given the number. It can also provide realtime updates like how many minutes until the next bus arrives. It does not, however, provide routing. There is no support for providing directions to get from point A to point B. Open Trip Planner https://pleasantprogrammer.com/posts/open-trip-planner.html Tue, 09 Jul 2013 00:00:00 +0000 https://pleasantprogrammer.com/posts/open-trip-planner.html Link: http://www.opentripplanner.org TL;DR routes pretty well; data might cause weird issues OpenTripPlanner, as the name implies, is a routing app. Given point A and point B, it can provide possible routes by taking transit, riding a bike, or a mix of both. You can also specify options on how much walking you’re willing to do or if you prefer fewer transfers over trip time. It could be a good competitor to the transit directions of Google Maps. Jeepney and Bus Routes https://pleasantprogrammer.com/posts/jeepney-and-bus-routes.html Sun, 07 Jul 2013 00:00:00 +0000 https://pleasantprogrammer.com/posts/jeepney-and-bus-routes.html In the last post, I talked about how we now have data about jeepney and bus routes in the Philippines. The data is actually in the GTFS format, which is the format the Google Maps consumes transit data. Apparently, the government will be submitting the GTFS data later this year. Transit directions for Metro Manila in Google Maps would be wonderful. That said, it definitely raises the bar for the app challenge people. Philippine Transit App Challenge https://pleasantprogrammer.com/posts/philippine-transit-app-challenge.html Sun, 07 Jul 2013 00:00:00 +0000 https://pleasantprogrammer.com/posts/philippine-transit-app-challenge.html Last week, the DOTC launched the Philippine Transit App Challenge. It’s a competition to build something great using the newly available 1) jeepney/bus/rail routes and 2) traffic incident data in Metro Manila and Cebu. I’m actually quite excited about this as it’s not everyday our government does wonderful things. Many people have been waiting for this kind of data to be available. Before, the only way to figure out which jeeps to ride to get from A to B is by asking other people.