Choose Your Theme
Warren Shea

Archive for the ‘XHTML’ Category

Tutorial: This ain’t yo mom’s absolute pathing…sup?!

Monday, April 9th, 2012 at 4:39 pm

I should probably have a better title name considering what this tutorial is supposed to accomplish.

So as most of you hopefully know, putting a leading slash in a path refers to a root directory.

Example:
If the domain is http://www.worldofwarren.com/ and you link to
<a href=”/images/”>images</a>,
it will link to http://www.worldofwarren.com/images/

So what happens if you put 2 leading slashes in a path?
NOTHING LIKE THE ABOVE.

Purpose of this tutorial
To display the practical use of a URL with a leading double slash (//) in a path.
A URL with a double slash inherits the current protocol.

What you need to know/have
Basic HTML

Procedure
If you’re on an HTTP site (http://www.URL.com/) and you have

<img src=”//www.URL.com/images/logo.gif” alt=”” />,

then the image will reference http://www.URL.com/images/logo.gif

If you’re on an HTTPS site (https://www.URL.com/) and you have

<img src=”//www.URL.com/images/logo.gif” alt=”” />,

then the image will reference https://www.URL.com/images/logo.gif

Same code. But based on current protocal (HTTP or HTTPS), different results.

My ramblings
The // takes whatever protocol (HTTP or HTTPS) that the webpage is currently using and applies the referenced item to that. It’s awesome if you’re building secure and non-secure pages.

You wouldn’t need to use this on files that are within the same domain. In this case, relative pathing is probably better. But sometimes you link to files outside your domain.

For example, Google’s jQuery or SWFObject library.

Anyways, hope you learned something. I taught a lot of people this since learning it earlier this year, it’s awesome and so useful!

People are always asking “This form is supposed to be secure, but IE is prompting me with an alert that there are unsecure elements. PLZ FIX” and then you can be like “YO I JUST APPLY THE LEADING DOUBLE SLASH…sup?!”

<in Orcish> Werk Werk!

Friday, March 18th, 2011 at 1:48 am

So the senior developer that works with me has gone on vacation this week so I’m helping out with 3 of his tasks.

And while the timelines are tight (one week) and as of today (Thursday), I’ve only fully completed 1 of them, I gotta say that I’m having more fun working than I have in months. I can’t disclose the nature of the projects for obvious reasons…but 2 of the 3 of them involve learning something new or building something interesting. And the third project, the one that doesn’t involve learning something new…likely won’t get done by the end of this week :D

Anyways, one of them, let’s call it Project X, involves
1. Developing in a better language than I’m used to.
2. Developing on a different browser and platform.
It’s just…different. Challenging but within my reach.
The best part is that I can apply the things I’ve learned in Project X to warrenshea.com. So I may do that in the near future. Again, I can’t tell you what I’m doing yet….be patient, I’ll reveal it in a matter of time.

So on Sunday-Monday, I worked from 2am-6am. That was brutal and pretty much messed up my day. Good thing for Overtime Pay :) Well, technically I slept from 6am-noon so I missed a few hours in the morning. But ah well, I made it up that night (had to do some testing from 5pm-7pm).
Tuesday – Worked from 9:30am-10:30pm on Project X (13 hours)
Wednesday – Worked from 9:30am-Midnight on Project X (15.5 hours)
Thursday – Worked from 9:30am-4:30pm on Project X, went to Richmond Hill to have dinner with my family (parents, niece, nephew, bro, etc.), came back, worked AND FINISHED Project X! WAHOO!
Friday (tomorrow) – Work on Project Y from 9:30am-5pm, go to a basketball game (Raptors VS Wizards), maybe go to a birthday dinner after, and then come home and hopefully work on Project Y
Saturday – Possible Birthday party (another one), possible Toronto Comicon. If I don’t do that, I’ll be working on Project Y.
Sunday – Project Y.

So Project Y involves (from a technical standpoint)
Taking a Querystring from the URL
Loading a server generated XML via a JSP (see next point) but using the Querystring from the URL (thus, using AJAX to generate the XML as it needs to be after page load)
The JSP loads the XML from a cross-domain XML (this must be done so that my page can access the XML and prevent the cross-domain issue)
Anyways, eventually I end up with the XML, unique to the querystring.
I parse it, output the content to the page. I need to create a paging system manually (I’m using only HTML and JavaScript here, no server side languages).
And done!

Well, as I wrote that out, it doesn’t seem hard at all. Time consuming, but fun. Not doing standard HTML/CSS/JavaScript….using AJAX, XML, Querystrings (in JavaScript)…it’s interesting.

Anyways, that’s Project Y. Sounds easy, the (not hardest but) time consuming part will be outputting the XML into the page…I did the same thing here: [Redacted] a couple years ago…that was fun. God, there’s SO MUCH JAVASCRIPT on that page. browserDetection functions because I didn’t know jQuery at the time. JavaScript AJAX calls because I didn’t know jQuery at the time. Multiple XMLs, JSON….I had months to do that thing. Project Y has 3 days. So I’m gonna work my arse off partly because of the responsibility I feel that I need to deliver to the senior developer, but mostly because I simply can’t wait to do this. Not sure how much I’ll learn but it certainly sounds fun. 2 days to do it is pretty tight, especially considering it’s the weekend and I might do other stuff on Saturday….but I’m always up for a developing challenge.

I swear, if I didn’t have to work the next day, I would have pulled all nighters doing what I was doing this week. I loved it so much. Coding all night, just me, my music, my text editor and my focused, enthusiastic, eager mind. It’s not everyday I’m so excited to do work after all…I may as well milk it.

Anyways, off to bed. Based on the amount of sleep I’m gonna get tonight…I predict being very tired for the Raptor game tomorrow. Stupid me. Seriously.

My Personal (Developer) Resolve

Wednesday, January 12th, 2011 at 1:31 pm

Resolve
To be awesome at (almost) all aspects in the limited stage of the web.

*The following is a list on all the web-related items that I already know, would like to learn, and have no interest in learning (despite being related to the web). Some points may not seem to make sense, that is because my knowledge in the area is so terrible that I don’t know what I’m writing >_<

This Resolve includes:

  • The ability to develop proficiently in various development languages, frameworks, and techniques including:
    • ASP.NET 4.0 C#
    • ASP 3.0 VB (Classic)
    • HTML5
    • PHP 5
    • XHTML 1.0/HTML 4.01
    • JavaScript
    • MS SQL (and mySQL)
    • Ruby (on Rails) (maybe…)

    • CSS2
    • CSS3
    • SASS
    • OOP
    • AJAX
    • JSON
    • XML
    • XSL/XSLT
    • DOM
    • DHTML

    • jQuery
    • Prototype (and script.aculo.us)
    • MooTools

    • Google Chart API
    • Facebook API
    • Twitter API
    • Google Search Appliance API

  • The ability to develop for major browsers including Chrome, Firefox, Internet Explorer, Safari and (maybe) Opera
  • Familiarity with Web Accessibility standards including:
    • WCAG 2.0 standards
    • CNIB (The Canadian National Institute for the Blind) Priority Level 2
  • Understanding of fundamental SEO principles and Analytic tools including:
    • Google Analytics
    • Google Search Appliance
  • Knowledge of various Content Management System and Web Publishing tools including:
    • Drupal 7 and Drupal
    • WordPress and Blogger
    • Vignette 7 and Vignette 6
  • Proficiency in various graphic programs including:
    • Photoshop
    • Fireworks

This Resolve does not include:

  • Mobile development (although this may change in the future)
  • Email development
  • Development of non-web languages including:
    • C
    • C++
    • Java
    • Visual Basic
    • Perl
    • Python
  • Development of non-web languages that are fundamentally from the list above including:
    • JSP (Java) (although this may change in the future)
    • Mason (Perl)
    • Django/Zope (Python)
  • Development of supporting web languages:
    • ActionScript
  • Proficiency in web-related tools including:
    • Flash, Premiere, Illustrator
    • Silverlight (although this may change in the future)

What’s next (for me in web development)?

Thursday, September 16th, 2010 at 5:54 pm

So, the last few days I’ve learned a couple of things
1. My fundamentals suck. I don’t read any books, other than the ASP.NET one that I’m “currently” reading. I never read any html, asp, css, javascript book or anything. Everything I’ve done, everything I’ve learned my entire web career has been self taught or looked up, ie: I look up what I want to do, do it, and learn that “method” and use it elsewhere. For example, if I wanted something to loop, I would look it up.
Learn about for, while, do while. Make my change that needs the loop. And down the road, apply my knowledge to something else.

What this means is
a) I’m strong because I’ve looked a lot of things up.
b) I’m strong because I’m good at thinking outside the box…because I’m able to apply what I know creatively to get something accomplished. And if I can’t think of a solution like that, I look it up and add to my knowledge base.
c) I’m weak at fundamentals. I don’t know the “right way” (by that, I mean, the shortest, most efficient way) to do things because I find creative workarounds to accomplish the same thing. Like when I built a calendar from scratch. A feat in itself but time wasted when I could have used a control or other source code available.
For example: I didn’t know what display: block did. I thought it was just the opposite of display: none. I thought everything was inherently display: block’ed unless you specified display: none, which would hide it. I never learned what display: block was, I just guessed it’s functionality based on some use and the difference between that and display: none.

Conclusion: I will begin my re-education and buy/read some books on: CSS2.
I will learn CSS3 and HTML5 from a book so I get my fundamentals down. From there, I’ll continue learning what/how I currently learn….which brings me to my next point.

2. I’ve often wondered if I should move away from front-end web development and move to back-end. I’m good at both, stronger on front-end (that’s my job). But front-end does get kind boring in the way of “deep” thinking, something I really love. I thought I’d learned enough about front-end to try something more complicated…but because of 1 (above), I realize I’m not as strong as I thought, maybe there’s still room to stay in the front-end side. The thing is, with CSS3 and HTML5, where HTML5 is fundamentally different from HTML 4.01 and XHTML 1.1, there’s still a lot to learn. I imagine HTML5 will bridge the front-end and back-end development sides…but since I don’t know too much about HTML5, I can’t confirm that statement.

Conclusion: I will continue what I’m doing, both front-end and back-end. I will try to learn CSS3 and HTML5 early and decide whether or not it’s enough to satisfy my “deep” thinking. I will start working on something more complicated to fulfill my back-end need…which brings me to my next point.

3. I’m getting bored with warrenshea.com. Not in terms of blogging, but in terms of updating the site, creating themes, in terms of content/difficulty. I’ve launched 2 themes in the last week, I probably should have staggered myself, but there isn’t/wasn’t any challenge in doing my gmail theme. The idea was fun, the design was okay (like always), but the development was tedious. There are 4 themes I want to do still but currently have no motivation to do any of them. They all include a little “quirk” which would make the development interesting…but not interesting enough.

Conclusion: I think I’ll take a break from warrenshea.com for a bit (again, not the blogging aspect). I’m going to spend more nights re-re-re-re-catching up with ASP.NET….and planning the “EPIC SITE” site I want to build.

I know I write that ever 2 months but THIS TIME I MEAN IT :@

WordPress 3.0

Tuesday, June 29th, 2010 at 3:24 pm

Upgraded to WordPress 3.0!

The changes I made to the WordPress code, that took 2 nights to do, only accumulated to 8 files being modified, maybe a total of 40-50 lines of code changed. Took like, 30 minutes to redo the changes into WordPress 3.0….including using a Code Comparison program comparing default WordPress 2.9.2 and my current code to find the changes I had made.

About 50% of the changes are simply formatting/view source changes…which going forward, I should probably just ignore…not really worth the time. But my OCD has issues with that….

The other 50% of the changes include customizing how widgets are displayed as well as modifying the way WordPress displays content with their stupid <p> tags. I feel I *have* to do those changes…the way they’re coded is crappy. They don’t have <ul>s and </ul>s around their <li>s…definitely not XHTML valid! Anyways, I thought the transition to WordPress 3.0 would be difficult considering the 2 nights of changes I made…turns out, it wasn’t.

I’m kinda disappointed with WordPress 3.0….well, there are tons of cool new features but not for a web developer such as myself who’s already integrated WordPress into his site. They want WordPress to build a site for you…great for people without skill. Wasted on people with skill. I mean, I GET that it’s awesome for almost everyone but not for me…I’d rather make headers, menus, pages from scratch and have total control than be restricted to WordPress themes and constraints. That’s just me of course…

/next upgrade of wordpress will be even easier!