Author Archive

Stepping into the future

A little while back a friend of mine was telling me about a project he was working on. One of the things he mentioned was how he was using some of the new styles CSS3 offers. Around the same time I discovered a script that would enable some of those CSS3 feature in Internet Explorer. That got me thinking about things and one day I was looking at this site and decided to overhaul things.

Initially my plan was to to replace the complex use of images to do the rounded corners and drop shadow effects. But once I got going I ended up changing large chunks of the CSS, converting to HTML5, and radically altering IE support.

CSS3

I started out only intending to use the CSS3 styles border-radius and box-shadow to replace the way it was currently done. Previously in order to achieve the rounded corner effects, it required the use of some complex html, several images, and a large chunk of CSS. I decided with all current browsers but IE supporting border-radius (either border-radius directly or by extensions like -webkit-border-radius and -moz-border-radius) that I would use that. So I set out and deleted the complex html and replaced large amounts of CSS with just a handful of new properties. The results were great. Side by side the old way and new one looked identical. I then did the same thing using the box-shadow property. Doing this removed about 900 lines of CSS, 100k worth of images, and reduced the page size about 10k.

The old way

The new way

Now this had the site looking the same in all browsers but IE. The solution for this is a behavior file for IE that adds support for border-radius and box-shadow. After a short time fighting to get it to work I figured it out and had the site looking the same in IE…. Well mostly. The behavior file only supports border-radius so all 4 corners are rounded. The boxes in the right side bar only have the top corners rounded and the script didn’t work for those. After exploring possibly using something like DD_roundies to support this I decided that I was ok with that little bit of the site looking square in IE.

HTML5

After that I started wondering about other new browser technologies out there. With HTML5 being the main one. I started testing out the water by replacing the doctype with <!DOCTYPE html>. Ah simplicity. Then I reduced the html tag to <html lang=”en-US”>. Liking it so far. But there’s a lot more to HTML5 than just shortening a few tags.

One of the more notable changes is new input types. Types like email, url address, search, date, color picker. Now being a blog the only input box on my site is a search box to search the archives. So I changed it to be type=’search’. Now what does this do? In most browsers, nothing. It just acts like a plain old text input. But in Safari and Chrome when you enter something into the box a little x appears on the right that you can click to clear the box. I know right, it’s awesome. Another new input feature of HTML5 is the placeholer attribute. This attribute allows you to define text that will show up in the input when no text has been entered. So in browsers that support it (currently just Safari and Chrome) you’ll see ‘Search Archives’ show up as place holder text in the search box.

HTML5 comes with a new set of semantic tags. Those tags are: <section>, <nav>, <article>, <aside>, <hgroup>, <header>, <footer>, <time>, <mark>. Now when I first saw those tags I think I reacted like everyone else did. “Well those are stupid. Why not just use div’s.” But then I got to thinking about it and what HTML is really for. HTML is the Hyper Text Markup Language. It’s meant to mark up text on the web in some meaningful way. We’ve just been using div’s cause we needed a way to style things. So then it made sense to use specific tags to markup the different bits of content.

As a result I’ve taken to using the header, footer, nav, article, aside, and time tags in their respective places. Now this brings up the question of how browsers handle these unknown tags. It comes down to 2 issues, how are unknown tags styled and how are they placed in the DOM tree in relation to the other tags. Most browsers just don’t style unknown elemets but allow you to with CSS. Also most browsers place the nodes in the DOM tree how they are defined. The exception here is IE. It doesn’t allow styling of unknown elements and it places them as empty nodes in the DOM tree, thereby breaking the structure. There’s a fix for this though. By using JavaScript to create dummy elements, IE will then recognize them and do the expected thing. So we add basically the following code.

<!--[if lt IE 9]>
<script>
  var e = ("abbr,article,aside,audio,canvas,datalist,details," +
    "figure,footer,header,hgroup,mark,menu,meter,nav,output," +
    "progress,section,time,video").split(',');
  for (var i = 0; i < e.length; i++) {
    document.createElement(e[i]);
  }
</script>
<![endif]-->

This code creates all the new HTML5 elements in IE so that they will work. I am using the html5shiv script to do this. Another thing to add is this bit of CSS that will give these new elements a sensible default.

header, footer, article, section, hgroup, nav, figure {
    display:block;
}

With all that in place we can use the new HTML5 tags like we want.

The final stop on the HTML5 tour is video. I’m not really a fan of Flash and have never really gotten it to work for playing videos on the site. So I was excited about having the browser be able to handle the video. I decided that I wanted to make use of the Video 4 Everyone code that would make it so HTML5 video would work using H.264 or Theora depending on the browser, but also drop down to using a Flash player if HTML5 video wasn’t supported.

I searched for a WordPress plugin that would do this and found a couple, but upon trying them out found that they had problems and just didn’t quite do what I wanted. One of them had a feature that allowed you to upload any video and it would convert it to the H.264 and Theora versions for you. This was something that I thought was nice so I started with that as a base and started writing my own plugin to handle HTML5 video. Pretty quickly I started running into hurdles.

Time for a side rant. Currently the HTML5 spec doesn’t define what codecs are to be used for video. As a result it’s currently split between the proprietary H.264 codec and the open source Theora codec. Whatever I thought because I can provide support for both with ffmpeg encoding to both formats and the broswer can use the one it supports. Problem came when I tried to do this and found out my ubuntu server doesn’t support encoding to H.264 due to its licensing restrictions. From a technical standpoint I like the H.264 codec and the results it gives, but the patents and legalities that surround it are very scary. End rant.

So side stepping the encoding problem and converting to H.264 on a different machine and uploading it later, I got my plugin functional. Now all current and future videos on the site use HTML5 video and dropdown to Flash if that’s not supported. I hope to clean up the plugin code and add a couple features so that I can release it sometime soon.

Internet Explorer Support

Previously I maintained IE6 support using a separate IE6 only CSS file. This stylesheet file was 679 lines long of tweaks for just IE6. After having changed so much HTML and CSS and seeing how poorly IE6 supported a lot of it, I decided it was time to end support of that browser. I’m not alone on this. I searched around a bit and found a script I liked that would alert an IE6 user that their browser is old and unsupported. One of the requirements I had for this script was that even though it alerted them that the browser was old and unsupported, it would still allow them to use the site if they chose even though the experience was going to be a little ugly and maybe even a little broken. The sevenup script did just that.

Upgrade IE6

Wanting people to still be able to use the site in IE6 if they chose to meant I still needed a small amount of fixes to make it bearable. I added in the DD_BelatedPNG script to add in transperancy support for images in IE6. I replaced the IE6 stylesheet with just a handful of rules so things don’t look too terrible. All in all I hope anybody using IE6 would upgrade but if they choose not to at least it’s mostly usable for them.

As far as support in IE 7 and 8 goes, using the scripts mentioned above for HTML5 and CSS3 support they pretty much look the same as other browsers. There’s a few styles that don’t look as I intend, but I’m ok with the look deteriorating slightly in a browser with lackluster support.

Simplifying WordPress

After having changed all this HTML and CSS I began wondering if I could simplify the code used as part of my WordPress theme. Previously in order to add the complex HTML for the rounded corners into things like comments and the sidebar widgets required some equally complex and hacky code around the WordPress functions. I began removing this code and found that for the most part I could go back to using the default HTML produced by the WordPress functions and style them to look the same using just CSS. In the end I’ve ended up removing 168 lines of php code, and 100KB of images.

In the end I had a lot of fun with the changes I did to the site. Hopefully things like better video support get me posting more often. I have a few plans for things in the future. Stay tuned.

-Dexter-

Discovering LaTeX

So back when I was still in college I went hunting around the internet for a OpenOffice.org resume template. I eventually found one that I liked and started using it for my resume. Fast forward 4 years and I was still using this same template. Now I liked the look of this template but I always hated editing it. It was full of tables and different formatting, the template was originally for OpenOffice 1 and 3 is the current version. Needless to say I never really updated it unless I had to and even then only like a word here and there.

That’s when I discovered LaTeX. Well not really discovered, I’ve known about LaTeX for awhile, just have never looked at doing anything with it. But one day I was surfing the internet and came across a LaTeX resume class file. I loved the look of it and figured if I could get it to work it would be so much nicer than the OpenOffice file.

Lets take a step back for a sec so I can explain what LaTeX is for those who don’t know. LaTeX is an extension of the TeX document markup and typesetting program. Basically you write up a document in plain text with some extra LaTeX markup that describes the documents look. This allows you to focus more on the content of your document while LaTeX handles the typesetting. You can then generate the final look using that plain text. Usually creating a PDF. LaTeX is used most by mathematicians and scientists for writing formulas and by book writers. Here’s an example taken from wikipedia.

Here’s the LaTeX markup:

\documentclass[12pt]{article}
\usepackage{amsmath}
\title{\LaTeX}
\date{}
\begin{document}
  \maketitle
  \LaTeX{} is a document preparation system for the \TeX{}
  typesetting program. It offers programmable desktop publishing
  features and extensive facilities for automating most aspects of
  typesetting and desktop publishing, including numbering and
  cross-referencing, tables and figures, page layout, bibliographies,
  and much more. \LaTeX{} was originally written in 1984 by Leslie
  Lamport and has become the dominant method for using \TeX; few
  people write in plain \TeX{} anymore. The current version is
  \LaTeXe.

  % This is a comment, it is not shown in the final output.
  % The following shows a little of the typesetting power of LaTeX
  \begin{align}
    E &= mc^2                              \\
    m &= \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}}
  \end{align}
\end{document}

This generates to look like this:

425px-LaTeX_Output

Pretty sweet. That’s something I can get on board with, writing the document in plain text and then generating the final look. So much easier than fighting a word processor to attempt to get what I want. So I downloaded the class file and set out trying to figure out the LaTeX markup. Now as you can see from the example above the markup can be a little confusing at first. Starting out I mostly just copied the markup from the example from the class file, using the LaTeX book on wikibooks to look thing up as I came to them. After this I found The Not So Short Introduction To LaTeX, a relatively short (about 125 page) free ebook. Highly recommended.

So now I have my resume as a plain text file, that is under version control using git. This makes it much easier to go in and make changes whenever I want without having to worry. If I change something that I later don’t like I can just look at the history. Then after I’m done making my changes all I have to do is a “pdflatex resume.tex” to generate a pdf copy to look at. Also because LaTeX is a typesetting system the final output looks amazing.

So there you have it, my conversion to LaTex. Unfortionately the only thing I’ve used it for so far is my resume. It’s too bad I wasn’t enlightened when I was still in college, I would have written every paper in it. So now I keep thinking about what I could use it for. I recently discovered Beamer, a LaTeX class for creating presentations. Tho I don’t usually create slides for my presentations. Maybe I should write a book….

JoliCloud Review

Probably about a year ago was when I first heard of JoliCloud. At that time it was this mysterious thing, an operating system for netbooks that was supposedly leaps and bounds better than what was currently available to run on netbooks. This sounded really interesting to me so I entered my email on their site to get an invite when they released it. Jump to a couple months ago and I get an email to download the alpha version of JoliCloud. Excited, I hurriedly downloaded it and installed in on my Eee pc. Here’s some of my thoughts on it.

I popped it in and started it up and was greeted to a startup screen and boot screen that looked a lot like Ubuntu’s.

jolicloud1 jolicloud2

I walked through the installer all the while thinking it looked like Ubuntu. I let the installer finish and the system reboot and I’m greeted with the Ubuntu Netbook Remix interface.

jolicloud3

And thats exactly what it is, Ubuntu Netbook Remix. The JoliCloud part is an application that is launched when you click that cloud icon. This is where the invitation part comes in as you login to JoliCloud here.

jolicloud4

After you login you end up on the dashboard that basically shows what system updates there are and maybe some notification things.

jolicloud5

The other tabs are the App Directory (which I’ll come back to) and the Settings tab. JoliCloud is like a social network that allows you to follow people kinda like Twitter.

jolicloud7 jolicloud6

The App Directory is the main thing of JoliCloud. From it you can install any application with one click. As you can see in the picture above of the App Directory there are normal applications like Skype and VLC, then there are webapps like Gmail and Facebook. You can install any of these apps with a click of a button.

jolicloud8 jolicloud9

After you’ve got something installed you go back to the Ubuntu NBR interface (by clicking the home icon in the upper left) to launch it. For the webapps they open in a full screen window.

jolicloud11 jolicloud12

So I was curious how it was doing this, mainly the JoliCloud app and running the webapps. So I went hunting around the system and found that all its basically doing is using Mozilla Prism. Prism is a browser like Firefox, but it places an icon on your desktop and ties that site to a single browser window. This makes it seem like the webapp is a normal desktop app. As far as the JoliCloud program, it’s just another site running in Prism that hooks into Ubuntu’s apt system to install programs.

So there you have it, it’s Ubuntu NBR using Mozilla Prism. Not as revolutionary as you would hope. Sure its optimized some for netbooks, but so is something like Eeebuntu. I don’t care much for Ubuntu NBR, mainly Maximus, the thing that runs every program as maximized, and the way it shows items on the taskbar. I think it also comes down to the fact that I can install programs from the command line just as easy as clicking an icon. And if I want to run a webapp in a single window I can just install Prism and set it up myself. When it comes to my netbook usage, I’m usually pretty minimal. Firefox and a terminal are the apps I use most. With the ocassional pdf or movie viewing. So for now I’ll keep looking for a setup I like on my netbook. I’m really hopeful for KDE’s plasma netbook shell that they are developing.

-Dexter-

Living on the moon

Entering_a_Lunar_OutpostBetween the launch of Endeavour on STS-127, LRO sending back pictures of the Apollo landing sites, and the 40th anniversary of landing on the moon, I’ve been thinking about space a lot. The other day I was discussing NASA’s future plans with a friend, about the design of the Ares I and Ares V and NASA’s plan to return to the moon. The conversation then went into the establishment of a base on the moon. And saying that struck me as something that’s only in science fiction, a “moon base”. At the time it just seemed terribly absurd.

But then I thought about it and it doesn’t seem so crazy. There have been people living in space stations orbiting the earth since about 1971. First in the Russion Salyut stations and later Mir, then the US Skylab, and now in the International Space Station, which has had a perminant crew since November 2000. A crew that went from 3 people to 6 this past May. At this point I would say we’re pretty experienced with things like building habitations in space and dealing with the effects of micro-gravity on the human body.

So living on the moon really wouldn’t be that much different. In some ways I think it would be easier. The moon has 1/6th the gravity of earth, making tasks like eating and getting around simpler. Also being on the moon would give you places to go. You could put on your suit, step outside the outpost, and go for a ride in your dune buggy, play a round of golf, or watch the earth come up.

The idea is to send up an outpost piece by piece. Basically like single rooms that you could link together to build the place. By now I’m thinking this is totally possible. And not only that, but possible within the next several years. If I ever get a chance to vacation on the moon, I’m taking it! Science fiction is becoming reality.

-Dexter-

New Design

So I’ve been working on this for about a month and finally decided I needed to get it up now or I was never going to. So after a few days of fighting with the method I was using to install WordPress and a couple plugins, here it is. This is my second design of the site. It incorporates things from my first design, mainly the colors, but unlike that first version, this one isn’t ugly. At least I don’t think so, I’m really liking this design.

I have a lot of plans for things I want to add to the site and I’ll be working on that in the near future. I also hope that now that I have a design I like that I’ll be more inclined to use it. I already have a couple of new posts in mind so keep on the lookout for that.

Let me know what you think of the new look in the comments.

-Dexter-

My New Project

Being the geek that I am I have more projects that I am working on than I can ever hope to finish. Recently I decided to add another one to the list.

For the past couple of weeks I’ve had the itch to get back into 3D Animation. Its been a few years, since college, that I’ve done any animation. So I decided to download Blender and go through some of the tutorials I have. One of the things I have is a Blender 3D Design Course. I was happy when I fired Blender up and I still remembered some of the keyboard shortcuts. I also like some of the new features that have been added since I last used it.

To start off the course it went through a tutorial to model and animate a little submarine.

The next lesson was about basic modeling skills. The first tutorial from this lesson was modeling a sofa.

Then it had you apply a texture to it.

The 2nd tutorial was modeling a simple hand.

Then adding an odd texture to it.

The 3rd tutorial in the lesson was modeling a snowman scene. I went a little further than the tutorial did. First this is how they wanted it to look.

I decided the straight black arms, black nose, and circle mouth all looked kinda stupid, so I made mine better.

The next lesson has you animating the snowman scene and I’ve already been thinking about how I’ll make it better than what they show.

All in all I’m having a lot of fun and look forward to learning more about Blender than I have known in the past. I’ll have to dig up my stuff from school and post it.

-Dexter-

Hello Planet

Hello Planet!

So today Herlo noticed that my blog wasn’t on the Utah Open Source Planet and decided to add me. I’ve been meaning to get myself added but thought that I should wait until I started writing more tech-ish content. Well looking at the past things I’ve written most are pretty tech-ish in nature. Guess I’m more of a geek than I thought. So I guess its good that I finally got added to the planet. Except now I might have to get rid of my “nobody reads my blog” shirt…. hmmm. Anyway hope you enjoy it.

-Dexter-

Back up and running

Woot. Server is back up and running. Took a little while longer than I expected but its all good now. Got the server reformatted and new versions of everything installed. Got a little more work to do to get everything how I want it, but that will be able to wait a bit.

Carving Pumpkins

So my mom picked up one of those little pumpkin carving kits and my brother and I decided to give it a whirl since we haven’t carved pumpkins in a few years. So I was out running some errands the Saturday before Halloween and decided to swing by to the pumpkin patch to pick a couple up. And being me I got a couple of decently large ones.

The following Sunday we sat down to carve them. My brother went with a pattern from the kit called AI Face. I used one I had found on the internet of the linux mascot tux.

Beginning to carve

Beginning to carve

Its slimy and gross in there

Its slimy and gross in there

Yes the tongue helps

Yes the tongue helps

Me scraping my pumpkin

Me scraping my pumpkin

Jay doing some carving

My brother doing some carving

Jay getting help from dad

My brother getting help from dad

Jay\'s pumpkin lit up

My brother's pumpkin lit up

The way mine turned out

The way mine turned out

My brothers looked awesome when it was lit up. As you can see on mine I carved out the middle but then scrapped down the feet and beak areas. Scraping a pumpkin, just so you know, is insanely difficult. I ended up using an X-acto knife to help. I was hoping the effect would be something like a glow through the part of the pumpkin that was still there. It kinda worked but not as well as I had hoped. Oh well it still looked cool and was fun to do.

btw. Blogging pics with wordpress is kinda a pain. I need to get gallery2 setup and hooked into this thing.

Utah Open Source Conference Report

So here we are at the 2008 Utah Open Source Conference. I’ve been excited for this over the past few weeks. Got some really nice swag. Got a nice new messenger bag, several t-shirts, a cool little penguin, and other small things. Presentations were been good. Hit up a python one to begin with. Learned some nice beginner python stuff. Then went to a wordpress performance one. Joseph Scott did a good job presenting ideas to speed up a wordpress site. I then went to a SSH Tips and Tricks presentation. Learned some cool stuff about secure tunnels. After that I got roped into the Guru Labs Trouble Shooting Challenge. Only managed to figure out 2 of the 6 questions. Still glad I didn’t go down the sysadmin route. The first day ended with keynotes by Mac Newbold of Code Greene and Paul Frields of Fedora. Mac talked about the benefits of using open source in a business. Paul talked about the Fedora community.

Day 2 started with Chad and I missing the first round of presentations, cause neither of us can get up that early. The first presentation I made it to was Linux Media, Security and Automation which was an interesting talk about setting up your house with security cameras and motion sensors and light dimmers, all controlled by Linux. Unfortunately I thought he spent too much time talking about the costs and the interoperability of the different items, than talking about the hardware and how to set it up and stuff. Next I went to HOWTO: Start an open-source radio station presented by Michael Place of utah.fm. This was a cool talk about what it takes to create an online radio station. It was a surprisingly relatively inexpensive project.

There was then a lunch break followed by that days keynotes. Friday’s keynotes were by Michael Place and Joe Brockmeier. Michael Place is the author of Schlock Mercenary and talked about how he’s making money off of a free comic. He was a great presenter and I’m going to have to add Schlock Mercenary to my reading list. Joe Brockmeier is the project manager for openSUSE and talked about where openSUSE is today and where its going.

Things at the conference got a little out of whack after the keynotes and presentations ended up getting pushed back or something so I spent the next presentation slot hanging out in the exhibiters hall talking to people like mindjuju, fungus, and John Taber. Next I went to the Vim and Python presentation which the presenter didn’t show up for so Kevin Kubasik tried to fill in and was able to talk a little bit about vim but unfortunately I didn’t learn anything new.

After the presentation there was a geek dinner over at Tucanos in The Gateway. There were like 50 some odd geeks and geekettes there. The food was great and the conversations with all the other geeks were interesting. UTOS payed for Brazilian Lemonades for everyone, which were delicious. After the dinner Erik and I managed to catch the last train of the night.

Saturday I started off the day with an Ubuntu keynote. Christer Edwards talked about using Ubuntu in the enterprise. Next up I went to a presentation by Kevin Kubasik on Writing Web Crawlers. The way he was doing web crawlers was quite advanced and way better than the way I used to do it. Then I went to Tools for Video and Images which talked about the various programs for dealing with images and video on Linux. After this we had lunch provided by The Smokehouse.

After lunch there wasn’t any particular presentation that I was intent on going to see and I was quite tired so I called it quits. I went home and promptly crashed on the couch for about 3 hours.

Overall I had a great time at UTOSC this year. Got some nice swag. Learned some new things. I’m looking forward to next years.