Tuesday, March 31, 2009

Connection Reset error resolved

I just resolved the weirdest bug with a web site.  I had already built this web site for a customer which includes a way to upload Excel spreadsheets, parse them and store them in a MySQL database.  The code was working fine on my development server, and on the test server, and the customer could use it.

When I pushed the code to the production server, the upload just would not work.  It kept giving the error, "Connection Reset", in the Firefox browser, along with the message: "The connection to the server was reset while the page was loading."

I went back and tested it on my development server - and the same issue was happening!  I could not upload any spreadsheet files, the error would instantly occur; no time-out period or anything.

I tried adding debug statements early on in the PHP code which received the file, but the browser would not render any HTML at all; the error came up before that point!

Solution

It turns out it was a firewall issue on my end.  I had set up port blocking a few days prior to keep my kids' computers from hogging all my bandwidth - I blocked ports 6881 thru 6899, the Bittorrent ports, so that I could actually get some work done.

For some reason, those ports were being used by file uploads of any sort, at my end!

So if you have problems with file uploads giving this kind of error, check your firewall settings.  It could be close to you (within your control), our at your Internet service provider's end (they're blocking ports for you).  My Qwest DSL business-Internet line has no ports blocked by the provider, thank God.


Sunday, December 21, 2008

Podcasting Problems

I just installed Juice, at a friend's recommendation, for managing Podcasts I listen to.
After playing with it for about 5 minutes, I can see it's not usable yet by normal human beings.

The Library feature has many lists of podcasts, more than half of which could not be viewed (some kind of "error"). Some of them had weird HTML entities and even [[CCDATA type things in them which shouldn't be there. And none of them were the basic tech podcasts that I personally consider most important: like, anything from Leo Laporte (Twit, Security Now, ...) or Revision3 (Diggnation, Totally Rad Show, ...)

I figured, maybe that's OK, there's a LOT of podcasts out there now, I can excuse it if it doesn't know what I personally like.

Using the Library was very discontinuous; you CANNOT click on a "+" sign to open the list, you have to know to click on the little folder-icon to open it. Then, to close it, you CANNOT click on the folder, you must click on the "-" sign! That's ridiculous; both should work in both situations. In fact, let me click anywhere within the big rectangle defining the entire line, from left to right, top to bottom, to expand/collapse that part of the tree list. Basic usability concepts, and I'm not even an Apple person.

Ignoring all that, I went to the "Downloads" tab. It looks like there's a search box at the top, so I typed a keyword and hit Enter. Nothing happened. There's no "go" button to click; I clicked the little magnifying-glass, nothing. I switched over to the "Subscriptions" tab and tried it there, same results, nothing. No error message, no throbber, nothing changed on the screen whatsoever. I waited. Still nothing.

That's just wrong.

OK, I figured, I can find a RSS feed or something with a web browser, and click the link to get Juice to see the podcast. After all, I answered "yes" when Juice asked to take over certain extensions, when I ran it for the first time; and I checked all the extensions it wanted to own, including podcast://, pcast://, .rss, and others.

I web-browsed over to TWiT's home page, and found a nice podcast to try. I chose the "pcast://" choice from a menu below the picture of a good podcast, but nothing happened. So I chose the RSS feed link instead; this time it brought up a little window, asking what app I wanted to run. I thought Juice was my new default? Shouldn't this stuff just work? I chose "Juice" from the application-to-run choices on my local machine, and guess what -- absolutely nothing happened.

My juice was already running, but the screen didn't change in any way. No new podcast showed up under any tab in Juice. It lost the message from the web browser that it was supposed to open a podcast RSS feed.

This is ridiculous. It shouldn't be this difficult for anybody to view podcasts. Podcasts are simple. The podcast has a name, and a list of episodes in 1 or more formats. That's it. A podcast client(player) has the ability to remember podcasts you like, and supports 1 or more formats. Who cares what the formats are! I just want to view my podcasts! It's not that hard.

You know, I hate Itunes, personally, but you have to admit they totally solved all of these problems. I can keyword-search for podcasts, and click a "subscribe" button next to the one I want. Then, it immediately downloads the latest episode. I can queue up downloading of more ep's if I want. I can see all eps that are downloaded and not-downloaded, and when I'm done with one, I can hit "delete" to delete the ep from my machine to save disk space. When I do that, the ep is no longer listed as downloaded OR not-downloaded; it's simply gone, which is the right thing to do. This way I have a sense of completion, and I can see how much more un-listened-to ep's I have to go.

I have a lot of issues with Itunes, but for podcast viewing, I have not found anything as simple or bug-free as Itunes yet. I'm sticking with Itunes until something better comes along.

Friday, August 29, 2008

The Real Reason Flies are Hard to Swat

Just read this scientific article on why flies are hard to swat:

http://www.physorg.com/news139142949.html

That's all nice and good, but they're on the wrong track. As scientists, they're analyzing the mechanics of flies and fly swatters to a microscopic degree, completely missing the basic truth about flies. The truth which, if they only realized it, would enable them to swat flies nearly every time, over and over again, with little difficulty. I know because after I figured this out I was immediately able to swat flies in my back yard without missing, at least 9 out of 10 times. And I can still do it today.

My Fly Swatting Story

About 2 summers ago we had a dog which would poop all over the back yard. Our 12 year old son had the responsibility for cleaning it up, but if mom and dad didn't keep on him about it, sometimes an entire week's worth would be out there - a field of landmines for anyone walking around the yard. What's worse, our big outdoor trash can needed to be washed out pretty badly; let's just say, that summer we had lots and lots of flies in the back yard, and it was my "duty" to swat them before visitors came over to our house.

I'd get out there with my trusty bent-up wire fly swatter, running back and forth across the porch in the heat, trying to catch those little suckers when they landed on anything. I was missing a lot, hitting maybe 1 fly for every 15 swings, and getting really frustrated. They'd taunt me, landing on my forehead or my swatter arm sometimes just to piss me off.

Then I did something funny; I went to swat a fly, I began the motion, but something happened and I didn't move my arm (I think my elbow locked or something, it happens sometimes). The swatter didn't go anywhere near the fly this time, yet - the fly immediately flew away!

I had to think about that for a while. What just happened? No part of me or the swatter went within 3 feet of the fly, yet he took off as if the swatter just landed next to him!

My Discovery

A few days later I figured it out. Flies can feel emotions that creatures around them emit, just like any other animal! Flies are just really small animals. They're tiny, so their reaction times and movement are quicker, but they still have all the basic traits of animals. Larger animals like dogs and cats can sense when you are happy, sad, angry - from many feet away - and react based on that. Flies are no different. And, if your life depended on fleeing from a huge creature that's about to kill you, wouldn't you use your senses to know when to fly away too?

The Test

During the next few days' worth of fly-swatting, I watched myself: sure enough, I could feel myself emit a pulse of emotion right at the moment of swinging the swatter at a fly. Now, it wouldn't happen if I "pretended to swing", or "tried to hit NEXT to the fly"... I couldn't psyche myself out. I had to really be trying to hit a fly, and I would feel this quick pulse of emotion coming from me right as I committed to the swing!

What if I could suppress that emotional pulse?

I practiced and practiced. Man, it was hard to control that pulse. I tried thinking of something else while swatting. I tried doing math in my head while swatting. I tried staring at the paint that needed touching up on the wall while swatting. The problem was, I wasn't looking at the fly, so I couldn't really see what I was doing. Was I was missing, was the fly still flying away before the swatter got there? Etc.

I realized I just had to make my arm be an automaton - a robot arm. My arm must move when I command it, and all other parts of me must stay calm, cool, collected. No thought. No feeling. Just 1 movement of 1 arm, and nothing else.

I practiced and practiced. Finally I was able to do it once only. With more practice I could do it about 1 out of 10 times - but every time I could feel myself doing it right, I would hit a fly!

It was tiring. It took a few days of trying, getting mad, jumping up and down on my fly swatter, and trying again the next day. Thankfully we had no end of flies at that time - I could easily swat 40 a day and still have another 40 flying around the next day. I practiced and practiced, and finally got good at it.

Now, I can do it almost every time, as long as I'm focused on "nothing" while swatting. The fly won't move, because it won't sense the danger.

Learn About You

This is one of those "I learned something about myself" experiences. I learned that a lot of things we do every day have a complex combination of elements to them that we don't see. Elements of our physical, emotional and mental selves, all mixed together. Some of the parts are lightning-fast; most of the time we don't even sense them.

Can you think certain thoughts without feeling the related emotion, without changing the features on your face? That's called a poker-face, in some circles. Can you feel an emotion without moving a muscle? Can you make a movement without requiring a burst of emotion or thought? These are good things to practice.

I learned that it's possible to move without letting my emotion give away my movement. I learned to swing my arm at a focused location without sending out a "ping" of emotion right beforehand. I had no idea it was even possible.

It's like juggling: it sounds easy until you try it; after trying it, you're convinced it's impossible; after lots of practice you can do it almost without thinking about it. Teaching myself to juggle helped me learn how to drop things on the floor without the related emotional self-abuse that was part of my family heritage growing up (but I'll save that story for another blog post).

Our Back Yard Today

We have a different dog now, and the kids are older, so their chores get done more reliably now, and I cleaned out that trash can. We don't have the fly problem anymore - I haven't seen more than 2 or 3 flies in the back yard all summer.

But hand me that swatter and back up a bit - I still can take 'em down if I need to!

Wednesday, August 13, 2008

Feedly Breaks Firefox - new window opens gray

Problem

Any web page opening a new window (or if you use Shift key when clicking a link to open a new window) in Firefox resulted in a gray window and no content. The URL will be shown in the Location bar, but no content would draw, for any web page. No other problems exist with Firefox, and this problem didn't show up on any other systems I use, only this one computer.

This machine is a Windows XP laptop.

Solution

Disable or Uninstall the Feedly add-on!

Reason

Feedly version 1.0B4 is causing the damage to Firefox.
I don't know what's wrong with it, but it was the culprit.
I won't be using Feedly until it's out of Beta now.

Saturday, October 13, 2007

Itunes Sucks; try Miro!

Have I written about how much Itunes sucks?
I'm a software developer, among other things, and I hate having to use sucky software.
Don't get me wrong, the idea of Itunes totally rocks.
But the way they actually implemented it is really bad.
The biggest offending design flaw in Itunes, for me, is the lack of multithreadedness.

Itunes tries to do many things all at the same time. These things can be categorized into two parts: interacting with a live person trying to use Itunes, and downloading stuff in the background off the Internet. Because Itunes tries to do all of these things in one "thread", or execution stream, if the downloading part slows down for some reason, then the whole software package locks up, sometimes for MINUTES at a time, stopping the user from interacting in any way with the software!

This is a terrible design. The very least they need to do is do all network I/O asynchronously. That means to "request" data from the Internet, and NOT WAIT FOR IT TO ARRIVE; let the network software layers notify Itunes when the data has arrived, and deal with it once it's here.

The second thing they need to do is COPY FILES ASYNCHRONOUSLY. This is the biggest offending part of the software for me. Once a download of a podcast is complete, the whole system LOCKS UP as it copies the files from some temp directory into the directory Itunes wants it to live in - LOCKING UP the user's experience entirely. Vidcasts are even worse, because the files are so much larger, so the lockup-time is longer. This is terrible when you're trying to listen to a podcast or watch a vidcast -- it just stops in the middle, you can't do anything with Itunes at all (it won't even redraw the window if you bring something in front of it and then bring Itunes to the front again). You have to wait until Itunes feels like working again. And then, the podcast has jumped forward past the section you missed! It's like it was always playing even when it was locked up. Now you have to rewind your pod/vidcast a little bit (which also isn't easy) to see what you missed! When the next download completes and it locks up again, you have to repeat it again. VERY ANNOYING, APPLE!

If asynchronous I/O is too complex for Itunes programmers to comprehend, they should convert the application to a multithreaded design, the idea being - if the CPU has to lock up while copying/downloading something, let it lock up in a separate execution branch -- KEEP THE USER'S EXECUTION THREAD SEPARATE, so the user's experience never locks up.

It's not that hard - lots of apps can do it today. Apple gets so much positive press and kudos, yet their software quality SUCKS. They torture their users with crap, and their users love them for it! I don't really get it.

There are better software systems than Itunes, nowadays. I've been using Miro (previously known as Democracy Player), which has all of it's own bugs, but at least does not have the horrific ones that Itunes has, thank God.

Give Miro a try. It's open source, it's free, and it's improving all the time, unlike Itunes.

Miro rocks.



Powered by ScribeFire.

Sunday, June 10, 2007

Open ID is cool

I just learned about Open ID. It's basically an open source version of MS's Passport, but much better. I want to build web sites now that use it for authentication instead of having to write authentication code (not simple) or use someone else's (not necessarily trustworthy).

OpenID sounds really great from what I've seen so far, and more and more sites are adopting it.  Single sign-in to share trust across many web sites; common information you make available to those sites; and more.

Go to the web site and read about it - and create an ID for yourself today.







Powered by ScribeFire.

Sunday, May 13, 2007

When Internet Explorer Erases Bookmark Icons

When you add a web site to your Favorites in IE6, if there's a favicon for it, that graphic will be drawn on the menu next to the name of the Favorite, which is pretty cool. But I noticed that over time those icons disappear - and I wasn't sure why.

Quitting and rerunning IE didn't affect it. Rebooting didn't affect it. But I finally figured it out.

If you go to Internet Options and Delete Temporary Files, and check the "erase offline content" box - that wipes out all the menu icons for all web sites you've bookmarked so far.

That seems wrong to me. A menu icon has nothing to do with offline content, in my mind. I guess those icons are physically stored in the Offline Content folder, wherever that lives under Windows XP.

It just seems to me like they should store them separately - and never wipe them out. And, if you visit a web site that has a favicon different from the one displayed, it should download it and display it! That never seems to happen with IE6 even though it pings the web server to check on the favicon.ico file.

There's a number of weird bugs going on here. I hope they fixed them in IE7.