Saturday, August 27, 2005

Write ransom notes with Flickr (plus macdevcenter commentary)

Here's a cool place I ran across whilst reading O'Reilly's MacDevCenter. It lets you type in some stuff and it uses Flickr to spell out the letters with various photos. Check it out.


Speaking of MacDevCenter it seems as though there is a dearth of actually macDEVcenter articles on it. I see information about an anti-virus frontend, flickr, an article titled "What is Preview? (and why you should use it)". Now, all these articles contain interesting info, but a lot of them don't actually have anything to do with development. And some of them hint at it, without really delivering.

For instance, the Flickr article describes how to setup and account with Flickr, mentions some Mac tools to use with it, and has a quote by one of the people who wrote a tool extolling the virtues of the Flickr API. However there was no information on this API, no tutorial no sample code, not even a pointer to more documentation. Just the offhand mention of the existence of said API. One would assume that a site like MacDevCenter would be well, targeted towards developers. I suppose I should stop complaining, O'Reilly has a lot of good stuff up there, and he articles aren't bad, and there are some actual developement articles, I just feel like the site name is a bit of a misnomer.

Monday, August 22, 2005

Binghamton 2

Well, Binghamton has been pretty typical for a trip to Binghamton. Couple of things. One, we stopped at a Chili's (you know...Baby back ribs), and I haven't been to a Chili's since I can't remember when. I ordered the Bleu Cheese Chipotle Bacon Burger, and what an awesome combo of tastes it was. Speaking of bleu cheese, if your a fan of bleu cheese and a fan of beef, as I am, try this: build your burgers around a chunk or two of bleu cheese. Now ideally, its supposed to turn into a melted bleu cheese filling, but most of the time it just seeps throughout the burger (which still tastes really good). Mmm-mmm. Also we visited a Dollar Tree. Dollar Tree is a chain of dollar stores, but they are really good dollar stores. You'll oftentimes find name-brand stuff in there. If you get the oppurtunity definitely check one out. I guess that's all for now, later.

Thursday, August 18, 2005

Bing-HAM-ton

Today I travel up to Binghamton with my SO. She's getting ready for school, and I'm coming along for the ride. Should be interesting. Kind of Gilligan's island though...a three hour tour.

Wednesday, August 17, 2005

Dice Rolling Fun in Javascript

Well I finally managed to complete my javascript die rolling script. I created it so I could have "interactive" character and monster sheets, since I keep a lot of my DMing info in computers. Eventually I may use XML and XSL but until then this little script adds clickable die rolls to HTML documents. All you have to do is put
<span class="dieroll">1d8</span>
in your HTML and $EmerilSoundEffect you've got a clickable die roll, in this case one eight-sided die.

<html>
<head>
<script language="javascript" type="text/javascript">
function addDiceProperties( ) {
var dieElements = getDieElements( );
var x = 0;
for( x = 0; x < dieElements.length; x++) {
dieElements[x].onclick = dieElements[x].onkeypress =
dieRoller(dieElements[x].innerHTML);
}
}

function getDieElements( ) {
var spans = document.getElementsByTagName("span");
var dieElems = [];
var isaDieRoll = /\bdieroll\b/;
for(j = 0; j < spans.length; j++) {
if ( isaDieRoll.test(spans[j].className ) ) {
dieElems[dieElems.length] = spans[j];
}
}
return dieElems;
}

function dieRoller(txt) {
var count;
var sides;
var count_sides = getDieArgs(txt);
count = count_sides[0];
sides = count_sides[1];
return function( ) {
return rollDie(count, sides);
};
}

function rollDie(count, sides) {
var results = 0;
var i = 0;
for(i = 0; i < count; i++) {
results += intRand(1, sides);
}
document.getElementById("resultsbox").value = results;
}


function intRand(mini, maxi) {
var range = maxi - mini + 1;
return Math.floor(Math.random() * range + mini);
}

function getDieArgs(txt) {
var pat = /([0-9]+)d([0-9]+)/;
var res = [];
var match = pat.exec(txt);
res[0] = parseInt(match[1]);
res[1] = parseInt(match[2]);
return res;
}

</script>
<style type="text/css">
.dieroll {
color: blue;
text-decoration: underline;
}

#resultsdiv {
position: fixed;
right: 0;
top: 0;
border-style: dashed;
border-width: 1px;
background-color: white;
padding: 1px 1px 1px 1px;
margin: 1px 1px 1px 1px;
}
#resultsbox {
width: 3em;
}
</style>

</head>
<body onload="addDiceProperties( )">
<div id="resultsdiv">Die Results: <input type="text" id="resultsbox"></div>
<div><!-- This is where the rest of your stuff goes -->
<p>
<ul>
<li><span class="dieroll">1d4</span></li>
<li><span class="dieroll">3d6</span></li>
<li><span class="dieroll">1d8</span></li>
<li><span class="dieroll">1d10</span></li>
<li><span class="dieroll">1d12</span></li>
<li><span class="dieroll">1d20</span></li>
<li><span class="dieroll">1d100</span></li>
</ul>
</p>
</div>
</body>
</html>


EDIT: 5:45PM

Well it seems there are some bugs in the randomness code part. Doesn't look like we ever get natural 20s for instance. I get the feeling it has something to do with the chance of getting a 1 from Math.random( ). So I am going to fiddle with this code, and welcome any suggestions.



EDIT: 8:30 PM

Fixed it. Knew there was something fishy. Thanks to http://www.werelight.com/docs/JavaScript_Quick_Reference.htm

Webcomics Grab Bag

Today I'm going to give you all some links to some web-comics. And by you all, I mean no one. Never the less, here they are:



  • Schlock mercenary

    This is my bread and butter as far as web-comics go, and everyone out there probably already knows about it, but hey, who knows.


  • The Order of The Stick

    Another goodie, copious amounts of D&D humor. Speaking of D&D I have a thought for a little javascript which I may post later today or tomorrow.


  • Gods of Arr-Kelaan

    Cool because everyone from earth has godly powers. Quite possibly one of the most interesting concepts I've ever come across.


Well, that's about all the ones I still check on a regular basis. Be seeing you, space cowboy.

Monday, August 15, 2005

Super Smash Brother's Melee Debug Menu

Whilst cruising on http://slashdot.org I came across this article on the various neato things in the Super Smash Brothers Melee Debug menu. Holy Discordia! I thought, this is quite enticing. In the comments to the /. story I found this link: http://ssbm.detstar.com/debug/ which goes into intricate detail on the manner. As a side note, i think I am over-blogging on my first day. Good thing no one reads this.

Morgan the Cat

We found a kitten the other day. She's cute. I'm gonna let her type now. I would take a picture, but since no one is going to see this -- that would be a waste of time. And not really an option anyway as my camera is nicht in ordnung.
oooooooooooooooooommmmmmmmmmmmmmmmmmm9999999999999999999999uuuuuuuulllllhuuu988

As you can see she's a little repetitive, but has deep insights in the ways of the world. She's like the feline Edward Albee.

Meta-Meta-Meta

Zero Hour. The harness is connected. I've got the codes. Only thing left now, do it. I click continue, continue, next (How'd that get in there?), continue. It's live. I start typing "Zero Hour...".