Internet Explorer 8

March 8th, 2008

Well, Internet Explorer 8 is here (the beta, at least).  And it’s standards compliant (well, it passes Acid2).  Which, actually, is something even Firefox can’t say.

Acid2 in IE 8:

acidIE

Acid2 in Firefox 2.0.0.7:

acidFF

That means that I no longer need to do conditional stuff for Firefox and Opera, I can do everything once and it’ll look the same (such as the fix for the gap between div tags described here).  Of course, I’ll have to account for the fact that, although IE 7 has been out for a year and a half, many people still use IE 6, and will continue to do so when IE 8 is released.

Aside from that, IE 8 has some other new things.  “Activities” are selected from a drop-down menu that appears near selected text (this doesn’t seem to work everywhere yet…).  “WebSlices” are basically what they sound like - little slices of the web.  You define the scope of a WebSlice inside a div tag with an “hslice” class.  The browser then adds that to the “Favorites Bar,” and updates itself every once in a while.  You can then see that small part of a web page without actually opening it, allowing for things like, say, weather updates (from MSN, obviously…) or status updates from your Facebook friends.  The “Favorites Bar” I just mentioned is also new.  Think Firefox’s “Bookmarks Toolbar,” and you’ll have a pretty good idea of the Favorites Bar.  Button links to web pages (like the old “Links Bar”), and drop down RSS feeds.  I could only see a couple differences between the Bookmarks Toolbar and this new IE counterpart. The first is the little “Favorites” dropdown thing that shows Favorites, Feeds, and History in different tabs until you click elsewhere in the window (I think they’re called “Explorer Bars,” and they’re not new - they were in IE 7).  The other is that this is where those “WebSlices” are stored, which look like a feed button until you press them, and a box with a part of a web site pops up.

Also, I think someone mentioned somewhere that it was starting to support HTML 5, not that I’ve really been able to try that out…

Dynamic Website

December 16th, 2007

The way that I originally created my website was by creating a template in Dreamweaver, and creating a new page based on that template for each new web page.  Dreamweaver automatically updates any page based on a template when that template is saved.  Thus, every page had it’s own coded copy of the header, the sidebar, and the footer.  I figured out that all this does is create a lot of unnecessarily repeated code.  So I decided to try something else.

I created a new sub-domain, dynamic.testing.thetoothpick.com, and deleted everything on it.  I created “index.php,” and started coding the layout.  I wanted to do this entirely by coding (not using Dreamweaver’s layout feature), because it’s a lot easier to get it to do exactly what you want.  I still used Dreamweaver (it’s got a pretty a pretty advanced coding setup), mainly because of the integrated FTP directory synchronization.  Also, I decided to go with div tags instead of tables (they’re just easier to work with, although arguably harder to center).

I put in the first two div tags, for the header and the title, and then the div tag for the main part of the page.  I created a div tag within this for the sidebar (I floated it on the left), then put in the div tag for the actual page content (I floated this on the right).  I made a clearing div tag after this (still in the larger container), and closed the container tag. Then, I made the div tag for the footer.

In properties.css, I made a rule for the div tags in the main column, gave them a width of 740 (not sure why that number, it was the one my table layout used), made both margins “auto” (effectively centering the column on the page). I then made individual rules for each div tag (I used the main column rule as the class, and the individual rule as the id).  I put things like background in each individual rule, and, in the rule for the clearing div, I cleared the floats on both sides.

Clearing the floats in the clearing div made it so that no matter how long the sidebar or main content is, the container would encompass both of them.  However, if the main content was longer than the sidebar, there would be a gap between the end of the sidebar and the footer.  So I made a image that was as wide as the sidebar, one pixel high, and the same color as the sidebar background, and made this the background of the main content div (as well as left aligning it and setting it to repeat on the y-axis).

Now for dynamically getting the page title/content.  I made a directory called “pages,” and made .php files for each page.  In the root folder, I made function.php, and in that a function that compared the $page variable passed to it (which was set in index.php to the value of $_GET['p']) to values stored in an array, which defined every page I had created, and returned true if it matched a value.  I called this in another function, which would include “/pages/$page.php” if $page was a valid page.  I also made another function, that returned the value of $pages[$page] ($pages is the array of defined pages), again, if $page was a valid page.  I also made provisions for if the requested page  isn’t defined.  That way, I could set $title to getTitle($page), echo $title in the title of document and underneath the page header, and simply call get($page) in the main content area.  I also included files for the sidebar and footer, so I could easily update them without changing the whole page.

I tested it out in IE, and it looked perfect (well, exactly like it had before).  So I sent it to my friend.  She mentioned a gap between two of the div tags (where they didn’t meet).  That was when I realized I hadn’t tested it in Firefox (or Opera, for that matter, or Safari).  I looked at the page in Firefox, and, sure enough, there was a pretty noticeable place where the div tags didn’t meet.  In Opera, same thing, but a different place.  I went into the CSS, and put borders around every div tag, just to see where one ended and the next began. I went back, and in both browsers, there were pretty big borders, but no gaps.  So I tried putting borders around just the affected div tags, and the same thing happened.  I made two new CSS files, one for Firefox, and one for Opera, made a border around the top and bottom of them, and changed the color to the color of the rest of the div tags (#006600), and put php if statements around the two statements importing them (if the browser was Firefox, import firefox.css, same for Opera).  I asked my friend too look at it again, and she said it was fine.  I checked in both Firefox and Opera, and it looked fine in both.

So, index.php is now 33 lines, as apposed to 120.  And I only need one copy of every line.  I can also link to other documents with /?p=sites, not /sites.php.

Oh, and by the way, the site described here is now what you see when you go to http://thetoothpick.com.

WordPress 2.3.1

October 28th, 2007

Among 20 bug fixes and a security fix, WordPress 2.3.1 adds several new things for users of Windows Live Writer.  First, it adds tags support (which means I can actually use them now.  Second, it changes the links on the side, now giving “View Site,” “Dashboard,” and “Manage Comments” links (before it was “View Blog” and “Manage Blog,” [which I thought meant within WLW]).  Anyway, I’m happier now.

My laptop finally kicked it

October 28th, 2007

Well… that’s not an entirely accurate statement.  First, "finally" isn’t the right word, because the underlying cause had been going on since the thing came out of warranty (funny how that works, isn’t it?).  Also, it didn’t really "kick it."

It started about… oh, say beginning of this year.  I have no idea really, but that sounds about right.  Anyway, I’d have it off, or in hibernation, and it would shut down entirely.  As in I couldn’t turn it on.  At all.  The power button didn’t work, the little lock switch next to it wasn’t next to the little lock, the battery and power cable were both properly connected, and the charging light wasn’t lit when plugged in.  The first time it happened, I just waited.  I used my old laptop (the one who’s screen broke. I just propped it up on something).  Anyway, it eventually started working again, and everything was fine.  For a while.  Then it happened again.  And this time, I waited for a couple days.  And it still didn’t work.  I contacted Gateway, and they sent me back a suggestion to send it in to Gateway to be fixed.  No thanks.  They also gave me an 8 step process for taking out and reinserting the memory, which might fix the problem.  It did.  Temporarily.  Then it happened again.  And I repeated it.  And it kept working.  Then I started getting lazy, and I forgot to detach the battery one time (which was incredibly stupid of me, I could have shocked myself…), and it didn’t work.  So I did it again, taking out the battery, and it worked.  Some time later, I forgot to unplug the power cable from it.  It didn’t work.  With power cord: doesn’t work.  Without power cord: works.  With battery: doesn’t work.  Without battery: does work.  Seem like a pattern?  Finally, one day, I decided to try just taking out the battery and power cord, waiting a couple seconds, and reinserting each.  And, sure enough, it starts working again.

And so I finally figured out that all I had to do was remove the battery and power cord, and then put both back in.  Which was good, because it started happening more and more frequently.  Whenever I leaned on the area of the hard drive a little too hard, the whole thing would crash.  I was annoyed, but there wasn’t much I could do about it.

One day, I was a bit pissed at my computer, because it was lagging more than I had ever seen it lag before.  I couldn’t even get to the restart button.  So I did it the fast and easy way.  I whacked the area above the hard drive, and it crashed.  But when I started it up again, it was in pretty bad shape.  Explorer took forever to load, and when it did, almost every program was slower than it ever had been.  So I restarted it (I could at least get to the button this time), and it shut down and powered back on.  I signed in, and was greeted with a blank, blue screen.  Then it restarted.  and the same thing happened.  This time, it failed to boot.  And it failed to boot in safe mode.  So I booted the Vista DVD and selected "Repair."  It couldn’t find the Windows installation.  So I got to the main menu, and it couldn’t find any system restore points.  I clicked "Detect and Repair," in the hopes that it might find something, and it did.  And it repaired it.  I booted the computer, and the same thing happens.  I repeated the boot from DVD, and this time it detects the Vista installation.  "Repairs Unsuccessful."  I try again.  This time it said it worked.  Reboot.  It failed to boot normally, so I tried in safe mode.  And it works.  I sign in, and it works.  Barely.  As soon as I try to open something, Explorer crashes.  And it won’t recover.  I hold the power button (because I couldn’t get there in Explorer), and it boots in safe mode. Repeat.  The third or fourth time, I get a chance to press the "restart" button in Windows.  It shuts down, and the next time it starts, there’s a message: "WARNING: Immediately back-up your data and replace your hard disk drive. A failure may be imminent."  Fuck.

So, when backing up my hard drive, I found a number of files that were unreadable (corrupted).  Which leads me to think that when I hit it, either the disk head scratched the surface (which isn’t theoretically possible, seeing as it’s designed not to), or files were open, and Windows hadn’t finished writing to them (which isn’t likely, cause the thing’s done the same thing about a hundred times without this happening once).

So, in conclusion…  My hard drive is partially corrupted, and my laptop is the biggest reason.  Which makes it easier to convince my parents to get me a new one (plus the fact that it’s been spiraling downhill for the year it’s been out of warranty…).  And, at least most of my data isn’t corrupted, so I’ll just be able to transfer it over when I do get a new computer.  Of course, the laptop isn’t completely unusable, and I do have my old hard drive…  And as long as I’m not using it regularly…  What I’m planning to do with it is set up Web Server 2008 on it, and tuck it away somewhere where it won’t get hurt.  I can then run my SharePoint site off of that, instead of a 10 year old machine with a 20 GB hard drive and 256 MB of ram.  That’ll make everything a whole lot easier…

god that was long…

LiveJournal

October 16th, 2007

Ok, so LiveJournal falls very far short of WordPress (less usability, no custom hosting, etc.), but it’s way in front of Xanga (Windows Live Writer compatible. that’s all that needs to be said).  So, I’ll be using my LiveJournal as well as my WordPress.  I’ll mainly use LiveJournal for the kinds of things I used Xanga for (quizzes, bitching, etc.).  Yep. Nothing interesting this time… (as if there ever is xP).