All posts by patorjk

Slider Puzzles

A long time ago I used to have a Sarah Michelle Gellar Javascript puzzle up. I made it one day while I was bored and trying to learn Javascript. I figured it’d fall into the abyss that a lot of my Javascript projects fell into (anyone remember that ghost clicking game I had?). Oddly enough though, it ended up generating quite a few emails. Mostly Sarah Michelle Gellar fans. Later I built a more advanced slider puzzle, but it was total crap and featured Britney Spears (not the best choice) and I’ve always wanted to write a better one. So on Sunday I sat down and churned one out. One that would allow me to do lazy updates by automatically looking for new puzzle images (keeping the data and the script separate).

Originally I was going to make a Sarah Michelle Gellar slider puzzle gallery – but then copyright issues came to mind and I decided to not to risk it. Plus I thought it might look kind of creepy for me to have a large, shrine-like Sarah Michelle Gellar puzzle gallery on my site.

My next choice was to do Salvador Dali paintings, but it turns out his stuff is under copyright too – and for the next 50 years at that. The ARS, who now manage Dali’s copyrights, seem to be pretty active in going after potential violators. Not the kind of people I want to tangle with.

So instead, for my first slider puzzle gallery, I decided to use the works of Paul Cézanne. He’s a famous impressionist painter whose paintings often pop up in computer graphics journal papers, since the images are public domain. You can see the resulting slider puzzles here:

http://www.patorjk.com/games/sliderpuzzles/

I think I’m going to try and have a variety of galleries since it simply involves finding free images to use.

As stated before this script is relatively new, so it may be a bit buggy. Let me know if you have any problems – or if you have any suggestions!

New App This Friday / Programming Challenge

New App Coming

On Sunday I sat down and programmed up a new online app. I might tweak it a bit between now and then, but as of right now it’s essentially done. I’ll post it up later this week – most likely Friday or Saturday. Since I wrote it in one day, you can assume it’s pretty small, it’ll be cool though! I actually really like it (and I don’t like everything I make). It was on my list of “stuff to do on a rainy day”. Sunday wasn’t actually rainy, but I was tired and I realized I hadn’t released anything here in a while, so I thought I’d take a stab at it.

I had been working on another online app, which I’ve mentioned a few times here before, but it was a bit too ambitious and I’ve lost interest. So it’s offically been abandoned for the moment. I may come back to it later though.

Programming Challenge

While reading some more of Steve Yegge’s blog entries, I ran across a very interesting programming question. It came from an entry Yegge wrote on doing phone interviews. He would always ask potential candidates the following question (or a variation of it):

Last year my team had to remove all the phone numbers from 50,000 Amazon web page templates, since many of the numbers were no longer in service, and we also wanted to route all customer contacts through a single page.

Let’s say you’re on my team, and we have to identify the pages having probable U.S. phone numbers in them. To simplify the problem slightly, assume we have 50,000 HTML files in a Unix directory tree, under a directory called “/website”. We have 2 days to get a list of file paths to the editorial staff. You need to give me a list of the .html files in this directory tree that appear to contain phone numbers in the following two formats: (xxx) xxx-xxxx and xxx-xxx-xxxx.

How would you solve this problem? Keep in mind our team is on a short (2-day) timeline.

Aparently 25%-35% of the software developers he asked this question to could not solve it. So give yourself a pat on the back if you think you’ve got a solution. Once you’re sure on what you’d do, click here to see what the best solution would be. I was actually estatic that I got it, though I’ve been using Unix a lot at work, and I’ve been reading up on regexes, so it’d be pretty bad if I didn’t get it. If you’re not a programmer, reading that solution will make no sense to you. This is the blog entry it’s from. It’s basically an article on what you should know when you go into an interview for a software development position.

Blogging

Lately I’ve been telling my friends, friends of friends, casual acquaintances, and random strangers I meet on the street that they should start a blog*. I’m not sure what’s gotten into me. Blogs are fun though, even if no one reads them. I’ve had a lot of trouble trying to justify this though, until I came across a really interesting article the other day:

You Should Write Blogs

That blog entry was written by Steven Yegge, a 30-something Google employee (though he was working for Amazon when he wrote that). My favorite observation from Stevey is that “struggling to express things that you’re thinking or feeling helps you understand them better.” I think he’s dead on there. If you take the time to write about something that’s on your mind, you’ll end up understanding it a lot better. It’s like having to teach someone something. The act of explaining the subject helps you better understand it – and it helps you understand how much you really know about that subject.

When I was in grad school I had to teach these 45 minute C++ lab courses. They were comprised of small groups of students from one of the computer science introduction lecture hall classes. I taught the labs daily, but they only ocurred once a week for each group of students. Even though I considered myself pretty proficient in C++, having to explain all the nooks and crannies made me realize I didn’t understand things as well as I thought. However, it turned out that each class usually had the same questions about C++ and the lab assignment (it was almost Twilight Zone-ish really), so I got progressively better at teaching the lab as the week went on. It was funny, on Monday I’d look like a bumbling slacker, but by Friday I seemed like some kind of C++ wizard. I actually had a couple of the Friday kids give me some strong complements on my C++ skills :P. So writing down your thoughts and exploring certain topics can help you better understand them.

Another thing Stevey does in his article is give and refute 4 popular excuses people give for not writing blogs:

  • I don’t have enough time to blog.
  • I’m afraid to put my true thoughts on public record.
  • No one will read my blog.
  • Blogging is narcissistic.

Reasons #1, #3, and #4 are petty excuses in my opinion. However, reason number #2 is not something that should be treated lightly. One’s opinions may be the “spice” to their entries, but you can get yourself in a lot of trouble if you don’t exercise some common sense. I’ve had employers, girl friends, ex-girl friends, and friends get pissed at me over entries I’ve written in past blogs. And not the kind of pissed where they grumble and forgive you 5 seconds later, the kind of pissed where you’re given the look of death and not spoken to for a while. You live and your learn though. I no longer blog about personal matters unless I have a good story to go with it. Plus it’s just more fun to write about my hobbies/interests than it is to write about things that annoy me or about my daily activities. I could probably write an entry on how I sat in a cube for 8 hours today and then went home and ate some ramen noodles, but it wouldn’t be very fun to write, and I’m sure it’d be even less fun to read.

So anyway, if you have the urge to blog, I highly recommend reading the above article. It’ll jump start your motivation. And don’t worry about no one reading your blog, you should write it for yourself. Hell, this blog isn’t even the most popular thing on this site – TAAG is (I’m actually surprised by this – it’s mostly due to Google though). Which reminds me, I need to get back to developing stuff. Anyway, think about what I said.

*If you’re one of these people, know that I didn’t write this entry to be directed at you. I actually have been a little over zealous in my promotion in blogging. I dunno why, it’s just gotten under my skin.

The Last Days of Summer

I decided to I take a 5 day weekend to celebrate the end of summer. I needed some time to just sit back, relax, and clear my head. For my break I thought I’d read a book on PHP, check out a John Swartzwelder novel, and do some serious coding.

It’s strange how one’s plans can just go right out the window. I didn’t get any of the above done, though I did have a lot of fun. It’s weird that I planned such an anti-social weekend and then went out did a bunch of stuff. Looking back, I had a lot of fun this summer. I didn’t really take any time to soak it in or appreciate it until just now though. I hope everyone out there reading this had a good weekend.

Today is officially the last day of my big weekend. Hopefully I get some of my original goals done so I can have some more stuff for this site. In the meantime, if you’re bored, I highly recommend viewing this short film:

It was shown to me by a friend a few years ago and it’s absolutely beautiful. I’ve actually re-googled for it a couple of times just so I could re-see it.

Well, it’s almost 5am, I should be getting to bed. I don’t want to totally mess up my sleeping schedule for Wednesday.

Stats: August

Average Number of Visitors a Day: 156.45
Total Number of Visitors: 4850
Total Amount of Bandwidth Used: 2.93 GB

Links from an Internet Search Engine  
13 different refering search engines Pages Percent Hits Percent
Google 1188 90.6 % 1188 90.2 %
Yahoo! 59 4.5 % 59 4.4 %
MSN Search 14 1 % 15 1.1 %
Ask 11 0.8 % 11 0.8 %
Unknown search engines 10 0.7 % 10 0.7 %
AOL 10 0.7 % 10 0.7 %
Windows Live 9 0.6 % 9 0.6 %
AltaVista 3 0.2 % 3 0.2 %
Google (Images) 3 0.2 % 3 0.2 %
Google (cache) 1 0 % 5 0.3 %
Dogpile 1 0 % 1 0 %
del.icio.us (Social Bookmark) 1 0 % 1 0 %
Blingo 1 0 % 1 0 %

Thanks again to all of you who check in every so often. I’ll do a real update later this weekend… I promise…

Know the name of a Federal Employee? You can look their salary up online!

I actually can’t believe this is real: an online database containing the salaries of most federal employees (exempt are those who deal with matters of national security):

http://php.app.com/feds06/search.php

This sort of makes sense since we the tax payers are paying these people, however, it also seems a little wrong. Aren’t these people entitled to some amount of privacy? I’d be annoyed if someone could look up my salary, though then again, maybe if everyone knew what everyone else made it wouldn’t be so bad. You wouldn’t have people trying to cut backroom deals to get a higher salary.

Unfortunately I don’t know many Federal Employees. I tried most of the people on my facebook list and came up with only one hit (and it was the guy who told me about the site). This would be a much juicer find if Maryland State employees were listed, sort of like how New Jersey State employees are listed.

Anyway, I found this to be shockingly interesting site. If you know any federal employees you might want to point them to the site, just to see what they think :).

New Old Stuff

I decided to resurrect the “Most Asked For VB Code” section of my old site. I figured there were a lot of helpful bits of code in there, and that it was a waste to simply discard it. You can view it here:

VB 6.0 Code Bank

I went through and checked all of the code to ensure that it still works, and I tidied up some of the messier looking segments. It’s cool to look back at some of the code I wrote when I was 16/17 and think “hey, that’s pretty clever!” But then some of it also made me go “holy crap, I was an idiot!” I was especially embarrassed by how many times I used variables named “pat” or “patorjk”. I believe early on in my programming days I saw some hacker posting code on a message board and he would use his handle as a variable name. I thought that was pretty cool so I picked it up. Sadly, no one ever pointed out to me that this was a bad programming practice and that it made code hard to decipher.

I suppose that’s one of the disadvantages to teaching yourself. You can end up unaware of certain bad practices until they come back to haunt you. When I was a Teaching Assistant back in grad school I worked with a beginner class where students could lose up to 60% of their project points on style alone. I remember having irate students come to me and ask how they could have received a “D”, or in some cases an “F”, when their project worked perfectly.

I was kind of upset with the harsh grading guidelines too, but there wasn’t anything I could do. Looking back, I still think it’s too harsh to put so much of a weight on style. All that will do is discourage smart people who have picked up some bad habits. This reminds me of an essay I read recently:

Hackers and Fighters

I like how the author romanticizes the idea of the “street programmer” (the self-taught programmer), and I like how he points out the weak points in a university education. Though a university does do a good job of weeding out complete idiots, I’ve seen a number of people who can barely program (ex: “I can’t program in Java, I only know C++”) who go on to make 80k+ a year. Then there are people I know who are self-taught who could program circles around those people and they make less than 50k a year. It boggles my mind. A degree and good social/networking skills seem to be the most important things when getting a good job, which saddens me a little, but oh well.

Opera and Other Things

I downloaded the Opera web browser recently, just to see what this page looked like. I noticed that the TAAG program looked like crap so I’ve redone some of the CSS for it. Later this week I hope to do another update to it to add in some new features.

A while back I was working on a new web app, I haven’t touched it in over two weeks – my plan is to start working on it again later this week and to try and release it asap.

“Google! Teacher, mother… [lustful voice] secret lover.”

I love google. Lately it’s been bringing me lots of visitors. It brought me 55 yesterday, which is a pretty damn cool (and pretty good for a small site like this one). However, this past weekend when I messed up my .htaccess file, it brought me no one. In case you weren’t here: I screwed up my 301 redirect links and no one was able to access anything in the /software, /downloads, or /programming directories of this site (you were just redirected to one of my blog pages). I will now do a total site checkout after touching that file. I can’t believe I was that stupid.

Like an idiot I let this error sit around for a few days before I realized something was terribly wrong. That something wrong was that google was no longer bringing me traffic. I’d fallen in my page rank. I quickly fixed the error and my page rank mostly returned. However, my ranking for the term Patrick Gillespie seems to have disappeared. I was actually kind of hoping to grab the top spot from that stupid news article on the pervert named Patrick Gillespie. Though then again, it was my Tiburon entry that was climbing the top ten of that page, and I’m not so sure that article would look good next to one titled “Patrick Gillespie arrested for failing to register as a sex offender.”

Back to the topic at hand though. Luckily google forgave my foolish .htaccess blunder. I was reading an article on some other blog earlier this week where the site owner wasn’t as lucky:

Google Penalty Nightmare

Google penalizes sites for certain offenses. Usually this is because a site is trying to do something artificial to raise its page rank. But since google doesn’t tell these sites the reason they are penalized, no one can be sure why a page suddenly drops in its page rank – or in some cases, is removed from the search results. Sometimes you mess up and things go back to normal (like me), and sometimes you mess up and things are sucky for a decent amount of time (like the girl in the blog entry above).

I find the whole idea of a secret penalty system quite interesting. It makes sense that they wouldn’t release all of the details, because then people would know exactly what to try and get around. Not knowing what you’re up against means there are more mines you could potentially step on, and when those mines are things like being removed from google’s search results, you’re less likely to do something to try and cheat the system. At least that’s what I think their reasoning is.

Not surprisingly, webmasters have tried to understand this system and some have even put together lists of possible google penalty filters. Below is one such list:

Google Filters

Jargon you’ll need to know to understand that article:
SERPS = Search engine results pages
SEO = Search engine optimization

If you’re a webmaster, that article is worth reading. It’s even caused me to think twice about the naming of my “links” section – though it’s late now so I’ll rename it later.

Oh yeah, in case you’re wondering, the title of this entry is a reference to a famous Homer Simpson quote. I figured it would probably be a good idea to mention that :).

Cool New Image Resizing Technique

One of the things I studied in grad school was how to find the least visible seam in an image. This would be useful say if you overlapped two images and wanted to find the best way to cut them together, or if you wanted to create your own waldo image. I thought that the seam finding algorithms were really cool, but that there wasn’t a whole lot of use for them outside of doctoring photos and generating texture. Holy crap was I wrong. Check out this video:

This is the first time I’ve ever watched a technical video and thought to myself “I understand everything that is going on here… why didn’t I think of this!!” That’s a truly awesome idea. It makes me want to breakout my seam finding code and make an image resizer (I’ve written code that finds the low energy image seams you see in the video – it’s what I used to make the waldo image, which is the same image randomly pasted over and over again with a seam between overlapping areas).

The only problem with that idea is that finding seams isn’t as fast as they show you, at least not for large images (400+ by 400+). They might be using a different algorithm then what I’m thinking of, or maybe they were running the app on a super fast computer, but in my experience finding a seam can take some time if the image is of a decent size (by “some time” I mean 1 or 2 seconds). Though I might be wrong and this might be a super fast algorithm. It’ll be interesting to see how people apply this.

Blocking Firefox

There’s been a decent amount of hysteria on some of the social news web sites about a new campaign to block Firefox users. The reasoning behind this is because Firefox has a plug-in that allows you block ads.  Proponents of this campaign argue that this robs website owners of the opportunity to make money from their site. You can see the campaign’s website here:

http://whyfirefoxisblocked.com

The majority of people who are reacting to this seem to be upset about this. However, after doing a bunch of googling, I was only able to find one site that is participating in this campaign (and it sucks).

Anyway, I figured I’d give my opinion on this issue since I’m sure I’m in the minority. Frankly, I don’t see why so many people are getting upset. If a website is going to block you, just don’t visit that website. There are millions of places to go on the internet, if a handful of sites want their ad revenue and you don’t want to look at ads, just don’t go to those websites. For every site that blocks Firefox, I’m sure an alternative will spring up somewhere.

I kind of like the ad revenue based system though, since it allows a lot of stuff to be free. Most sites I visit have a tasteful display of ads. If I go to a website and they ambush with lots of crap, I just never go there again. I’d hate to see this model replaced with a model where ads are injected into the actual content (movies and TV shows sometimes do this). I wouldn’t put it above sites to do this either. They’re going to make their money one way or another (or disappear).

As a site note, according to my web stats, 37% of the people who visit this website use Firefox. 52% use Internet Explorer, and the rest use a variety of other browsers. I guess that’s indicative of a more web savvy audience.