Meta: New Feature

I’ve added a little detection script to the comments that records your user agent and tries to put nice little icons next to your name. The icons should depict your browser and operating system. Hovering over the browser icon will show the entire user agent. This detection script is at a very early stage, so I’m still reviewing user agents to best make it work, and only a few comments on the site even have the info properly stored thus far. If you want to test it, please use this thread.

screenshot

firsttube.com RSS integration

For those of you subscribed via RSS, you’re going to find a surprise very shortly. I integrated the “firsttube.com link blog” into the feedburner RSS feed for firsttube.com. If you are using a locally hosted copy of my RSS, you will still get only firsttube.com items. So just to review, here are your options:

firsttube.com main RSS feed: http://feeds.feedburner.com/firsttube

firsttube.com blog only: http://feeds.feedburner.com/firsttubedotcom

firsttube.com link blog only: http://feeds.feedburner.com/ftlinks

I highly recommend the main feed – I don’t add too many links on a daily basis and I try to be very particular about the ones I do add.

I will be updating the local RSS to redirect to the feedburner feeds within the next few weeks.

PHP vs. ASP.NET

We have a new web-based client portal application we are going to use for my company extranet. However, because it was originally designed to be a hosted application, there are several variables involved in all areas that don’t apply to us, since we host it ourselves.

When using said portal, every URL looks something like:

domain.com/login.aspx?QS=jasbndfiaubnfoaeuifwoeifbwfe

The only difference is that the “QS” GET variable is even longer. I made the request of our developers to get rid of this query string for the login page, and the login page only. This is what that code looks like in PHP, inserted at line 1.

if(!$_GET['QS']) { 
     $_GET['QS'] = 'jasbndfiaubnfoaeuifwoeifbwfe'; 
}

That’s it. One line of code. In ASP.net, this cost me 3 hours of developer time. THREE hours.

Then I asked our old developers to make a change to their code. It was doing a check in login if they are customers from the new app or the old one. If they are old, it processes the login. If it’they are new, it gives them an error message. So I said, instead of giving them the error, let’s redirect them to /new-directory/login.aspx?email=[base64_encoded email]&password=[base64_encoded password].

This is that code in PHP:

if($is_new) { 
     header("Location: /newdirectory/login.aspx?email="
.base64_encode(stripslashes($_POST['email'])) . "&password="
.base64_encode(stripslashes($_POST['password'])));
} else {
     //process login
}

This cost me 2 hours at $165. Am I getting taken for a ride? I keep telling them – this would take 30 seconds in PHP. And they tell me, yes but ASP.net doesn’t work that way, and we need to change the web.config, and we need to recompile the entire site, etc, etc. If it were just one vendor, I’d be more suspicious, but two separate, unrelated developers are giving me crazy quotes like this.

I hear people bitch about PHP online ad nauseum. Every time I see real code, it appears PHP is FAR faster and far more friendly when it comes to customization.

Look At Me, I Am Cool Because I Am Valid

I was playing around the other day on one of the many news sites I visit and there was an article about can’t-miss web site “footers.” So, I checked out these masterful designs and what did I find? Nearly all of them had “Valid XHTML” and “Valid CSS” links on them. Most, like my humble little blog, had fancy little 80×15 buttons too. And then it hit me – WHY!?

I am sick and tired of these buttons. Honestly, I don’t give a crap if your stupid homegrown blog is valid code, so long as it renders properly in my browser. I’m not using an accessibility application, and I wouldn’t stop visiting a site if it weren’t properly semanitcally marked up. I bet you very few external apps will choke if you enter a URL with an & instead of a properly escaped &. XML needs to be validated. HTML and XHTML don’t. HTML has survived because of so many browsers having such a capable quirks mode. Frankly, as of right now, I find the entire validation link concept obnoxious.

Slapping some tag on your page does nothing for your reader – if they truly have a screen reader or some such device, it will either work or not, no checking for a silly button. If the browser is a text-only browser such as Elinks, it will either render or not, but ironically, it will not display your stupid “Valid” buttons.

Furthermore, for almost every blog, validity is a product of dynamically build pages and feeds born from a database backend, and unless you are doing lots of checking, validity can be comprimised by invalid input, regardless of the quality of code.

OSNews v3 was written to render in virtually every browser, and to do so, it uses Eugenia’s mix of HTML 2 and HTML 3, a subset often called C-HTML. The code is just plain ugly, but it works. And it sure as hell isn’t valid.

Maybe it’s blasphemous for a web programmer to say such things, but the fact remains, bragging about or advertising your validity is pointless, and I think most of your readers have trained themselves to ignore it. Also, if your code works and renders properly, what difference does it make?

I’m sure people out there disagree and will tell me why I’m wrong. But in the meantime, I will be removing the buttons from my site the next time I edit my blog code. Pffft.

OSNews v4 Logic

I was playing with an outlines of OSNews version 4 today. I have started sketching out some ideas that I intend to implement geared at making the site more consistent, easier to use, less complex, and less heavy from a code standpoint.

One of the major areas to improve is commenting. I am going to change the way threading works almost entirely.

First off, comments below your threshold will not disappear anymore. They will simply be collapsed and greyed out. Yes, this is a bit digg-ish, but we had to implement a lot of complex code in order to compensate for parent comments that were below threshold. So unless a comment is administratively hidden, they will show and be un-collapsable via Javascript (I don’t know if it will be AJAX or just Javascript div swapping). I think this is a better solution than we have today.

Secondly, moderation will definitely be AJAX-based.

Thirdly, I haven’t “cleared” this with David, but I think flat comments will be hard coded to view all in one page. It’s so much easier on the database to use a single, easy light query than to force several page loads and hit the db over and over.

Next, the comment template will be unified. Currently, there is a flat template, a threaded template, an admin flat template, an admin threaded template, and a reply template. I’m going to fix this nonsense.

In the process, I will clean up commenting. Comments use a ridiculous chain of includes just to produce a comment. This is the effect of hacked feature upon hacked feature of v3, and v4 will fix this.

Other changes: the user page will be streamlined to display user information as well as provide a base for recommendations, etc. Currently, it’s trying to be too many things.

Lastly, I intend to clean up the URLs. While preserving all valid links, I want the URLs to be prettier and not have file extensions. Jobs.OSNews is a good example of what I’d like to see via the URL.

Anyway, if you have thoughts about features, etc you’d like to see, feel free to leave a comment.

I Found a Google Bug!

Yes, I can now confirm that I have found a bug in Picasa Web Albums. Since the new “tagging” features are not validated – either client side or server side – you can use URL signficant characters in your tags. At first, I used a plus sign (+), which was URL decoded as a space. This lead me to try #, then ?, and finally &, which inexplicably – WORKS!

So I created a new tag D&psc=CONTACTS — and guess what? — it has some funny results. It searches all of your contacts’ photos for the letter D (which is common in default photo names, such as DSC001.jpg). Then I thought, “I wonder if I browse the JS source if I can find a command that is passed via URL GET variable that can be instantiated via an intentionally malcrafted tag?” I have posted on the Google USENET group and filed a bug through the standard complaint form. I consider this pretty big news, but I don’t want to submit it to digg or Slashdot or post on OSNews until someone has a chance to implement a fix, which is probably pretty trivial (URL encode the tag links) or fix it properly (validate tags on creation).

Anyway, I’m psyched, because I understand it’s pretty rare to find a bug in Google’s code.

Planning OSNews Version 4

So we’re really beginning to talk about the next iteration of OSNews. There are several things we’re talking about right now, but since I’ve gotten a lot of web experience since the coding of OSNews 3, written several new and powerful web applications, and since we’ve, since rollout introduced several new features and several new optimizations, including multiple caching techniques, I’ve been trying to decide whether it’s best to just fool with the interface, or whether I want to actually rewrite parts of the front and backend. I’ve written lots of apps for work – some are completely AJAX based, some don’t use Javascript at all. Some are completely object-oriented, some are procedural. Some are very tied to MySQL, some use Microsoft SQL Server.

There are definitely ways to continue to optimize OSNews, but it would require some major changes. I’m not sure I’m up for that, and it would also mean changes to the mobile site. That said, I think the smartest thing to do is to do some rewriting.

I told David today that I have some requirements – yes, requirements, if *I’m* going to be coding OSN4. At the top of the list is reliance on CSS for the majority of layout and liberal use of javascript for the UI. I want freedom to go for the whole kit and kaboodle — AJAX (where it makes sense) and javascript in many places to accomplish what we can on the client side. Things like moderation should not require a page load – or two, as it currently is.

I love our claim that we render everywhere, it’s unique and we are probably one of the best sites on the net for mobile use. But I’m so over coding in HTML 3. It took me less than an hour to get threading working properly on this site. It took me days to plan and code it on OSN.

So, as I approach the run for OSN4, I’m thinking of what we ought to be implementing and the best way to do it. We’re going to do some slimming – we’re probably give up themes initially. We’ll probably give up multi-mode comments: you’ll get to choose between flat mode (all comments, in order) and expanded threaded. We’ll probably scale back some features, but expand others.

Either way, it’s sure to be an adventure as we get there.

PHP Lesson 2: Behind the Scenes of Threading

This is going to be a very nerdy post, because I’m going to get into some actual PHP code. I’ve been thinking a lot about efficient threading. The implementation of threading on OSNews is very complex, because it involves lots of math in order to properly construct and align tables. Furthermore, because we don’t use CSS for positioning, it’s accomplished via ‘align’ commands and TWO templates, which is really clumsy, because between flat mode, admin mode, collapsed threading mode, and expanded threaded mode, we have several templates, and since they are all independent, they tend to unintentionally vary, so you might see different things in replies and threads. My goal in writing a threaded display for firsttube.com was to avoid all of the pitfalls in that implementation and come up with something clean. Read on for the gory details.
Continue reading

firsttube.com gets threads

I understand that some people believe that threading comments are unintuitive, they confuse the user, and that they are ugly. I like ‘em. So this site now supports threading in the comments.

Now – as of right now, you can only reply once, like digg, but it supports two deep. This is only because I haven’t found a more elegant way to allow deeper threading in the code. As soon as I do, I will be allowing deeper threading, probably 3 or 4 comments deep for aesthetic reasons.

The entire thing is done in CSS, unlike OSNews which is hard coded to the pixel with very complex code that really makes me uncomfortable when I see it. This is much nicer. It’s all done via templates, and there are only two – one for comments and one for threads, and this will probably change to one soon too.

Small Axe Getting Close To Actual Releases

I am very close to releasing a flood of code on smallaxesolutions.com. Included in the first batch are:

- Small Axe Encryption (which is VERY breakable (being as though the decrypt code is actually available, but a new version, which uses a password to decode, will eventually be out).

- Small Axe PHP XML-RPC API. YIKES. What a mouthful. It’s by far the easiest API out there. I have searched high and low for an API. Version 0.1 is so simple it’s crazy.

- Dango 2.1. A simple discussion board. Version 3 will be a complete rewrite, so this is a nice mini-step.