Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Jeff Makes Software

The software musings of Jeff Putz

  • Using WebRequest... what the heck is wrong?

    I'm changing credit card gateways, using Authorize.net. I whipped up a class that I can use on all my sites, the key method being this one:

    public void Submit()
    {
        string postElements = "?x_login=" + _login
            + etc...;
        WebRequest request =
     WebRequest.Create("https://secure.authorize.net/gateway/transact.dll"
     + postElements);
        request.Method = "POST";
        request.Timeout = 60000;
        WebResponse response = request.GetResponse();
        StreamReader sr = new StreamReader(response.GetResponseStream());
        string result = sr.ReadToEnd();
        sr.Close();
        response.Close();
        _rawResult = result;
        string[] results = result.Split(new char[] {'|'});
        if (results[0] == "1") _approved = true;
        _errorText = results[3];
        _avs = results[5];
        _transactionID = results[6];
    }


    This works great from a unit test that calls it something like this:
    Transaction t = new Transaction();
    t.Address = "3412 Beaumont Dr.";
    etc...
    t.Submit();


    But when I try to use the exact same code in my Web app, it ALWAYS times out on the request.GetResponse() call. What gives? How is that possible? It times out both on my own box (the one that runs the unit test fine) and on my production server.

  • LiveJournal acquisition and blogging as a business

    I can't take credit for seeing this first, but someone else posted a link to this blog that says Six Apart is buying Live Journal. The question becomes, what the hell for?

    Between Google buying Blogger and the start of MSN Spaces, I keep scratching my head wondering how it is anyone expects to make a buck with a blog site. Sure, I have CampusFish, and it's not free, but I built that largely for myself and as a coding experiment (it's based entirely on POP Forums). I basically made enough this year from that to cover the SSL and domain name registration.

    So what is the business plan for blogs? I keep seeing little hints of companies getting back into the "we have eyeballs" frame of mind. I learned circa 2001 that I could care less how many "eyeballs" I have. I would sooner have a thousand paid customers than a million people who visit a site and pay nothing.

  • Half-Life 2 demo and Steam: Crap

    Since the only thing that really showed off my 6800GT video card was Doom 3, I thought I'd give the Half-Life 2 demo a shot. After all, GameSpot says it's super pretty.

    It starts by installing this stupid Steam crap. Why do developers think that everyone should be OK with loading crap upon crap every time you start Windows? Why the hell does anyone need a program to run at startup to play a freaking game? Sorry, but if it's not anti-virus software, it doesn't need to run.

    Then I get to the game, and as soon as it starts with me on the train, it starts to choke and the audio gets choppy until it eventually freezes. This is after one of the most ridiculous load times I've ever seen. Made Doom 3 loads look like a cartridge-based console game. Since the Steam crap was running, I could tab-out, and kill the process, which took a few minutes.

    Thanks, but no thanks. I'm not going to drop $50 on a game that you require me to register for, load a startup program and then crash. Nice going, Valve!

  • Inside view from G4-TechTV

    I've made a lot of posts regarding my disdain for the merger between G4 and TechTV. I swear it was the most ass-backwards thing to happen in television. TechTV had finally been making great strides in the ratings for shows like Call For Help and The Screen Savers, and regular viewers really enjoyed seeing the people on the show.

    Two former on-air personalities have shared their experiences online. The first is Dan "Foo" Huard, who started as an intern for The Screen Savers back in the days that Megan Morrone, Leo Laporte and Patrick Norton. He worked his way up to producing even through the move to LA, before they let him go. He gives his account of his entire time before and after the merge.

     I didn't know this, but Wil Wheaton (yeah, the Star Trek kid) was apparently hosting G4's "Arena" show. Things went to shit with him too and he left on his own terms.

    Both of these stories have a common theme: Executives and producers that had no idea what the hell they were after. The Comcast morons see the video game industry as this giant multi-billion dollar industry and they want a piece. TechTV, while apparnetly never making mad profit, saw a bigger market in technology in general, both in terms of helping and educating viewers and keeping them informed of what was going on in the world. If you ask me, that was the right direction considering you had people like BMW and IBM on your advertiser list.

    But no, gaming entertainment seemed like a better idea for the Comcast folks, and they somehow think that expanding the subscriber base ten-fold would magically cause the cash to roll in. Instead, they've managed to alienate the huge audience that TechTV cultured, and killed any credibility they had with the G4 gamer audience. Both audiences are smart enough that they can smell bullshit like a fart in a car, and boy does it stink in there.

    I guess the worst part, as someone that used to work in various broadcast jobs, is that the people that really make the "magic" are the ones that suffer the most at the hand of executives and a company that has no clear leadership or vision. TechTV had a lot of brilliant people on and off camera, and it came through in their programming. People like Leo Laporte, who had a wide appeal but was apparently not hip enough for G4, will always have work, but the young people like Foo, Yoshi, Sarah Lane, Kevin Rose and others may not be able to bounce back in a broadcast job if things go down the tubes. This is not to say that life would be over (look at Megan Morrone, who has a beautiful daughter and is now carrying twins!), but you hate to see talented people get underservingly screwed.

    In business, it's rare that good people leave a bad situation to form a new company and do great things, and it's especially hard to do when starting a TV network, but wouldn't it be amazing if just such a thing could happen?

  • Text searching fun

    I mentioned the other day I wanted to figure out a good way to search volumes of text in my forum without the full-text engine of SQL Server. I didn't really find a lot, other than the way that SQL Server does it (or apparently does it, I've not seen a really thorough explanation).

    The obvious path is to break up every piece of text and create a table full of words, filtering out the "junk" words like "the" first. So I copied the posts from CoasterBuzz (about 440k posts) and gave that a shot with a quick prototype.

    I started to get bored with the indexing process and stopped it at about 2 million rows. I'm not sure why, as I had no reason, but I was skeptical that this was going to be very fast. With an index on the Words column, I started running some queries in Query Analyzer, and what do you know, the searches were nearly instantaneous. Huh. Not the results I expected. I did some AND's and OR's, still fast.

    So now I'm scratching my head wondering why I didn't try something like this, I don't know, years ago. I expected an endless tweaking effort to get performance to an acceptable level, and it just works. Stuff is never this easy! I assume that boards like vBulletin do something like this as well.

    So now I just need to figure out some kind of word ranking scheme. For that I think I need to just look at existing topics that I as a human understand as relevant to a word, then apply that to some goofy algorithm.

    Hooray for things being easy for a change, and hooray for SQL Server!

  • A probably obvious question about generics

    Don't hate me because I'm ignorant... remember that I don't have a formal programming background. If I'm to understand generics correctly, using System.Collections.Generic.List<T> will be ridiculously faster than using an ArrayList, because everything is boxed/unboxed to and from an object in an ArrayList, right? Whereas List<T> is a collection of objects that are a predictable type?

    In a related question, is BinarySearch() still the best method to find objects that have a particular property value? And I assume that the type I'm searching has to implement IComparer?

  • Fed courts say don't tax VOIP

    I was happy to see that a federal court upheld the notion that states shouldn't be taxing voice-over-IP service. This is the correct decision.

    States like New York are trying to make the case that it's just like any other phone service, but that's not even remotely true. Heavy regulation of traditional phone service is justified because it's essentially a limited resource and a natural monopoly. It's not like every company can string up a phone network. Cable TV is regulated under the same premise.

    Have you looked at your phone bill lately? I'm absolutely astounded at the number of taxes. They take up one entire page of the bill now. It's ridiculous. The only thing that has kept me from flipping to Vonage is that, for the moment, I can't carry over my phone number... yet.

  • Looking for text searching strategies, thread communication in a Web app

    I'm looking for articles that explore text searching strategies. I've read a lot of general ideas about creating word indexes and giving the words rank based on frequency, and referencing those indexed words to the database records that contain the full text. I'd like to read something with a little meat to it regarding performance and such.

    Anyone personally take a shot at this kind of thing? And no, I'm not looking for, "I just use SQL Server's full-text indexing." :)

    Related to that, I'm curious if anyone has advice on having a Web application communicate with a thread it launched. Please, let's not go into the case against launching new threads from a Web app. The kind I'm thinking of (like indexing text) would be run periodically on a timer from an HttpModule, not user initiated stuff.

    Your opinions and knowledge are, as always, appreciated.

  • Open source and documentation: Round 2

    In my last post about open-source and documentation, Chris Martin makes the assertion that: "If you don't like the way something is implemented, you do it yourself and it ends up in the distribution of said software... Instead of complaining, you should contribute."

    I'm not even sure where to begin with that one. I would say more than half of the projects I've ever encountered on SourceForge don't have an ounce of documentation. I'm the last person in the world that believes every projects needs a scope document and a stack of use cases, but if you can't at least write some basic documentation to get me started, why should I be interested to continue or improve upon your work?

    Furthermore, this "contribute instead of complain" nonsense is laughable. The biggest open-source zealots say this kind of thing all of the time, and I can't help but wonder what their time is worth. I can do 30 to 40 hours a week for work, but the rest of the time goes to family, friends, and even getting my ass kicked on Halo 2 from time to time. If those work hours aren't generating revenue in some way, I'm really not interested. The good cause of freesoftwaredom is not even on my radar. If there's not a good open-source implementation of something, I'm perfectly fine with paying someone to do the work and hold them accountable.

    S Dot One says: "You got the ULTIMATE documentation with open-source... The source code itself."

    If I had a dollar for every time I heard that in an agile workshop, I'd live somewhere more tropical than Cleveland. It's the worst cop-out in software development today. Yes, it's true, that in an agile/XP environment that the code is generally simple enough that you should be able to read it and understand what it does. I get that. We heard that over and over again in a stint I had at The Second Largest Auto Insurance Company. What no one ever explained is how that translated to some kind of context for the use of said code.

    The truth is that no matter how narrowly focused a piece of code is, it's rarely something that you can consider language/platform neutral, and there's almost always a different way to do exactly the same thing. So when it comes time to revisit the code, revise it, change it, whatever, you're left scratching your head because you have no idea what context the code was running in, or what business problem it was trying to solve. I saw it happen even in short itterations from an agile team.

    I guess what bugs me the most is that people don't speak up and form their own opinions about things like open-source or agile. I don't know if it's fear of retaliation, fashion addiction, consultant backlash, or what.

    Am I against open-source software? Of course not. I've been giving away POP Forums for about a year. I also document all 600+ classes, properties and methods. I don't remember what I wrote and what my own reasoning was; I certainly don't expect someone else to guess.