months, days, stars… ugh. 04.30.10

I’m putting this here for two reasons: 1. This is the second time I’ve needed to have data about how many days preceded each month.  (e.g. there are 304 days before Oct. 1) and 2. I’m curious if there’s an easier way to do something like this.  When I was working on a countdown clock there was a lot of modulo operators and the results were much cleaner than below.  Since the number of days in a month varies (unlike the number of minutes in an hour) I couldn’t think of a way.

Basically, there’s a slider (mySlider) that is controlling the rotation of a planisphere. (dial_mc) We want to give users information (mymonth, myday) about what night sky they’re looking at since the planisphere is almost impossible to read. (it was made in 1780…)  You can adjust the planisphere for different times of day, but we’re only interesting in giving the user midnight.  myday and mymonth get displayed in dynamic text boxes.

onClipEvent(enterFrame){
this._rotation = ((_root.mySlider.ratio)*-1);  //dial_mc (this) needs to spin CCW

var mymonth;
var myday = 0;

if (_root.mySlider.ratio <= 31){
_root.mymonth = “Jan”;
_root.myday = Math.round(_root.mySlider.ratio);
//since the slider will start at 0 we want to make that 1
if ((Math.round(_root.mySlider.ratio)) == 0){
_root.myday = 1;
}
}

else if (_root.mySlider.ratio <= 59 && _root.mySlider.ratio >= 31){
_root.mymonth = “Feb”;
_root.myday = (Math.round(_root.mySlider.ratio) – 31);
}

else if (_root.mySlider.ratio <= 90 && _root.mySlider.ratio>=59){
_root.mymonth = “March”;
_root.myday = (Math.round(_root.mySlider.ratio) – 59);
}

else if (_root.mySlider.ratio <= 120 && _root.mySlider.ratio>=90){
_root.mymonth = “April”;
_root.myday = (Math.round(_root.mySlider.ratio) – 90);
}

else if (_root.mySlider.ratio <= 151 && _root.mySlider.ratio>=120){
_root.mymonth = “May”;
_root.myday = (Math.round(_root.mySlider.ratio) – 120);
}

else if (_root.mySlider.ratio <= 181 && _root.mySlider.ratio>=151){
_root.mymonth = “June”;
_root.myday = (Math.round(_root.mySlider.ratio) – 151);
}

else if (_root.mySlider.ratio <= 212 && _root.mySlider.ratio>=181){
_root.mymonth = “July”;
_root.myday = (Math.round(_root.mySlider.ratio) – 181);
}

else if (_root.mySlider.ratio <= 243 && _root.mySlider.ratio>=212){
_root.mymonth = “Aug”;
_root.myday = (Math.round(_root.mySlider.ratio) – 212);
}

else if (_root.mySlider.ratio <= 273 && _root.mySlider.ratio>=243){
_root.mymonth = “Sep”;
_root.myday = (Math.round(_root.mySlider.ratio) – 243);
}

else if (_root.mySlider.ratio <= 304 && _root.mySlider.ratio>=273){
_root.mymonth = “Oct”;
_root.myday = (Math.round(_root.mySlider.ratio) – 273);
}

else if (_root.mySlider.ratio <= 334 && _root.mySlider.ratio>=304){
_root.mymonth = “Nov”;
_root.myday = (Math.round(_root.mySlider.ratio) – 304);
}

else if (_root.mySlider.ratio <= 365 && _root.mySlider.ratio>=334){
_root.mymonth = “Dec”;
_root.myday = (Math.round(_root.mySlider.ratio) – 334);
}

}

month data:

Jan: 31
Feb: 59
Mar: 90
Apr: 120
May: 151
June: 181
July: 212
Aug: 243
Sep: 273
Oct: 304
Nov: 334
Dec: 365

When the product of all this is approved and goes live, I’ll add a link here.

Hangar 18 04.16.10

I’m down with the EVE blogging memes… so here’s what’s in my hangar:

Jaguar x2 – “afdho” and un-named. I got into Wolves and Jags when I returned to EVE after my last hiatus. I have yet to find a real use for these, but that’s probably due to the fact Ushra’Khan hasn’t done anything but sov warfare for the last few months.

Wolf x2 “TOAST” and un-named. See above.

Hurricane x3 “audhjsaiodf” “autumnn’s hurricane” “squeal” I got into the hurricane quickly after deciding to change to minmatar ships, but have only recently started to take advantage of the flexibility this ship offers. “squeal” is set up for ratting.

Tempest x2 “Flat Stanley” and “Xious’ Avatar” two fleet fit sniper battleships. “Flat Stanley” saw service in several campaigns during the providence cleansing. I switched from Rokhs to Tempests late in the campaign because of the price.

Buzzard x1 “stinkfist” When I started EVE I named all my ships after TOOL songs. Stinkfist is one of the few left and still has large rigs in it because it’s from before the rig changes.

Badger x1 “Autumnn’s Badger” yeah… moving.

Claw x3 “aoufhd,” “FLyT,” and un-named. Still trying to get a feel for flying interceptors.

Crow x2 “cambria”, un-named.

Manticore x3 merkaba III, IV, V I love stealth bombers. period. I’m still working on figuring out how to be effective in one, but I absolutely love these ships. Ever since my days in Dirt Nap Squad, I’ve been keeping at least two of these in the hangar.

Rifter x6 un-named. I use these to jump into stupid situations for intel, or just to get my blood pumping. I like rifters, but mostly because they’re stupid-cheap.

Drake x1 “bobsled” Named such because of a “Thirty Rock” episode and because I think Drake’s just look like sleds… sort of. This is a ratting ship.

Mostly I’ve given up trying to keep a cohesive naming scheme… I tend to just roll my hand over the keyboard. So, what’s in your hangar?

this is a test post 04.16.10

please ignore.

A link outside the site
a link inside the site

sometimes I get it… 04.15.10

So I’ve been working on figuring out jQuery and have been poking around with a few prebuilt scripts (aka plugins) but was working my way through a guide on constructing selectors and put something of my own together:

$("a").not("[href*=&lt;?php bloginfo('url'); ?&gt;]").css("color", "red");

which changes the text color of all links leading away from your wordpress site to red.  Some sites highlight these links with a little icon, which would be easy enough to modify this snippet to accomplish.

For a few seconds I was concerned about putting the php inside the javascript, but quickly realized it would be replaced with the blog URL server-side, long before the browser would run the script.

Like I said… sometimes I get it. Maybe I’ll take this a step further and make a little wordpress plugin where you can upload your own icon or something.

Update:

I decided to go ahead and use the little wikipedia icon to links that take you to places outside of autumnrayne.net.  I changed the script a bit to add a class rather than creating the CSS since that’s more in line with the concept of CSS controlling all of your appearances:

$("#content a").not("[href^=&lt;?php bloginfo('url'); ?&gt;],[href*=javascript:],.liked ").addClass("external_link");

The additional things in the .not() bit are to exclude the “like this post” links which are javascript or empty <a class=”liked”> tags that the thumbs-up image hook into.  I’ve also narrowed the scope of the script to just the #content div so that the twitter links and anything else I decide to put in the side bar aren’t included. I changed the selector for the blog url to anything that starts with (http^=…) autumnrayne.net otherwise things like the facebook sharing links get included. (or should I say excluded?)

Pressed Magnolia Studio 04.12.10

After months of nagging my wife finally badgered me into finishing the new branding for her photography business, Pressed Magnolia Studio.  She had been using a doodle of mine as a makeshift logo, but wanted something a little more formal.  We’re still formulating a plan to get some beautiful letterpressed business cards, but you can view the logo and DVD/CD packaging below.


DVD/CD packaging:

Just for comparison, here’s the old DVD covers she was using: