KBD

Keith Devens .com

Wednesday, July 9, 2008 Flag waving
Don't be an asshole. – Jason Hoffman

Archive: February 07, 2006

← February 06, 2006February 08, 2006 →

Daily link icon Tuesday, February 7, 2006

My PHP form doohicky library is awesome

My little form doohicky library is awesome (unfortunately, the version up there is pretty old). I know I've molded it into something fairly decent because I just added something to one of my 'actions' and I did what I thought should work, and it actually worked without changes to the library.

What I added was a hidden field in my comment form that tracks the referrer that someone has when he first gets to one of my weblog posts, which will stick with the form through previews and so on and I'll get it when I get my mail notification of the final post. That way, instead of having to look through my log to see where people came from (i.e. search engines or wherever), I'll have it right in my e-mail. Previously, I already got the referrer in my e-mail, but since the actual referrer for the comment submission will always be the same as the page of the weblog post it was pretty useless.

It took all of about 3 lines. 1 to define the field. 2. a condition to set it to the referrer if the field hasn't already been set and if the referrer is set. 3. something to set $_SERVER['HTTP_REFERER'] to that field before my mail gets sent off.

More on tabs vs. spaces

So, at work I've just been using the default settings on Visual Studio to determine my brace style and indent style. To my surprise I've found the spaces vs. tabs issue far more important than having my code look "double spaced" with braces on their own lines. For one, ASP.NET doesn't get you very dense or detailed code anyway, so it doesn't matter as much that there are some extra blank lines spacing out the code. The thing that's annoyed me about having leading spaces instead of tabs is that it gets real old real fast having to hit the backspace key four times the number of times I'd have to hit it were I using tabs. Say I hit the tab key an extra time by accident... that's four times I have to hit the backspace key. In fact, that's an extra argument for using tabs I hadn't considered before. A one-to-one correspondence not only between the number of times you hit 'tab' and the number of characters put in the file, but between the number of times you hit 'tab' and the number of times you have to hit 'backspace' to remove that "tab".

  1. Extend Firefox Contest Finalists Announced - MozillaZine Talkback. Ooh, gotta see if there are any good extensions here I haven't looked at before.

       (0) Tags: [Firefox]
  2. Totally Compliant Markup, an example of a table-less site. Nice. Via Adam Vandenberg.

       (0) Tags: [Programming]
  3. Terrorism Unveiled: Zakaria on "Islam and Power".

       (0) Tags: [Opinions/Politics]
  4. Eric Sink: Yours, Mine and Ours (via Keith Gaughan). Good article, but then I realized I still had about half of it left. Maybe I'll finish it later. FYI, my weblogging tool is an example of MeWare too. Smiley

       (1) Tags: [Programming, This website]
  5. SqlDataSource paging is lame:

    Note that the paging operation in the preceding example is being performed entirely by the GridView control over the DataView returned by SqlDataSource, which supports the ICollection interface. In this case, the GridView retrieves all of the data records from the data source, renders a subset of the rows, and then discards the remaining rows. This is sometimes called "UI paging" because the logic for paging is happening in the rendering layer of the GridView control. While convenient for paging over arbitrary collections, this is not necessarily the most efficient way to page over data. It is also possible to configure paging at the data source interface level, so that GridView requests only as many rows as it needs from the data source in order to render the current page. The SqlDataSource control does not support interface-level paging at this time.

       (0) Tags: [ASP.NET, Programming]
← February 06, 2006February 08, 2006 →
July 2008
SunMonTueWedThuFriSat
 12345
6789101112
13141516171819
20212223242526
2728293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 2 posts

Recent comments XML

getElementsByClass function

http://pitfalls.wordpress.com/2008/​07/07/querying-it-jquery-way-getele​ments...

maxgandalf: Jul 7, 5:50am

Generated in about 0.128s.

(Used 7 db queries)

mobile phone