All posts by patorjk

Some Minor Updates

VB Arrays Tutorial

I noticed from my stats page that chicanerous’ VB Arrays tutorial was getting between 8 and 10 views a day. This made me realize a decent number of people were reading it and I felt sort of bad that I had it displayed with such a crappy layout. The grey background and white text on a stand alone page made the tutorial look very low quality, so I decided to give it a make over and add a section on the Split and Join functions:

http://www.patorjk.com/programming/tutorials/vbarrays.htm

Also, there will be more updates to the programming section soon. It’s been pretty sparse for a while.

Links

I’ve created a formal link section. On my old website, I had a link exchange program. I will no longer do this. Mainly because I had a lot of crappy links submitted to me, and at the time I figured it was better to be nice and do the link exchange than to reject someone who probably visited my page regularly. However, I actually ended up having a few people email me asking why I had a couple of really crappy sites linked (I wont name names). I’m sure this caused them (and others) not to trust the link suggestions I gave. There was also the problem with people unlinking me after I linked them, which was annoying (especially if I didn’t like their site to begin with).

So now I’m just going to limit it to sites that I like, think are interesting, have useful/relevant content, and feel are worth checking out. As time goes on I hope to add a lot more than what’s there now. I haven’t decided if I want to focus on smaller sites or just interesting sites in general. My gut is to go with smaller sites, but we shall see.

Sleep

I haven’t been getting much sleep lately. I guess there’s no point to me saying that here, but I’m pretty tired right now and felt like sharing :P. There was actually going to be more added today, I just didn’t get around to it, maybe this weekend though.

Alternative Photomosaic Algorithms

One thing that has always bothered me is software patents. They just seem wrong. How can someone own a way of doing something? Or own a technique that others would come up with when trying to solve the same problem? They seem like unnatural restraints, like patenting the solution to a math problem. I can understand wanting to protect your ideas, but I honestly don’t think most software ideas are novel enough to warrant a patent, especially at the rate that the US government seems to be giving them out. I’m mean hell, who can be expected to know about all the stupid things people have patented? There is no fucking way that there were 40,000 patent-worthy software ideas that came out last year. That’s completely absurd.

One example that always comes to mind when of thinking about why software patents are bad is the story of what happened to id Software while they were developing Doom 3. Essentially John Carmack, the technical director at id Software, came up with a neat way of doing real time shadowing, which he called Carmack’s Reverse. After discussing the technique on his blog, it was discovered that two researchers had already patented the idea. In order to be able to use the technique, Carmack had to come to an agreement with them. Someone else, independently of these two parties, had also discovered the technique and presented it at a conference before the patent was filed. This person offered to let id Software use it for free, but id Software decided to play it safe and strike a deal with the patent owners [1].

Its things like that that bother me. Someone is toiling away writing a piece of code, they come up with a great way for solving a problem, implement it, and then later learn some researcher in a lab somewhere has patented the idea – probably just so they can say they have X number of patents – and now they have to pay to use a technique that they came up with on their own.

But I digress. I could go on for 10 pages about why I don’t like software patents. My focus here is that I’ve learned that a patent has been granted for the creation of photomosaics, those neat images that are made up of smaller images. The abstract reads as follows [2]:

A mosaic image is formed from a database of source images. More particularly, the source images are analyzed, selected and organized to produce the mosaic image. A target image is divided into tile regions, each of which is compared with individual source image portions to determine the best available matching source image by computing red, green and blue channel root-mean square error. The mosaic image is formed by positioning the respective best-matching source images at the respective tile regions.

I honestly don’t blame the person who filed this patent, since they were one of the first people to create mosaics with photos [3], and they wanted to make sure people didn’t profit at their expense. However, I still really dislike the idea of patenting a way of doing something, especially when the method seems rather obvious. I was able to write a photomosaic generation program when I was in 11th grade, and I didn’t have to look up an algorithm, I just made one up (yes, Mosaicer was written when I was in high school).

The only part of that abstract that seems outside the normal algorithm for creating your basic mosaic is the part that mentions the “root-mean square error” in relation to the color difference. That part is significant because it does a much better matching job than taking a simple color difference (what Mosaicer does). However, spend any time in a reading up on color differences, and you’ll learn that that’s the way to do color differences in RGB color space. So I’m not sure why this abstract as a whole was considered so novel.

Furthermore, the RGB color space is flawed in that it’s a non-uniform color space. Instead of using the RGB color space, one could use the L*a*b* color space, which is a uniform color space that has some of the most precise color difference formulas ever developed.

There’s also another way of creating photomosaics, outside of simply changing the color space and color difference methods. 90% of the people who read what follows will have no clue what I’m talking about, but try to follow along because this is a completely different way of patch matching than what is described in the patent abstract. Instead of dividing the target image into blocks and seeing which input images best fit the blocks, one can use Fast Fourier Transform patch matching [4, 5]. This technique wasn’t discovered until 2002, and I haven’t seen anyone discuss it with relation to creating photomosaics.

When using this method you transform you data into frequency space, perform some calculations, and then you transform your data back into the normal space. Because frequency space is a weird place, multiplication becomes addition. Therefore your computation time is greatly reduced when calculating squared color differences in frequency space. Kwatra et at [6] wrote about the speed up this matching technique provided in their paper on graph cut texture synthesis. With the simple RGB method, generation time for a particular video was 10 minutes, with the FFT method, generation time on the same video was 5 seconds. This is actually how I came across the FFT patch matching. I had to implement Kwatra’s paper for a graphics project I was assigned.

After reading the FFT paper, I immediately saw the possible application to photomosaics – however, after implementing the FFT patch matching method and seeing its nuts and bolts I wasn’t sure how much of a speed up it would actually provide, since it performs more calculations than needed for photomosaic patch matching (it tells you how well the image matched at every offset instead of just the subset of offsets needed for tile placement). In fact, I wondered if it could end up slowing things down. But there are ways of optimizing it for photomosaics, so it was (and is) unclear to me how much of a speed up or slow down effect it would have.

As you can probably tell, I never got around to trying out the above method in relation to photomosaics, mostly because I’m not that interested in photomosaics anymore. But I did put it on my list of possible things to do in the future. I will never patent any of these ideas discussed here so they’re free for anyone to use. However, I have no clue if someone has already thought of them and patented them. So I can’t make that guarantee. Though I figured I’d make a post noting all of this in case no patent for this exist, just so there are patent free methods for photomosaic creation out there.

References:
[1] http://techreport.com/onearticle.x/7113
[2] http://v3.espacenet.com/textdoc?DB=EPODOC&IDX=US6137498
[3] http://en.wikipedia.org/wiki/Photomosaic#History
[4] http://www.cs.sfu.ca/~torsten/Publications/Papers/icip02.pdf
[5] http://www.cs.sfu.ca/~mark/ftp/Icip02/images/icip_2002.jpg
[6] http://www.cc.gatech.edu/~turk/my_papers/graph_cuts.pdf

TAAG Update

One thing that annoyed me about my TAAG program was that every time you changed fonts, the top frame had to be reloaded. This was because the program needed to talk to the server to get the information about the new font. However, technically, nothing on the page needed to be redrawn, so refreshing the whole frame seemed like a little much, and when you change fonts a lot, it gets annoying. Anyway, this week I was reading up on AJAX, which is a way of talking to the server without reloading the webpage. Since this was just was I was looking for, I decided to incorporate the technique into TAAG:

http://www.patorjk.com/software/taag/

The top frame will still reload is you change the “Font Type” or if you select a font from the preview page. However, it should not reload if you change fonts via the drop down font list. Also, there is a bug in Firefox where the “onchange” event isn’t triggered for keypresses on listboxes, I’ve set things up so you should now be able to change fonts with your keyboard on Firefox. A few other things were updated as well, but it was all small stuff.

If you’re thinking about developing web applications or interactive webpages, AJAX is worth reading up on. I wish I’d known about it sooner. Later this week I think I’ll start on my next program, it’ll be another web program and I’m unsure of how long it’ll take to make.

Social Bookmarking Websites

A couple of years ago a friend of mine showed me a website he was working on. It was a site that allowed you to save a list of your favorite websites to a server, so that you could obtain a list of these sites no matter which computer you happened to be at. He told me it was fully functional, and he had even given a few test accounts out. When I saw it, I thought it was a pretty neat idea, though nothing revolutionary. Later that day I did a google search and discovered that there were already a couple of sites like that. “Hmm, looks like this idea has already been implemented pretty thoroughly…” And social bookmarking sites left my thoughts completely, until a week ago.

I frequent sites such as reddit.com. Mostly so I can get my daily dose of odd ball news and information. A lot of the sites that are posted on reddit are blogs, and lately I had been noticing that many of these blogs had these strange little buttons at the bottom of their entries. After having wondered what the hell they were for some time, I finally clicked on one out of curiosity and it took me to del.icio.us, a modern day social bookmarking site. I was actually kind of amazed that the site had become so popular that bloggers were posting a link to it in all of their posts. After some researching though, I figured out why.

  • Social bookingmarking sites allow you to share your favorite links with friends and strangers. For website owners, this is free promotion, and people are much more likely to spend some time looking at a link on someone’s favorites list than they are to spend time looking at some random site they came across in a search engine.
  • Links on social bookmarking sites actually get factored into your page rankings on most search engines. Thus, the more people who favorite your site, the higher your page is ranked.

The first point may be obvious, but the second point is probably the reason those little buttons have taken off. Search engines are a powerful tool in driving traffic to your site. It didn’t seem to make sense to promote some other site just for point 1, but with points 1 and 2 together you actually have a pretty nice combination.

Those little buttons have taken off so much that there are now sites that offer the service of providing you with the latest buttons. Sign up for an account on their site and you can have all the popular buttons easily placed on your blog or website. Check it out:

  • http://blog.addthis.com/ – A plug-in you can get for WordPress. Has a nice little popup of notable bookmarking sites when you mouse over the button.
  • http://badged.net/ – Free service that doesn’t require you to register an account. It looks like they survive by taking donations.

These seem like nice little services, but one has to ask themselves: How do these sites make money? My biggest fear with using a free service like the ones listed above is that they’d start putting ads everywhere once they got really popular. And the last thing I want for my visitors is for them to be greeted by some pop-up window, especially if I’m not making anything off of it. This may seem like a rather cynical thing to say, but most of the free services I’ve used in the past have all ended up being saturated with ads (geocities, xoom, various free counters I’ve had, and the list goes on).

For the moment, AddThis appears to be looking at data mining as a possible income generator:

http://www.techcrunch.com/2007/03/05/addthis-widget-gathering-lots-of-interesting-data/

Badged may be doing the same thing, but they don’t say anything about keeping track of clicks on their website. Personally, I actually prefer Badged’s setup. It’s nice to be able to choose which buttons you want. However, it’d be a lot nicer if there was no dependence on the main site. For example, after you selected the buttons you’d like, it’d generate the HTML for you and you’d simply right click and save the icons to your computer. That way there’s no chance of people putting ads on your site and no chance of them mining data from your users. I like that idea so much I may do it myself, maybe.

In the meantime, I’ve decided to put two social bookmarking buttons on my TAAG program. Just to see how that goes. TAAG will also be getting an update later in the week. To give you a hint, I’ve been reading up on AJAX.

As for my friend, to my knowledge, he didn’t really do anything with his bookmarking site, which is kind of a shame, since it was a neat enough site to leave an impression on me.

Stats: July vs June

Visits were up for the month of July, I’m not exactly sure why, but it’s certainly encouraging! Thanks to all of you who come here, it motivates me to keep working on this site. As far as stats go, I’ve actually sort of been wondering how to best promote this site. Towards the end of the month I realized I hadn’t submitted this site to any search engines, so I did that. However, I was listed on most of them already, so I’m assuming manually submitting a site doesn’t do a whole lot. I did find some interesting web tools available from google though:

http://www.google.com/webmasters/sitemaps/

If you have a website you may want to check that out. It’ll give you interesting information about how your site is ranked in their search engine. Stuff like your highest ranked page, sites that point to you that count in your page rank, when the last time your page was crawled, and a couple of other things. Anyway, here are the stats…

July Stats:
Average Number of Visitors a Day: 120.94
Total Number of Visitors: 3749
Total Amount of Bandwidth Used: 2.91 GB

Links from an Internet Search Engine  
8 different refering search engines Pages Percent Hits Percent
Google 681 90.9 % 683 90.9 %
Yahoo 30 4 % 30 3.9 %
Unknown search engines 13 1.7 % 13 1.7 %
AOL 11 1.4 % 11 1.4 %
MSN 9 1.2 % 9 1.1 %
Ask Jeeves 3 0.4 % 3 0.3 %
DMOZ 1 0.1 % 1 0.1 %
MetaCrawler (Metamoteur) 1 0.1 % 1 0.1 %

June Stats:
Average Number of Visitors a Day: 84.00
Total Number of Visitors: 2520
Total Amount of Bandwidth Used: 547.01 MB

Links from an Internet Search Engine  
8 different refering search engines Pages Percent Hits Percent
Google 373 91.8 % 373 91.8 %
Unknown search engines 11 2.7 % 11 2.7 %
Yahoo 9 2.2 % 9 2.2 %
AOL 5 1.2 % 5 1.2 %
MSN 5 1.2 % 5 1.2 %
Ask Jeeves 1 0.2 % 1 0.2 %
MetaCrawler (Metamoteur) 1 0.2 % 1 0.2 %
Dogpile 1 0.2 % 1 0.2 %

Programmers are lazy, self-important, unintelligent bamboozlers

I recently read an astonishingly bad article by Tim Bryce on “managing programmers”. The purpose of the article was to help other IT managers better understand their software developers. Instead, the article just reinforces the stereotype of the “Pointy-Haired Boss” that inhabits the Dilbert comics. It actually scares me that this article was read by people who manage programmers. Let me give you a taste of Mr. Bryce’s idiocy:

Regardless of the image they wish to project, the average programmer does not have a higher IQ than any other worker with a college degree. In fact, they may even be lower. Most exhibit little imagination and require considerable instruction and coaching in performing their job. When they have mastered a particular programming task, the source code becomes a part of their portfolio which they carry from one job to the next. So much so, that copying or stealing source code is actually the predominant mode of development in most companies. Consequently, there is little original source code being produced in today’s software.

I’m not sure why he had to make the remark about programmers possibly having a lower than average IQ. Where is the data for that? First off, IQ tests don’t accurately measure intelligence. Secondly, IQ tests are all about problem solving, something a programmer has to do everyday. I’m sure your average computer scientist would score better on an IQ test than your average manager who knows nothing about science or engineering. In fact, here are is a break down by major of average GRE scores (not an actual IQ test, but close):

http://www.iupui.edu/~philosop/gre.htm

Notice that computer scientists rank higher than business majors in all 3 categories. I’m not saying computer scientists are super smart, but it’s certainly unfounded to make comments about them possibly having a lower than average IQ.

And the comment about programmers requiring “considerable instruction and coaching in performing their job,” that sounds like something you’d say when you’re talking about how to train your dog. Any manager that thinks that way is going to foster an unpleasant working environment. No one likes to be patronized.

Programmers tend to perceive themselves as free-spirited intellectuals who possess the magic of technology. Whereas the knowledge of the language is vital to performing their job, programmers often use it to bamboozle others and heighten their own self-importance. To outsiders, programmers are viewed as a sort of inner-circle of magicians who speak a rather cryptic language aimed at impressing others, as well as themselves. Such verbosity may actually mask some serious character flaws in their personality. Speaking in a foreign language may be amusing to a listener for awhile, but will inevitably alienate people over time.

The author’s contempt for programmers becomes pretty apparent here. “Magicians”? “Aimed at impressing others”? These comments sound almost like jealously. Here are some more gems:

“There are very few true artists in computer programming, most are just house painters.” – Bryce’s Law

Without basic organization and discipline, programmers will become mentally lazy.

Basically, the programmer’s task is to convert human understandable specifications into machine understandable instructions. From this perspective, a programmer can best be characterized as a translator.

This last quote states a gross over simplification. If some engineers were to build a car based on a list of features someone requested, would those engineers simply “translators”? This statement alone shows that Mr. Bryce doesn’t know what he’s talking about. There’s more to software development than simply translating human specifications into instructions that a machine understands.

It’s actually flabbergasting that someone who obviously knows very little about programmers would write an article in such an authoritative tone. Not surprisingly, Mr. Bryce took a bashing in the comments section of this article. In his final reply back to his antagonists he states:

These are the same people who believe corporate cultures should change to suit their needs as opposed to the other way around. It just doesn’t work this way.

Unfortunately for Mr. Bryce, supply/demand is such right now that programmers have a choice in where they want to work. If you want to run your company like an ass, the good programmers will go elsewhere. Maybe this is why Mr. Bryce has so much experience with the “house painters”.

As a final aside, here are some real tips on managing programmers:

1. Have a good understanding of the technology you’re using / developing.
2. Thoroughly plan out what you want before having your programmers code it up.
3. Make sure your programmers have plenty of work to do. As a plus, make sure this work involves some thought of their part.
4. Free soda. Maybe this is more of a perk, but I seriously think every office would be better served if there was an all you can drink soda fountain.

For those of you who are interested, here is a link to the actual article:

http://blogs.ittoolbox.com/pm/irm/archives/theory-p-the-philosophy-of-managing-programmers-4993

Online “Girls”

A couple of years ago one of my friends introduced me to a rather interesting research project that his friend Matt had preformed. Matt had decided to take pictures of his then girl friend and post them up on a popular online dating site. He then wrote a profile for her – creating in effect what he felt was the perfect girl: Chrissy Parker. Chrissy was basically described as being nice, fun, down to earth, smart and obtainable. Matt wanted to see the kind of responses he’d get from guys on the site. Pictures are important, but how important is the content itself, and would that effect the responses that he received? And what kinds of letters do guys typically write to girls on these kind of sites?

About two weeks ago I had a chance to talk to Matt and asked him about the site. He laughed about it upon remembering it’s conception. He also mentioned that once he started reading the letters he felt kind of bad. I don’t think he was expecting the guys who wrote her to be so nice. He said they sounded like the type of guys he’d want Chrissy to date. His girl friend apparently also found this project interesting and read through the letters herself, though it’s unknown what she thought of them. According to Matt she wasn’t anything like the profile he posted up, and instead of being 22, she’s really 16 or 17 in the pictures that were displayed.

Anyway, if you’re interested in seeing a copy of the profile and letters that were received, you can find them in a nice little write up at the following link:

The Stupendous Chrissy Parker Project

Reading over it again it seems a little unethical, but it’s a neat idea.

Online Girls

I found the following blog post about being a female gamer somewhat entertaining:

http://lostinazeroth.blogspot.com/2007/07/being-female-gamer-for-profitor-why-do.html

Here’s the bit that fascinated me the most:

Although it is reportedly not as common nowadays as it was in the earlier days of WoW, every once in awhile, I will receive whispered questions of “Are you really a girl?” or “What do you look like IRL?”. I usually just shrug them off, but sometimes the invitations can be tempting. If you are supposedly a true female AND a sexy race (Night Elf or Blood Elf in particular) the attention you may receive can be insane. Being offered 5G (which when you are lower levels can be a small fortune) to “talk dirty” to a male character or a purported male player, isn’t all that uncommon.

For those of you who are unfamiliar with WoW, it stands for World of Warcraft and it’s an online role playing game. The game itself costs around $50, and then you have to pay around $15 a month for a subscription so you can play online. I’ve never played myself, but I had a roommate who was hooked on it for a few months.

Anyway, the whole idea of spending fake money to have some supposed girl talk dirty to you reminds me of the whole “cybersex” phenomena that was big in the mid to late 90’s. I remember being 16 and having a couple of friends over and all they wanted to do was to get on the net and “cyber”. I remember it being this huge thing, I remember being asked several times by people, after they found out I had net access, “dude, have you ever cybered?” Nowadays I don’t get that question so much. In fact, I don’t think I’ve been asked that question since I was 16. I’d hypothesize that the majority of guys doing that kind of thing in WoW are just horny teenagers, though I’m sure there are older guys doing that too, which is a little creepy, and a little sad too, I suppose.

New Online App

It’s here folks, check it out:

http://www.patorjk.com/software/colorfader/

About a month ago someone emailed me requesting I put my old online color fader back up. You can find it at the web archives here:

http://web.archive.org/web/20050310095844/www.patorjk.com/ColorFader.htm

It’s a neat little app, but I figured I could do a lot better, so I told that guy I’d write a new one and post it up in a week :P. It took a little longer than I suspected, mostly because I was distracted with other things (I didn’t start on it until last week). This new color fader is MUCH better. It can fade up to 100 colors, and has a nifty little feature that allows you to create background fades. Example:

With this app you can generate faded images 1 pixel wide which you can use as the background for certain page elements

I like the idea of generating images with PHP. I’ll probably play around with it a little more and see if I can make anything interesting. Though right now I’m still feeling pretty sick so I think I’m going to go lay down. Let me know what you think of the new app though!

Harry Potter Madness

I was one of those people who waited out side the book store in a long line, right before midnight, when “Harry Potter and the Half-Blood Prince” was released. The atmosphere was great: There were people in costumes (one group showed up dressed as jedis – which made no sense), lots of excited people, and lots of cute girls. I was actually pretty astonished. There are a lot of cute girls that read the Harry Potter books.

It was kind of odd for me to be there though, I felt sort of like a charlatan since I was only 100 pages into the fourth book (even now I’m still on the fourth book). I was picking up my mom’s reserved copy though, and I couldn’t resist the idea of a midnight book release. It seemed like a fun thing to be a part of.

Anyway, it’s that time of year again. Since this is the final book, I knew it’d be bigger and there’d be more crazy stuff going on. But unfortunately for me, it wasn’t to be. I’ve been sick as hell the past 3 days, and right now my throat hurts so much that I can barely talk. So I had to pass on the opportunity to check out the madness. My brother did drive by one of the local book stores though, about 15-30 minutes prior to midnight, just to see what was up. Here are some pics from the front lines:

I feel sorry for the people who work at the book store.

On an unrelated note, I’ve changed the root directory of this site – patorjk.com – so that it’s a frame that points to this page. I felt this was better than having a crappy looking page redirect you here. A brief check out of things seems to indicate that all is well. Let me know if you have any problems though. It’s actually a frameset with only one frame object in it. I had no idea you could do that until I tested it out (on IE and Firefox).