Choose Your Theme
Warren Shea

Archive for the ‘Development’ Category

Site updates + WordPress

Thursday, June 17th, 2010 at 11:28 pm

I’ve spent the last couple of nights formatting my code so that if you view source (go on, do it!), it’s DTD XHTML 1.0 Strict as well as formatted (space) precisely to my standards. It sounds easy right? if things don’t align up, press spacebar in the code a couple time until it aligns it. But…it’s actually not that easy because the blog portion as well as the RSS is generated by WordPress and doesn’t care about the formatting at all. What does that mean? Going deep into the WordPress code and figuring it out. Well, figuring it out enough to change it. It’s purely cosmetic but in diving into the code, I was able to remove some “additions” that I felt were in question.

1. WordPress, by default, wraps everything in <p> tags…which I hate. Paragraph tags add extra space, unless you change the standard tag’s CSS. But for someone who likes full control (and who doesn’t have it), these tags suck. I’m much more accustomed to using <br />. Controlling exactly how to space content. Anyways, WordPress adds paragraph tags around everything so I had to replace that with the appropriate amount of <br />s.

2. WordPress also strips <br />s. Which sucks because just say I wanted to do something like this
FAKE SPOILER ALERT

Joking!
I couldn’t! It wouldn’t allow those spaces, it would look like this:
FAKE SPOILER ALERT

Joking!
Despite how many <br />s I threw between the text. Ridiculous eh? Anyways…I had to go into the code and fix that.

3. WordPress also, by default, replaces three consecutive periods with … so that … = …
The problem is that someone like me, who chooses a # mod 3 != 0 will result in 4 dots becoming …. or 5 becoming …..
Hideous I say! I don’t quite understand the purpose of replacing the periods…but yeah, that had to go. I was changing my … ‘s so that they would mod 3 == 0. But it was annoying.
I couldn’t write things like “uh……………..” without having to post and go back and edit/remove the dots. Because let’s face it, with OCD, this: …. and ….. was unacceptable!

4. WordPress keeps widgets together. So the RSS Feed that I had…it was all grouped into ONE section before. I had to go into the code…find out how the RSS was being written and throw in some if statements to display other headers. The result is on the right (notice the RSS feeds are now sectioned off into groups rather than in one “RSS” Category) ——->

5. I also changed the standard WordPress UI. In the image below, the left side is the original WordPress UI. If I had say, 10 RSS feeds, the CMS wouldn’t show any descriptive titles. If I wanted to edit a particular RSS, I would have to play the counting game or the “click edit and trial and error” game. Ridiculous! I changed the WordPress UI to show at least some form of descriptive title…So if I wanted to edit a particular RSS feed’s information, say #10, I can click on the one I want and not have to guess or look at the Edit’s link. Also, I was able to throw my particular headers into the WordPress UI as well! The WordPress UI, thanks to my tinkering, now mimics my site exactly.

Chrome and other web browsers

Thursday, June 10th, 2010 at 10:28 pm

Z has been trying to make me switch to Chrome…I have to admit that it’s simple and fast…but not rendering my site as well as I’d like.

I started doing Acid3 Tests (http://acid3.acidtests.org/) at work, on my work browsers including:

Firefox 3.6.3: 94/100
Safari 3.2.3: 75/100
Opera 10.01: 100/100
Internet Explorer 8.0.6001.18702: 13/100….before crashing my IE >_< Stupid IE Chrome 5.0.375.70: 100/100 I DO notice Firefox is pretty slow in general...but I love/need it for: FireFTP FireBug (because developing on IE8 and using the IE Developer Tool sucks) I'm pretty surprised/impressed that Chrome and Opera are both 100/100. Firefox comes close and IE...IE is terribad as always. I DO use a tab on IE for listening to the radio as well as watch youtube videos. Firefox always just seems to lag the videos if I have too many tabs open or if the program has been open too long. I guess it needs to do a memory dump.

Maybe…I’ll use Firefox for FireFTP and FireBug and use Chrome to browse…I don’t know.

On my site TO DO list: Cross browser testing. So boring, bah!

Is there a better way to code this?

Friday, June 4th, 2010 at 11:08 am

(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;

I’m just joking That’s just the first part of the jQuery framework :)

I pride myself in great, but not perfect code. I like doing things right, efficiently…the best I can given the situation, deadlines, etc. Obviously the code CAN be better as I’m not a great developer…but I do the best I can so even if there are flaws in code, it’s done to the best of my current abilities and I’m proud of it.

Sometimes though, I get really wrapped up in my current way of thinking…and I forget to take a step back away from my code and ask myself if it’s good enough, adaptable enough, reusable, etc. For example, I developed something a year or so ago. I was very happy with it but it wasn’t adaptable and efficient. Yesterday, I took the same code and cut it down to 20% of what it was originally…which is a lot and kind of shows you how poor the code was before.

Anyways…sometimes you have to take a step back, take a break, look at code after 30 minutes or a good night’s sleep…to really make it great. A weary mind from all-nighter coding just dulls your mind and standards. Too much enthusiasm leads you to impatient and inefficient coding. Like when you code poorly just to get something to work…and then don’t go back to fix it and make it efficient because of deadlines, etc. Sometimes it’s just too much fun to try to solve something, no matter how it’s done. But really, it’s good to go back after you’ve solved the problem…and make the way you did it better.

/urge to blog during work is bad…i was working so well this morning too -_-;

Wowowow! Google + Font Previewer

Thursday, May 20th, 2010 at 8:59 pm

By linking to a google stylesheet, you can put a special font on a webpage without the user needing to have the TTF (truetype font) or w/e font.
http://code.google.com/webfonts/preview

I thought this was epicly cool, I wanted the title for my webpage to be a certain font but due to the limitations of fonts on other computers, I had to go with an image…

Given a stronger set of font styles, this could be pretty damn epic in the future, at least for me.

Also, lately I’ve been loading my Ajax libraries API (JavaScript libraries) using Google
http://code.google.com/apis/ajaxlibs/documentation/

I thought both of these were kool…I especially like loading external libraries..that way you don’t have to keep them on your server. I mean, it’s not a big deal, there are a couple reasons why you would want to do this…but I’m too tired to list them.
http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/

God so tired, can’t think, can’t write coherent blog post.

Damn you syntax! Why you gotta be all…similar but different

Wednesday, May 12th, 2010 at 11:59 pm

ELSEIF or ELSE IF?

do IF statements need END IF or can you just use parenthesis { }

OR or || ?

AND or && ?

!= or <>?

NOT(statement) or !(statement) ?

Why is x=y sometimes a comparison, not a declaration (it might be just VB that does that?)

VB uses &, PHP uses ., JavaScript uses +…C# uses…I don’t remember… + I think? Why must concatenation have so many different methods

” or \” or “” ?

<!–– ––> or <%-- --%> or /* */

‘ or // ?

Don’t get me started on Arrays! Sometimes Dynamic, sometimes size is fixed…then there’s ArrayList…

I just want to code but I always get caught up in incorrect syntax. I should really finish my Coding Language Reference. It’s really frustrating knowing what to code but getting caught up on “grammar”.

Like, I know how to eat and apple but I don’t know how to cut it or bite into it or liquefy it…or…that’s a terrible analogy

I’m feeling a dry spell of good posts lately. This is no exception.