So Lindows is now Linspire, and if you think you'll have trouble remember the name, check out Come on baby, run Linspire. Hehehe. Love the faces.
I've been trying to catch up on my InformIT blog, and consequently have also been catching up on The Vanguard Science Fiction Report. Here are some things I've been talking about:
InformIT:
Mosh Ado About Nothing
A library of regular expressions
The Enterprise Service Bus
Feed of the week: The Open Source Vulnerability Database
The Vanguard Science Fiction Report
The Asimov legacy is safe
Hawking changes mind on alternate universes
Jerry Goldsmith dead at 75
Rogers Cadenhead has posted a nice little plug-in script for Moveable Type that will remove excessive links in comments. For example, you can specify that if there are more than 5 links in the comment, all of them get stripped out.
I don't get a lot of comments here, and when I do, they generally don't have links in them. Except for the spammers. Personally, I want a script that just won't post the comment at all if it has links in it.
Hm, now that I've moved Chaos Magnet to a new server, maybe I should try target="_blank">MTBlacklist again. (Last time I was thwarted because the server I was on had a version of Perl that was too old, and I refused to pay $50/hour for them to upgrade it, what that was something I shouldn't even have had to ask for.)
I want this job. Check out Spider-Man: The Peril of Doc Ock entirely in legos. (Via A Random Act of Blogging)
Need to send or recieve email using Java? Try this out, using the JavaMail API, available at http://java.sun.com/products/javamail:
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
public class MailDemo {
public static void main (String[] args){
getMessages();
}
public static void getMessages(){
Properties props = System.getProperties();
Session session = Session.getDefaultInstance( props );
try {
String host = "www.yourserver.com";
String username = "acmessages";
String password = "mypassword";
Store store = session.getStore("pop3");
store.connect(host, username, password);
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_WRITE);
if (messages.length > 0){
Message[] messages = folder.getMessages();
MimeMessage thisMessage = (MimeMessage)messages[0];
System.out.println(thisMessage.getContent());
sendMessage("System event notification",thisMessage.getContent().toString());
thisMessage.setFlag(Flags.Flag.DELETED, true);
}
folder.close(true);
store.close();
} catch (Exception e){
e.printStackTrace();
}
}
public static void sendMessage(String subject, String content){
Properties props = System.getProperties();
props.put( "mail.transport.protocol", "smtp" );
props.put( "mail.smtp.host", "www.yourserver.com" );
Session session = Session.getDefaultInstance( props );
Message msg = new MimeMessage( session );
String from = "sender@example.com";
String to = "recipient@example.com";
try {
msg.setFrom( new InternetAddress( from ) );
msg.setRecipients( Message.RecipientType.TO, InternetAddress.parse( to ) );
msg.setSubject(subject);
msg.setText(content);
Transport.send( msg );
} catch (Exception e){
e.printStackTrace();
}
}
}
Tearing your hair out trying to add Flash to a web page and make it work in different browsers? Apparently you need to use both OBJECT and EMBED tag syntax. Why? Because IE uses the object tag and Netscape uses Embed. For example:
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase= "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="550" HEIGHT="400" id="myMovieName"> <PARAM NAME="movie" VALUE="myFlashMovie.swf"> <PARAM NAME="quality" VALUE="high"> <PARAM NAME="bgcolor" VALUE="#FFFFFF"> <EMBED src="myFlashMovie.swf" quality="high" bgcolor="#FFFFFF" WIDTH="550" HEIGHT="400" NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"> </EMBED> </OBJECT>
For those not familiar with the object tag, if it can't display its own content (ie, the movie value) it displays the content of the element (ie, the embed tag).
I've been hooked on StreamingSoundtracks.com. I'll admit it. I listen to it constantly, and it's good writing music. Well, except when somebody requests that damned Transformers soundtrack. It's so incredibly awful that I wondered why in the name of all that is holy it was even on the playlist. Fortunately, I found the answer in Cocles' Really Mean and Condescending FAQ for SST Newbies!, which is what an FAQ is meant to be. Really. It's not really nasty mean, but it just says what every FAQ writer would love to say, if they didn't have to be so darned polite.
I bring all this up because Cocles has finally started his own blog, The CocBlog, and I feel obliged to point you to it. I feel some sympathy for him when he says he's doing it to procrastinate: "As I type this, there is a screenplay patiently waiting beside me like a dominatrix calmly wielding her horse crop and giving me that sort of smile people give only when they know they're inevitably going to have their way."
Why bring that up? Because I have four !@$%@#%#$ chapters that need to be finished up before I go to bed, and, well, one good procrastination deserves another.
Good to have you here, man! Give 'em hell!
Just arrived in my inbox. It's a "send this to seven people" kind of thing, so I'm sure the author won't mind if I reprint it here. I'm dealing with a shower of bricks right now, so it's pretty appropriate.
THE BRICK
A young and successful executive was traveling down a neighborhood street, going a bit too fast in his new Jaguar. He was watching for kids darting out from between parked cars and slowed down when he thought he saw something. As his car passed, no children appeared. Instead, a brick smashed into the Jag's side door!
He slammed on the brakes and backed the Jag back to the spot where the brick had been thrown. The angry driver then jumped out of the car, grabbed the nearest kid and pushed him up against a parked car shouting, "What was that all about and who are you? Just what the heck are you doing? That's a new car and that brick you threw is going to cost a lot of money. Why did you do it?"
The young boy was apologetic. "Please, mister...please, I'm sorry but I didn't know what else to do," he pleaded. "I threw the brick because no one else would stop.." With tears dripping down his face and off his chin, the youth pointed to a spot just around a parked car. "It's my brother," he said. "He rolled off the curb and fell out of his wheelchair and I can't lift him up."
Now sobbing, the boy asked the stunned executive, "Would you please help me get him back into his wheelchair? He's hurt and he's too heavy for me."
Moved beyond words, the driver tried to swallow the rapidly swelling lump in his throat. He hurriedly lifted the handicapped boy back into the wheelchair, then took out a linen handkerchief and dabbed at the fresh scrapes and cuts. A quick look told him everything was going to be okay.
"Thank you and may God bless you," the grateful child told the stranger. Too shook up for words, the man simply watched the boy push his wheelchair-bound brother down the sidewalk toward their home
It was a long, slow walk back to the Jaguar. The damage was very noticeable, but the driver never bothered to repair the dented side door. He kept the dent there to remind him of this message:
"Don't go through life so fast that someone has to throw a brick at you to get your attention!"
God whispers in our souls and speaks to our hearts. Sometimes when we don't have time to listen, He has to throw a brick at us. It's our choice to listen or not.
Running into problems filling your browser window? Apparently just setting the width and height to 100% doesn't always work, particularly in Mozilla derivative Firefox. Keith Peters explains over at BIT-101 that it's because of how the browser answers the question: "100% of what?"
The swf is in the body tag. The body tag is in the html tag, which is in the browser window. Most browsers will scale the html size to fill the browser window and scale the body to fill the html size. Not so with Mozilla/Firefox. It doesn't assume that html fills 100% of the browswer, or that body fills 100% of the html. So you have to tell it that.
Keith also provides a quick CSS workaround:
body,html {
margin:0px;
padding:0px;
height:100%;
}
(BTW, if you haven't visited BIT-101, you should, even if you don't develop in Flash.)