Archive for the ‘Programming’ Category

Adventuers in Wix: checkbox

Thursday, February 18th, 2010

In case anyone is wondering a checkbox in wix is checked if it has ANY value (even zero). If it has no value it will be unchecked. So look at your property and make sure it has no value set if you want it to work properly.

Flashing Browser Title

Monday, July 20th, 2009

So as part of this chat application I’m writing, I was told that I needed to alert the user that a new message had arrived, even if the window was minimized. So I decided to flash the document title with different text. This seemed pretty straight forward, but I thought I would post what I did, in case someone else needed to solve the same problem. Keep in mind that the originalMsg and changeMsg in my application are set on the server side because they are dynamically generated, but if you don’t have that requirement, you can just enter the static text in the JavaScript directly.

Enjoy!

        // Create the variables
        var timer1 = null;
        var timer2 = null;
        var originalMsg = “”;
        var changeMsg = “”;

        function changeTitle() {
            if (document.title == originalMsg)
                document.title = changeMsg;
            else
                document.title = originalMsg;
        }

        function delayChange() {
            timer2 = setInterval(”changeTitle()”, 2000);
        }

        function startFlashTitle() {

            if (timer1 == null && timer2 == null) {
                timer1 = setInterval(”changeTitle()”, 2000);

                setTimeout(”delayChange()”, 1000);
            }
        }

        function stopFlashTitle() {
            if(timer1 != null) clearInterval(timer1);
            if(timer2 != null) clearInterval(timer2);

            document.title = originalMsg;
            timer1 = null;
            timer2 = null;
        }

HACKED… AGAIN!!!

Monday, August 4th, 2008

It appears that while I was gone over the weekend, having a very very dramatic Friday and re-self-discovery on Saturday and Sunday, my website WorldLee.com was hacked!

I spent the better part of Sunday evening and some time at work today going through and cleaning up the mess, and there’s still no guarantee that things are as they were (I did everything short of reinstalling everything from protected backups.)

The long and the short of it is, several months ago I was naive enough to have one password for all my internet sites. I thought, like most, that if I had a secure password I shouldn’t have to memorize dozens of different passwords. Unfortunately, I was tricked into putting my MySpace information onto a bogus page, and from there the hackers got into my Yahoo! mail account and started spamming people. Worse, they got into my PayPal account and tried to transfer several hundreds of dollars into their own personal bank account.

I don’t suppose the law ever got up with them, I thought the issue had been resolved and I had, like a good boy, changed all my passwords to a new, constantly changing and very random password choice. No one should have been able to hack my passwords again. But guess which password I forgot to change? That’s right, because I never actually type in a password for my FTP account, I forgot to change it. Welp, I guess those people took their revenge by using that password to compromise my site. Hopefully they didn’t get a hold of any of my other passwords, because if they did, they’d have access to…. well, just my site… since I’ve changed everything else to something different.

Let this be a warning to you! Password theft is real… be careful where you put it.

The Trouble with Size

Wednesday, July 30th, 2008

No, this isn’t going to be a perverted posting, not that I wouldn’t post perverted, just… well this isn’t going to be one of them. This post is about the trouble with screen resolution size and website design. As with most Web Developers, I have to decide how big I want my site to appear on the computer screen.

To big, the user has to scroll back and forth to read content, too small and the user sees way too much space around the edges of the site. And monitors are so many different sizes now. We know that users can use Blackberry’s and iPhones all the way to 30-inch monitors (I would love one of those by the way).

Recently I was working on a website prototype for a student run radio show, and was forced to give up my long held belief that you should always design for the smallest commonly used monitor size, which is 8 x 6. But after going around to different sites, including Apple, Microsoft and dozens of others, it’s become clear that they are all choosing a website based on a 10 x 7 site. They don’t even collapse all the way if the site is smaller. So if you don’t have a high resolution monitor, your S.O.L. and will have to scroll back and forth.

I realize that monitors will continue to grow in size, but I suspect that 10 x 7 is the last standard that people will live with for browser sizes. That’s because anything else puts way to much information for any person to read.

After looking at dozens of sites, I’m convinced that most sites have too much information coming at you or flying at you, or blinking at you. They don’t make it clear how to find content and everything ranks as being too important.

In my new design, I made a site that was very simple and elegant and classical while keeping a solid professional feel to it. I even added a few bits of fun to keep it interesting.

I really hope my client likes it as much as I do… but of course, that’s part of the game. He might hate it every bit as much as I love it.

.Net or .Not?

Monday, July 21st, 2008

I have been working for the last two weeks on a project for FedEx where I am building a proof of concept for a utility that goes out to a server, downloads a file, parses that file, and then based on what it finds, determines what other files need to be downloaded. Its a very simple, system and should not be that complicated to implement… at least… you would think. But after scratching my head in confusion and surprise, I am left with only one conclusion. Microsoft’s .Net framework has very little in the way of Network architecture.

For instance, while there are things you can do with HTTP, the support there is lacking. You don’t have nearly as much control as you need to make things work. I can’t, for example, get the file size, or pick out just the header information from my documents. There is no support for partial downloads, or even the ability to recursively download or upload a directory worth of files. Their FTP support is even more lacking in depth. If I want to get the sizes of a batch of files, I have to recursively go through and get the file size of each and every file on the list. There is no way to resume or suspend downloads. There is absolutely nothing beyond a partial implementation (and a very convoluted implementation) of the interface.

After spending almost a week working on the system, I am left with the impression that the best way to work on this system would be to write my own FTP client library! Of course, I am loathe to do that, especially when anything I do will be copywritten and owned by FedEx right now, and there’s no guarantee that I’d be hired back. I don’t like doing work I’m not going to A) profit from or B) at least be used for shameless self promotion. Of course, writing this from scratch would take up a lot of my time at work. In fact, it would be horribly silly for me to do this, since there are doubtlessly other projects for which I would be better suited to writing.

But, since now I have convinced myself that writing the library wouldn’t be a complete waste of my time, and since I *might* even get some credit from my supervisor for writing such a library, I think I’ll go ahead and take on this responsibility until someone comes up and asks me if there’s something else I’m supposed to be doing.

After all, what’s the point of being an intern if not to A) not make a profit and B) be slave labor with no promised future?