By epb on February 18, 2012
Problem: In experimenting with GIMP’s Script-Fu console, I could not figure out what values to feed in to scriptfu-rounded-corners (you know, to see what would happen) for image and drawable. It was surprisingly simple though.
Continue reading “Solved: GIMP Script-Fu Console Image ID”
Posted in Problems | Tagged GIMP |
By epb on February 12, 2012
With a title like “Programmers should strive to Expand their Knowledge Bases” you’d think I was referring to things like OOP, DRY, and other acronyms. However, I am not. I’m not referring to learning additional programming languages or algorithms. I’m talking about learning things from other domains entirely. For example: science, knitting, cat photography, cat photograph captioning and so on. Honestly it’s a little bit of a weak point for me as well. My grammar is a sore example. Of course, I’m a mediocre-self-taught-programmer, so that is to be expected anyway. First off there’s knowledge you can apply directly to programming problems.
Having knowledge about other fields allows you to more readily solve programming problems that involve those fields. There’s even a term for this: domain knowledge or domain-specific knowledge. You don’t necessarily need to be an expert either. For example, with a base level of knowledge it become easier to get input from experts in a particular domain This is because you already have a base understanding. There are two less-obvious benefits though, and I think they are more important.
First, having a broad base of knowledge to pull from enhances problem solving skills. I don’t have solid numbers to back this statement up though. (This is a blog, not a peer-reviewed paper.) Usually, when confronted with a problem in different domains the manner in which you come to a solution differs based on the domain at hand. More specifically: you think differently. Being able to solve problems in programming often requires you to shift your way of thinking and having more experience approaching problems from different angles can be very beneficial. It can even apply to learning new programming paradigms. I didn’t fully grasp OOP until I considered things in terms of chemistry.
Second, having a broad knowledge base can make it easier to communicate with people of different backgrounds. Much like dealing with experts above, but often a little more general. This is also somewhat tied to the problem solving mentioned previously. When you can shift thinking readily, it becomes far easier to think like the person you are communicating with and explain things with terms or analogies that that person can understand. As a personal example of this: I’ve explained the Linux boot process almost entirely with car analogies to a car guy. I’m pretty certain that had i never taken auto shop, this would have been impossible.
tl;dr version: Learn stuff. It makes you a better problem solver and communicator. Soft skills for the win.
Posted in Programming |
By epb on January 30, 2012

Not entering a valid part number is not a crime.
So I go off to search for a part (specifically a replacement battery for a laptop) but I don’t have the thing with me since it’s not mine, I’ve just been tasked with finding a replacement. (So, no stickers for me!) As a last ditch effort before contacting the owner, I go googling and grab a random part number and decide to try to plug it into the part search and hope that it happens to match with HP’s all-knowing database, knowing full well it would probably say something like “Invalid Part Number” or something. Plug in: SFB-HPDV7_56157 and I’m met with a much more condescending message:
A potentially dangerous input was detected from the client browser. This incident is reported to Support team. Please click ‘Home’ link to continue.
Really? It’s always such a pain to use HP’s website to find… umm… anything, but this is a first I have to admit. I wasn’t aware that dashes and underscores could be dangerous. Couldn’t be polite and just say “that part number isn’t valid.”</rant>
That out of the way, why do manufacturers go through such lengths to avoid parting us from our money? If I cannot, with ease, find a replacement part from you, I will not be able to buy it from you. For those who don’t know, with HP, to find anything you need both the product number and serial number to even begin your search. (Alternatively run their HP support assistant program on the laptop itself.)
Posted in Problems |
By epb on October 14, 2011

Important times to watch out for
For those who cannot see images:
Significant times of the day
4:04 – Time is not found.
5:00 – Time is Broken.
4:03 – The forbidden time.
3:03 – The time for seeing others.
4:09 – Time of Confrontation
4:10 – Time of Disappearance
3:02 – Time of Finding
2:02 – Time of Willful Procrastination
Don’t quite get it? Read up on HTTP error codes.
Significant Times of the Day printable PDF
Significant Times of the Day source SVG (The fonts used are available on Font Squirrel.)
Posted in Comic, Random | Tagged comic |
By epb on October 14, 2011
It was mentioned that a sequel to Zombinanza has long been missing, and as a consequence Zombinanza 2 shall be attempted to be started to be made. Harass me if it doesn’t.
Posted in Games, Programming |
By epb on October 13, 2011
I needed a small php function that could take an address (which lacked a zip code) and fetch a best guess postal code for it. I had a database full of addresses with city and state, but no zip code. Thankfully, if you have enough information in your address to locate it with the Google maps geocoding service, you have enough information to get the zip code. If not the correct zip code, it should pull one that’s relatively close assuming you’ve specified the correct city and state in your address.
This is possible because the geocoding service will return matches with full address data available. If we assume that the first match is most likely the correct match, we can just extract it’s postal code. I’ve only tested this with US addresses, but it may work in other countries where Google can geocode an address.
Continue reading “PHP: Get zipcode for an Address”
Posted in php |
By epb on April 17, 2011
Looking for a quick and easy to use encryption class for PHP? I stumbled upon Cryptastic in my searches for example code to use with mcrypt for a personal project. I must say it’s quite handy. It implements a message integrity check and handles the initialization vector stuff for you making encrypting data as easy as a single call.
Posted in php | Tagged encryption, mcrypt |
By epb on February 6, 2011
There may be times you need to find the bounding box of an SVG path. One way to find it would be to parse the path and then apply any group transformation on it to find the range of X and Y coordinates the object occupies. However that’s a bit of code, and I’m quite a bit lazy, so I decided to try another approach: rasterize the path object by itself and find where in the image it was drawn.
Continue reading “Get the Bounding Box of an SVG Path”
Posted in php | Tagged hopefully_that_made_sense, ImageMagick, php, problem, svg |
By epb on November 15, 2010
I got my CherryPad America toward the end of October. It’s a low-end tablet, comparable to the ones you can now find at WalMart and KMart. I bought mine primarily to function as an e-reader, and quickly found that it had impressive video codec support and could do more than I was expecting out of such a cheap device. (When I bought it, it was one of the cheapest on the market.)
I was order number 58, so some things are probably different now. I believe the factory language is now English instead of Chinese for instance.
Some initial thoughts:
- Good codec support (Too bad the Android video player doesn’t support internal mkv subtitles. You need third party software from the market for that.)
- Root access!
- Android Market is a pain to get (and keep) working.
- Resistive Screen takes some getting used to
- Speakers are less than impressive, but sounds pretty decent with headphones or externally attached speakers.
- Fits in one hand, good for reading.
- Gah, why is JavaScript not on by default?
- I like the aluminum case.
- Uses my iPod’s docking cable.
- A little slow sometimes, depends on the task.
Getting the Android Marketplace to function well has been an uphill battle, and honestly, the biggest problem I’ve run into. It will work for a bit and then stop working entirely. Actually, hasn’t worked for a week for me now. *sigh* I think I’ll email and ask about that.
If you’re looking for a simple music-playing, video-playing tablet, that you can use for reading and browsing the Internet. It’s perfectly capable of all that. I even use it to order parts off NewEgg and such. Once you get it set up to your liking and get used to the resistive screen, it’s nice, if a little slow. Verdict is that I like it, but am hesitant to recommend buying it because of the issues I’ve had with the Android Market.
Posted in linux | Tagged android, CherryPad
By epb on October 27, 2010
The CherryPad America is a tablet running Android I plan to write up a review for later, however a quick note for anyone who might be searching: Yes, if you do a factory restore, the default language will be Chinese.
You can change it to English by pressing the change-language button in the lower-right hand corner of the initial start screen where you are asked to press on the android. (But you can’t read that since it’s in Chinese.
) Then you can pick English and be good to go for your initial boot.
Posted in Uncategorized | Tagged linux, tablets