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
Thursday, August 18, 2005
Bing-HAM-ton
Wednesday, August 17, 2005
Dice Rolling Fun in Javascript
<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:
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.
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.
Cool because everyone from earth has godly powers. Quite possibly one of the most interesting concepts I've ever come across.
Monday, August 15, 2005
Super Smash Brother's Melee Debug Menu
Morgan the Cat
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.