Choose Your Theme
Warren Shea

Site Updates: warrenshea.com & IE8

Thursday, April 26th, 2012 at 2:02 pm

warrenshea.com uses HTML5, which isn’t supported by IE8. Which is unfortunate because IE8 is used pretty frequently.

I didn’t wanna do another stylesheet/javascript and update both…so I used one of my favorite things: my proxy.php file

This is my default.php for warrenshea.com. Unfortunately, I did have to do a big IF statement but that’s okay because this code never changes. So what it does is check it it’s IE8 (ie. doesn’t support HTML5), and then changes some of the tags: <header> to <div id=”header”>. I’ll likely change the IF statement to something better later…but that’s not the point of this post.

<?php
$srvr_http_user_agent = $_SERVER[‘HTTP_USER_AGENT’];
if ((stristr($srvr_http_user_agent,”MSIE 6.0″) == true) ||
  (stristr($srvr_http_user_agent,”MSIE 7.0″) == true) ||
  (stristr($srvr_http_user_agent,”MSIE 8.0″) == true)) {?>
<!doctype html>
<html>
  <head>
    <link rel=”stylesheet” href=”common/proxy.php?url=stylesheet.css&type=css”>
  </head>
  <body>
    <div id=”header”>
      <div id=”nav”>
        <ul id=”nav-text”></ul>
        <ul id=”nav-background”></ul>
      </div>
      .
      .
    <script src=”common/proxy.php?url=scripts.js&type=js”></script>
  </body>
</html><?php } else { ?><!doctype html>
<html lang=”en-us”>
  <head>
    <link rel=”stylesheet” href=”common/stylesheet.css”>
  </head>
  <body>
    <header>
      <nav>
        <ul id=”nav-text”></ul>
        <ul id=”nav-background”></ul>
      </nav>
    .
    .
    <script src=”common/scripts.js”></script>
  </body>
</html><?php } ?>

Doing this gets rid of some HTML5 tags but the CSS and JavaScript/jQuery still reference the HTML5 tags. So I like to use my proxy.php, which loads a URL, and gives me the option to manipulate it.
FYI – For XML, I use it for my twitter XML (I used to have it done through JavaScript but I found that it hindered load time).

<?php header(“Expires:Mon, 31 Dec 2010 05:00:00 GMT”); ?>
<?php
$page_contents = file_get_contents($_GET[“url”]);
if ($_GET[“type”] == “css”) {
  header(“Content-type: text/css”);
  $page_contents = str_replace(“header”,”#header”,$page_contents);
  $page_contents = str_replace(“##header”,”#header”,$page_contents);
  $page_contents = str_replace(“footer”,”#footer”,$page_contents);
  $page_contents = str_replace(“##footer”,”#footer”,$page_contents);
  $page_contents = str_replace(“content-#footer”,”content-footer”,$page_contents);
  $page_contents = str_replace(“nav”,”#nav”,$page_contents);
  $page_contents = str_replace(“##nav-text”,”#nav-text”,$page_contents);
  $page_contents = str_replace(“##nav-background”,”#nav-background”,$page_contents);  
} else if ($_GET[“type”] == “js”) {
  header(“Content-type: application/javascript”);
  $page_contents = str_replace(‘$(“header”)’,’$(“#header”)’,$page_contents);
  $page_contents = str_replace(‘$(“nav”)’,’$(“#nav”)’,$page_contents);
  $page_contents = str_replace(‘$(“footer”)’,’$(“#footer”)’,$page_contents);
} else if ($_GET[“type”] = “xml”) {
  header(“Content-type: text/xml”);
}
echo $page_contents;
?>

Yes, it’s very hacky and likely not efficient but it does the job.
It changes:
http://warrenshea.com/common/stylesheet.css (HTML5 good) to
http://warrenshea.com/common/proxy.php?url=stylesheet.css&type=css (HTML5 bad)
and
http://warrenshea.com/common/scripts.js (HTML5 good) to
http://warrenshea.com/common/proxy.php?url=scripts.js&type=js (HTML5 bad)
but I only have to edit one file and it’ll make the non-HTML5 version automatically. Sweet.

Anyways, I thought this was worth sharing. Someone might find this technique useful.

Accomplishments – April.8 2012 Edition

Tuesday, April 24th, 2012 at 1:32 am

Shows / Movies
The Walking Dead S1-S2 – Complete
Dawson’s Creek S1-S6 – Complete
Titanic…x2…one 3D, one not – Complete
Scott Pilgrim [Rewatched] – Complete
Battle Royale [Rewatched] – Complete
Currently watching: Glee, Young Justice, Big Bang Theory, How I Met Your Mother, House, Thundercats, Avengers – Earth’s Mightiest Heroes – In Progress

Books & Manga & Comics
The Art of Racing in the Rain p150/310 – In Progress

worldofwarren.com / warrenshea.com / secretproject [to be renamed]
worldofwarren.com – cleaned up a lot of content
worldofwarren.com – updated JavaScript libraries
warrenshea.com – almost finished….1 more thing to do
warrenshea.com – updated JavaScript libraries

Gaming
Tiny Tower – Level 130

Web Development and Design

Other

Notes
I know this post is…9 days late. SO WHAT. No, the truth is that I wanted to wait until my vacation was over so I could list more accomplishments. Also, my focus during my vacation was web development.

What If: Prince of Tennis: Nationals

Sunday, April 22nd, 2012 at 3:29 pm

I’m re-watching Prince of Tennis: Nationals OVAs right now. As I was falling asleep last night, I let my mind wander…what if the other Nationals teams played each other? Now, it’s complicated to switch the orders around so to be fair, I left all the orders the same. Also, for Shitenhouji, I put Oshitari back in over Chitose cuz Chitose is a single’s player so having Chitose and Zaizen as a double group would be weird. Anyways, this is how it all went down (in my head).

Hyotei VS Shitenhouji

S3 – Oshitari VS Shiraishi
Winner: Shiraishi
Shiraishi’s good enough to beat Fuji Shusuke. He’s more than good enough to beat Oshitari.

D2 – Hiyoshi & Mukahi VS Koharu & Yuuji
Winner: Hiyoshi & Mukahi
Hiyoshi & Mukahi are far too serious to fall/be caught up in Koharu & Yuuji’s pace.

S2 – Kabaji VS Ishida
Winner: Ishida
Kabaji would try to copy Ishida’s hadokyu…which is basically one move, with strength variations. But Ishida’s stronger than Kabaji. This would be like Ishida VS Kawamura but without Kawamura’s drama and miracle ball.

D1 – Shishido & Ohtori VS Zaizen & Oshitari
Winner: Zaizen & Oshitari
Is Shishido & Ohtori that good? Shishido has no real skill/moves. Ohtori has a fast serve…which I bet the genius Zaizen and the Speed star Oshitari could handle that no problem.

S2 – Atobe VS Toyama
Winner: Atobe
Toyama can return any ball that Echizen can hit. But even Echizen…Sanada, or anyone can’t hit Atobe’s World of Ice. But Toyama can’t do the Tezuka Zone. Basically, I’m saying that Toyama isn’t smart enough to beat Atobe’s World of Ice.

Overall Winner: Shitenhouji


Rikkaidai VS Shitenhouji

S3 – Sanada VS Shiraishi
Winner: Sanada
I won’t lie. Sanada’s pretty damn strong. Regardless of how Shiraishi’s bible plays, I don’t think he can defends against the FuuRinKaInZanRai.

D2 – Kirihara & Yanagi VS Koharu & Yuuji
Winner: Kirihara & Yanagi
Yanagi and Kirihara are…pretty damn strong. Each of them is individually strong. I don’t think Koharu & Yuuji have a chance.

S2 – Niou VS Ishida
Winner: Niou
This one’s tricky because Ishida is SO powerful. But Niou’s an ingenious trickster. He’s also the best copy person in Prince of Tennis (beating Kabaji, and Wakato). I’m sure Niou would find a way to win.

D1 – Marui & Kuwahara VS Zaizen & Oshitari
Winner: Marui & Kuwahara
This is the trickiest of all matches because I don’t know either side too well. Simply based on who Rikkaidai and the rest of their team is, I’ll give this to Rikkaidai. Even if Marui & Kuwahara lost, it doesn’t change the rest of the outcome.

S1 – Yukimura VS Toyama
Winner: Yukimura
Not even close. Yukimura.

Overall Winner: Rikkaidai


Hyotei VS Rikkaidai

S3 – Oshitari VS Sanada
Winner: Sanada
Sanada’s on a whole other level.

D2 – Hiyoshi & Mukahi VS Kirihara & Yanagi
Winner: Kirihara & Yanagi
Kirihara & Yanagi are on a whole other level

S2 – Kabaji VS Niou
Winner: Niou
Copy Genius matchup. Except Niou is WAY better in terms of technique. Also, he can copy anyone whereas Kabaji can only copy the guy he’s playing, generally.

D1 – Shishido & Ohtori VS Marui & Kuwahara
Winner: Marui & Kuwahara
Marui & Kuwahara are on a whole other level.

S1 – Atobe VS Yukimura
Winner: Yukimura
Yukimura is on a whole other level.

Notice the trend? Overall Winner: Rikkaidai


So basically it stands that Rikkaidai is #1. Shitenhouji comes in #2. And Hyotei comes in #3.
Just like the real anime!

It was nice spending 3 hours making a blog post whose conclusion was that predictable.

Site Updates: Content Review of worldofwarren.com

Saturday, April 21st, 2012 at 2:31 am

As I finish warrenshea.com (seriously, there’s only one more thing to do), I realize that my professional site links to my personal, unprofessional site and that I might need to clean it up a bit. As such, I’ve done a slight content overhaul of worldofwarren.com.

Actually, to be fair, I only:
Removed content from About Me. And added that snazzy picture of me back
Edited Hobbies
Edited Projects

I didn’t touch the Blog, Gallery, Resume (warrenshea.com), or Links.

I’m contemplating on switching my warrenshea twitter to worldofwarren and having warrenshea more professional, for the twitter on my professional site. Or maybe removing the twitter portion from warrenshea.com. I don’t know yet…

Site Updates: updating JavaScript libraries

Wednesday, April 18th, 2012 at 12:38 am

This isn’t huge news…but I updated that JavaScript libraries on both worldofwarren.com and warrenshea.com.
They’re now using the current, up-to-date
jQuery 1.7.2
jQuery UI 1.8.19
jQuery prettyPhoto v3.1.4

up from
jQuery 1.7.1
jQuery UI 1.8.13
jQuery prettyPhoto v2.5.6

It took some doings to get prettyPhoto to work…I was dumb when I put in 2.5.6 and changed the library code to suit my needs so it took a little longer to add than it should have.

I also removed jQuery Accordion, I didn’t need it anymore after I worked my resume.

I’ve also been updating warrenshea.com. I think the portfolio’s section is good at 30 items. Now to write content for those 30 sections and do my timeline experience.