Wherein I occasionally rant on various topics including, but not limited to, PHP, Music, and whatever other Topics I find interesting at the moment, including my brain tumor surgery of August 2010.

Thursday, April 17, 2008

Solaris vi input mode arrow keys fix

This blog post is not for you to read.

It's for me.

You see, every once in a awhile, I work for a client/employer who uses Solaris, OpenSolaris, Unix, or some other traditional Unix-like OS.

They have their reasons, and they are good ones, and I'm fine with that.

Alas, I then usually waste about an hour of their time (and they pay me for it) to Google for the hack that makes vi (my editor of choice) actually usable from a terminal program (putty, usually).

To wit, the arrow keys in vi do not work in input mode under these OSes.

This blog post is a reminder for ME to know what the heck to do next time this happens.

So here is what I do:
Open up ~/.exrc and type these things:
set t_ku=[control-v][up-arrow]
set t_kd=[control-v][down-arrow]
set t_kr=[control-v][right-arrow]
set t_kl=[control-v][left-arrow]

Then make a symlink from .exrc to .vimrc
ln -s ~/.exrc ~/.vimrc

Finally, alias vi to vim, since this only works for vim:
alias vi=vim

Bonus Tip:
To get vi/vim to use more than ONE LINE when you start up, use:
TERM=putty screen

I believe "screen" is magical pixie dust that gives you a whole screen of line instead of one line, and the TERM stuff obviously tells screen that you need that screen to go to putty.

If "man screen" had been installed, perhaps I would have a better understanding of the magical pixie dust, but so it goes.

:-)

Thursday, September 13, 2007

Adobe Spams

Update:
Today, July 21, 2009, Adobe has once again resurrected the email I gave them in 2007, and has spammed it.

I say again: Adobe spams, boycott Adobe.

For the record:

I loathe Flash.

I mean, even on Windows where it kind of sort of works, it sucks up WAY too much RAM, and WAY too much CPU, and crashes far too often.

Not that anything really works well on Windows (other than their Marketing, Legal, and Bullying Departments) but Flash works particularly badly.

On Linux? Forget it.

I gave up installing the damn thing, even on Windows, about a year ago, and you know what?

I have found that there is not one site with any content worth getting that I am missing out, that I can't find elsewhere.

Maybe your experience is different; Maybe you just can't live without uTube.

Fine.

But for me, no more Flash, ever again.

Oh yeah, the real reason I hate Adobe is that they are spammers.

They added me to their mailing list, unsolicited, and sent me commercial junk mail.

So unless you want to support spammers, stop using their products.

It's that simple.

Thank you.

Tuesday, July 17, 2007

File Upload Progress Meter

Every week or two, somebody asks how to do a File Upload Progress Meter on the PHP-General mailing list...

Why the BROWSER doesn't provide this feature everybody wants is beyond
my ken.

Surely the browser has some clue how many bytes are uploaded and how
big the file was.

How tricky could it be for Firefox/IE to poke those values into a
couple variables somewhere?

Instead we have a zillion JS hacks by developers generating tons of
traffic back-n-forth to the server to ask it how many bytes it has
received so far...

In fact, why don't the browsers provide a NICE file upload progress meter in the first place, so web designers don't feel the need to re-invent the wheel?

Or even (gasp) some nice hooks involving CSS and Web 2.0 or whatever so web designers can just do this without even needing to know any Javascript?

This certainly would be way more useful than half the crap the browser wars have introduced in the past half decade that we've been needing this feature!

Thursday, July 12, 2007

Too Many "Friends"

Bear with me here, there's a fairly long prologue...

So, here's the thing:

In one of my alter egos, I'm a Talent Buyer at a music venue.

Now, you may not know much about the internal workings of music venues, but, basically, a music venue has about 1000 bands pounding on the doors wanting to play for every available position.

There's nothing we'd love more than for there to be way more fans out there, mind you, so we could actually accommodate about 100 of those artists, instead of just he 1.

Do note that I said 100 of the 1000, not all of them...

90% of everything is still crap.

Anyway, at the email address we've set up specifically for artists to submit a demo, we tend to get a whole lot of friend-link requests to basically all the big social networking sites.

Now, this is going to sound petty, but it's getting pretty dang annoying.

Most of these friend link requests are coming from artists we don't work with.

Many of them are coming from artists we simply can't work with, as they're not the 1 in a thousand.

I daresay a lot of them are coming from the 900 we wouldn't want to work with, even if the the supply/demand went the other way, with way more fans than artists...

Our website pretty clearly asks bands not to add us to their promotional mailing lists. Do we really need to spell it out "and don't send us be-my-friend emails either"?

Anyway, I'm thinking that all these social networking sites should just stop sending out emails on behalf of their users to non-users to invite them to join.

If I want to join your social-networking site, and buy into the whole thing, then fine, I've agreed to get your emails.

But I haven't!

So, really, all these social-networking sites are just thinly-disguised spammers, when you get down to it.

Or maybe there should be some kind of industry-standard minimum proof that the recipient might actually want these dang things, or that the sender actually has an existing relationship.

Knowing an email address is not an existing relationship!

Because it's gotten to the point where a new entrant in the social networking market, to me, just means yet another flurry of invites that I don't really want.

Then I have to spend 20 minutes digging through their site for a place to contact them to say not only to ban that one user from sending me emails, but to ban ALL the users from ever sending me emails.

I don't even want the dang things at my personal address anymore, really, from friends I actually know. It's gotten that bad.

I definitely don't want them from strangers to an email address that was set up for a very specific business purpose.

Am I being too petty?

I don't think so.

We came up with guidelines for the robots, and that seems to have (mostly) worked out.

Can't we come up with guidelines for these social networking / stay in touch sites?

Here are some suggested starting points for guidelines:

If I'm not a member of your site, don't email me more than one invite ever, period.

If I didn't want to join when Lee invited me, I still don't want to join when Fran invites me, okay?

The invite email should provide links including:
    ban this user from ever emailing me again
    ban all users from ever emailing me
    accept invitation
    decline invitation, but join site

Perhaps there should also be a "do not social-network-invite" shared database maintained by the larger existing social networking sites, which other social networking sites could pay a reasonable fee on a per email basis to check against, and a person could register with that one place to not get any invites from any social networking site.

Note that the fee should be large enough to make it prohibitive for spammers to just pay up to garner emails, that it should not actually hand out email addresses but return a YES/NO for a submitted address from the social networking site, but be cheap enough that any serious new social networking site would buy in as a matter of course. Maybe there is no such price-point, but at least give it some thought.

I sure don't want to keep contacting every johnny-come-lately social networking site to ask them to put a ban on their users sending me invites. There are too many of them springing up like weeds.

Wednesday, July 11, 2007

PHP in HTML

How come this doesn't work:
<button action='<?php mysqli_query($connect,$query)?>'>Click</button>

[sportscaster voice-over]

Joe: Hey Bob, let's look at a slow-motion instant-replay of this common PHP newbie fallacy scenario.
Bob: Sure Joe!
Joe: Okay, so here goes:
  The user requests a HTTP URL document.
  The webserver fires up.
  The webserver finds that it needs PHP to generate the document.
  PHP fires up.
Bob: Wow, look at PHP go! That's fast!
Joe: Yeah, it is fast.
  PHP has generated the document, and spits it out.
Bob: Boy, it's already finished. Hey, it's quit!
Joe: That's right, Bob.
  PHP has FINISHED EXECUTION, and has exited.
  Now watch this!
Bob: Oh boy, I see it coming now...
Joe: Yep, there it is.
  There's some HTML in the browser, trying to execute some PHP code...
Bob: But you can see, PHP has LONG FINISHED and is OUTTA HERE!!!
Joe: That's right, Bob, PHP is simply not around to execute that code.
Bob: So what can you do, Joe?
Joe: Well, if you can live with the browser going back-n-forth to the web-server, with a significant "lag" time...
Bob: Oooh, well, I can see how that might be useful sometimes...
Joe: In those cases, you can use Ajax.
Bob: Anything else?
Joe: Not really. Until you get back to the webserver and PHP, there's just no PHP available. Unless your user is in the extreme minority of uber-PHP-geeks that has installed this EXPERIMENTAL PHP browser plug-in thingie: http://pecl.php.net/package/PHPScript
Bob: Whoa, Joe, I don't think I've ever even heard of anybody who's ever installed that.
Joe: Me neither, though I met Wez Furlong who wrote it, so I have to assume HE has installed it at least once...

[cue to cool Guinness commercial]