The Week :: Broken Things

May 13th, 2008
Yay

Ah, a little late, a little… but it’s only Chuesday! I think weekly wrappings are better on Tuesdays since this is a “clumpy” season.

So what a week, and with so little of my anime habit. Yes, I took a pause on the anime viewing as I had to run out of town for a bit, do an “odd” job, deal with family, (all surprisingly independent events) and am now behind on the Special not-special series and the vampire one; shoujo :3 nyaa.

The big event must have been those major RAWers getting nabbed D: Unfortunately, the decent S.A and VK raws have slowed up; I am just now finding e06 in something other than SD. Mine as well shoot for WS/HD/etc. Speaking of which, I checked out the xxxHOLiC Kei WS versions, and very nice, I like the extra view-space, but I will mostly likely stick with the 4×3’s since it the series is moving so well.

Glance Back

I should probably watch this Library War 05 [and Nabari], which I had planned on last night, but oh well. I did get a moment with KKN and xxxHOLiC, both having solid enjoyably episodes. Apart from my personal viewing, Kurenai seems to be taking many hearts and lungs around the blogosphere, and I’m glad. I wish for two things, 1) Baccano! originally aired with Kurenai quality 2) Baccano! 14. mmmmhmm. That last one is real.

Something else came about over the weekend, Full Metal Alchemist! I stumbled upon a box of discs, from “the move” and decided to see if they were any good. A couple of them were of FMA burned sometime in 2004 maybe? Dunno, but they gave me a headache. I decided to do a PAR2 if they were okay, just for the heck, but it didn’t seem they were okay.. CRC errors all over the place. After a while, I realized I was using a some form of UDF volume driver and they were likely ISO… they played fine in standalone players. Not the point, but ah it was a little refreshing to glimpse a couple episodes as I was troubleshooting; good memories with that series.

Forecast

Unfortunately, I have to double up my seasonal viewing, to catch up with the pack. First, I have to get this workaholic vibe out of my system (sorry melative, I work when I can… at least that is what I should say, steady development otherwise). Since I have a lot of free time I should at least marathon something, perhaps I’ll pick a title this week, Scrapped Princess perchance? The minimum would be to wrap up my 2007 Autumn series…. evidence of a lazy person ^^.

In a seasonal respect, Library Wars and xxxHOLiC are running strong *is satisfied*, and there is good momentum in series I am not viewing (ie Kurenai, Himitsu, Kaiba), so I still have my ambition. It is likely that I will shun coding for today, and dabble in the seasonal offerings.

Man, this post was not progressive at all… wtf bah. >.>

Ryan A

Note: Weekends are getting a little cramped, since F1 season is blossoming, and I love me some F1! Formula 1 weekends are definitely absorbing.

Code :: Blogs, php and URI access

May 9th, 2008

This will be a shorty, as the week has been turbulent and sweet.

So a couple months back, I posted about wp-melative, and in the code I was using a “socket download” since, the opening of URI has been disabled? on AB.net; I didn’t look into it much, just used socket connections as a workaround.

The Problem

Shortly after using the socket download wrapper-func, I noticed odd digits and characters appearing in the RSS. A very bad thing since, these renegade characters would sometimes appear in xml tags, thus invalidating and breaking the chain of events (the sidebar). Again, I didn’t look to much into it, but thought of another solution, this one is easy, and is today’s code.

Code

function wget($uri, $dest)
{
	// renamed from exec
	return EXECUTE( "wget -O $dest '$uri'" );
}

function getXmlFromWget( $uri, $rssfile )
{
	// do the wget
	wget( $uri, $rssfile );

	// get destination contents
	$rv = file_get_contents( $rssfile );

	// arbitrary length checking
	return strlen($rv)>5?$rv:false;
}

Techincals

The two functions are very simple. getXmlFromWget() takes the URI and the destination rssfile. It calls the wget function and passes the same parameters. wget() uses php’s exec built-in to pass a terminal command to the system, in this case it is specifically wget.

There should be a word of caution when passing stuff to exec, and especially with wget, since it can download/mirror an entire site with certain switches. I have only included the modest -O switch implying the single file download will be output to $dest.

Is this better than socket download? I believe so, wget seems more stable than php socket looping, and I haven’t noticed any strange characters appearing in the output. There is one small problem of downloading or not downloading, as it wget appears to receive blank files sometimes, hence the reason I include a file length check.

Usage

Since AB.net has limited URI access, the wget wrapper is a good alternative. This would be good for any bloggers wanting load up offsite RSS/XML/API data, as there needs to be a way to obtain the data that isn’t on AB.net. Wget manages this, as well as caching the data to the file system.

What’s that you say? Javascript… sorry XSS is usually a no-no.

RyanA

Note: this was written 6 hours ago, but for some reason WP rejected the above code, until I renamed the ‘exec’ function to EXECUTE… weird

In light of melative, Rating

May 7th, 2008

I was lead into a post over at Meaty Anime Blog recently, initially by the basis (Ouran and Towards the Terra), but something was stated:

…it’s the twelfth top rated show on MyAnimeList. Not that the last point means anything,…

This may or may not be out of context, since I cannot attest the same reasoning for the statement, but it has implications… ratings are flawed. And no, this isn’t a MyAnimeList-only problem (see how many 10s are given to popular movies on IMDB, ie Rush Hour 3).

What we have is an arbitrary rating system with a limited-number scale. In other words, I can arbitrarily rate multiple items 10/10 as much as I want…. but does this mean they are equivalent? Definitely not. Perhaps we should increase the arbitrary scale, as AniDB does with enhancement scripts (test that thing for steroids!), from 10 to 1000, does that make it better? Probably, but it also increases the level of “pain-in-the-ass”. Do I sound tempered?

This does not irritate me, because I don’t have to use it if I choose, though I would like to see accurate ratings, and so I come to the point, melative. (I know, I’m a broken record, shoot me for being my own fanboy… jkwut or just jk?)

The general idea: Relativity

melative.com has an embedded RRS (Relative Rating System), a premise which has held with me for a few years now (apparently there is a book that has a similar notion called slicing, I don’t know that the book is titled though). The idea is extremely simple, but it can work on the large scale, via recursion. Let’s do an example:

I have 2 media, A and B, let them be on the same “tier” or “level”. In this state they are equivalent, I feel they are equally great. If I feel A is greater than B, I place it on the next level up, or if I feel B is less impressive than A, I place B a level down. Effectively, I have rated A and B relative to each other, clean, concise, simple.

Rinse and Repeat

When dealing with a large list of titles, this may seem like hell, but it always uses the base… A=B, A>B, or A<B; there are only 3 options. On the large scale, it is easier to know a fuzzy location of a title, perhaps in the top 10%, great melative knows how to do that too, but that isn’t the point. Just because the ratings model is a recursive base case, does that really yield accurate averages for a title?

I ask too many questions, for more information, here is an overview/instructions on this RRS, but the money is in the Theory section. Douzo meshiagare!

Ryan A

note: further discussion, questions, or ideas can be directed to me via e-mail or on irc (#animeblogger or #melative).

Attraction :: Anime City, Tokyo

May 6th, 2008
tokyonight

When it comes to cities in anime, I think Tokyo has the lot covered (equivalent to NYC in film) , and that is one thing I love about it. Every take on Tokyo yields a different hue, and the base atmosphere of a series sometimes gives this city a great feeling. Here is the beginning of a post started sometime late 2006/ early 2007…

The other night, while laying down watching the seasonal picks, I pondered what city is that on screen? Tokyo, definitely Tokyo. I realized that Tokyo graces many many anime with it’s superbly complex and compelling ‘essence’. The streets, suburbs, festivals, views, history and development, etc all pour out from the anime screen.

Would it be necessary to considered Tokyo ‘the’ most used setting in Japanese animation? Or is it easily implied; by default? That is up to opinion, but it is highly used. For this reason, I will fetch my picks of “Best Animated Perspective of Tokyo”, though I really need to recall them all first.

Off the top of my head, there are so many series I’ve watched where the setting was Tokyo, which implies greater things considering my shallow experience history of anime. Out of the multitude, it boils down to a few things that make Tokyo as part of a series an attractive point. Briefly…

Active Environment

Many of the series which came to mind are setup in Tokyo, but not all of them “play in the environment.” How noticeable is the city? Does it feel good? Would I be sad if it wasn’t Tokyo? These are things I ask in order to gauge the level of activity, not that I think about this often. I think one of best examples is the FMP franchise. Really, I enjoy the way Kana and Sagara move about the city, and no I don’t recognize exact details of things, but knowing it’s Tokyo just gives it some sort of imaginable flavor. Yum!

Mood

Continuing with FMP, more specifically Fumoffu, the mood given off is like an imprint. While I don’t think we will have Pavlov in the conversation, but it is a good thing there are an abundance of moods for series set in Tokyo. What would happen if it was the same mood over and over… imprinting? NAO let’s hope not. Perhaps this relates to remnants of a series in memory; enjoyable memories of the city setting. What’s the most memorable Tokyo setting for a viewer? Does it have anything to do with the mood? I am not implying, these are fluid questions.

Framing

Place is one thing, but time is another; physics hubbub 101. There are a few noticeable anime out there with historic or future settings in Tokyo (Rurouni Kenshin and NGE, respectively), and I believe this is one contribution to general effect of the city. While it is Tokyo, it might not be anything recognizable, but still holds marvelously intrigue. Personally, I feel modern Tokyo is an attractive setting for anime, but I did enjoy post-Bakumatsu Tokyo as well as the underground concept brought by NGE (what a mess).

Unlike the quoted opening states, I don’t have a “best” at this moment, but some of my notables: FMP, Keroro, H+C, NGE, and Tokyo Majin (didn’t care for it overall). Though, I wonder if others have taken a favorite blend of Tokyo.

Ryan A

Code :: Greasemonkey Flash

May 2nd, 2008

Here is a quick one for those who need to remember things, who browse many web pages; these are flash cards.

Premise

I had this idea a couple weeks ago after not finding a great Japanese vocabulary flashcard site. I have lists in XML and spreadsheet format, and could very well make a small app that handles these things, but then there is simple Javascript and Greasemonkey. So I thought to myself, why not flash a card upon opening every web page (this is adjustable by Greasemonkey). I’d say most people open 500+ pages per day, and this turns into a fair amount of integrated studying. The best part yet, is that there is no restriction on the list, it can be anything really (biochem, languages, formulae, mp3 sound files, images, etc)… flash card away.

Code


// ==UserScript==
// @name           AlwaysFlash
// @namespace      AtmosphereIC
// @description    Flash Card roller
// @include        http://*
// ==/UserScript==

function FlashDeck(h){this._init(h);}

FlashDeck.prototype={
	// set of cards
	dictionary: new Array(
		"一	いち",
		"个	ぼう",
		"丶	てん",
		"丿	てん",
		"乙	おつ",
		"亅	はねぼう",
		"二	に",
		"亠	なべぶた",
		"人	ひと",
		"儿	にんにょう",
		"入	いる",
		"八	はちがしら",
		"冂	まきがまえ",
		"冖	わかんむり",
		"冫	にすい",
		"几	つくえ",
		"凵	うけばこ",
		"刀	かたな",
		"力	ちから",
		"勹	つつみがまえ",
		"匕	さじのひ",
		"匚	はこがまえ",
		"匚	はこがまえ",
		"十	じゅう",
		"卜	ぼくのと",
		"卩	ふしづくり",
		"厂	がんだれ",
		"厶	む",
		"又	また"
	),

	// display a card at random
	show:function(){
		sI=Math.floor(Math.random()*2);hI=sI>0?0:1;
		card=this.dictionary[ Math.floor(Math.random() * this.dictionary.length) ].split("\t");
		$('flashcard').innerHTML='‘ + card[sI] + ‘	‘ + card[hI] + ‘‘;
	},

	// inject styles
	styleNode: function(styles)
	{
		var se = E(’style’);
		se.type=’text/css’;
		se.innerHTML=styles;
		return se;
	},

	// styling the flashcards
	style:”\n\
	#flashcard\n\
	{\n\
		position:fixed;right:40px;top:40px;\n\
		z-index:1000;background:#222;\n\
		max-width:360px;\n\
		color:#fff;text-align:center;padding:10px;\n\
	}\n\
	#flashcard *{line-height:36px;font-size:32px;}\n\
	#flashcard a{color:white;}\n\
	#flashcard a.show span.hide{display:block;visibility:hidden;font-size:0.7em;}\n\
	#flashcard a.show:hover span.hide{display:block;visibility:visible;}\n”,

	// listeners
	listeners:null,

	// generic listener for clicking on a card
	click:function(e,f){return function(){f(e);}; },

	// constructor
	_init:function(handler){
		bod=T(’body’)[0];
		bod.appendChild(
			_p(_p(E(’style’),’type’,'text/css’),’innerHTML’,this.style)
		);
		bod.appendChild(
			_p(E(’div’),’id’,'flashcard’)
		);
		card=$(’flashcard’);
		card.addEventListener(”click”, this.click( card , handler ), false);
		this.show();
	}
};

// create instance on event
window.addEventListener(
	“load”,
	function(){ new FlashDeck(function(e){e.style.display=”none”;}); },
	false
);

/*
	SOME UTILITY FUNCTIONS
*/
// short for get by ID
function $(e){return document.getElementById(e);}
// short for get by tag
function T(t){return document.getElementsByTagName(t);}
// short for create element
function E(n){return document.createElement(n);}
// short for modifying property of element
function _p(E,P,V){ E[P]=V; return E; }
// short for modifying style property of element
function _sy(E,S,V){ E.style[S]=V; return E; }

Technicals

Basically, the FlashDeck is a simple class and pretty straightforward. It manages the minimal for what I wanted, flashcard per load. The addEventListener calls the defined function, which simple instantiates a new FlashDeck. The function being passed to the constructor is a handler which acts based on clicking the visible flashcard. It takes one argument ‘e’ which is the flashcard HTML element. The given code sets the element’s style to display none, so it disappears on click. Note: the dictionary is a tab delimited array, but it could be mutli-dimension or whatever, minor changes.

I think this has good expandability, which I will probably dive in when I get more free coding time (spent mostly at melative), but I like the concept. Here is the download, btw.

Ryan A

note: dictionary shown is kanji radicals of 1 and 2 stroke.