Toby's Log page 96

The Facebook With Friends

Only one day after my initial post about The Facebook, I got my first friend request. It was a Woodridge person, and one that I hadn’t talked to that much in the later years there (as if I really talked to anyone there much). Since that first “friend”, I’ve continued to receive a fairly steady stream. Most have been from Woodridge, but I’ve gotten one from my Tri-C days and one from my Winking Lizard days. Perhaps a that’s a sign of just how much less present I was after Woodridge.

I currently have 26 “friends” there. A number of them I haven’t even communicated with, just “friended”. Many of them, like my first “friend”, I hadn’t talked to much in the later years. I’ve had three people from another class and one teacher “friend” me even. I’ve made two friend requests now. One was after my recent high school reunion, where I saw my first real love, who I hadn’t seen in about six years. She said to contact her on The Facebook, so I did. The other happens to be another girl I was/slightly-am-still in love with from the Winking Lizard. I’m pretty sure she never wants to contact me again, but she was “suggested” by that Lizard person who did “friend” me. She hasn’t responded yet, and I guess I don’t get a message if she doesn’t want to be my friend: Oh well.

So far it seems like, for me anyway, The Facebook is a place where you contact old friends with brief messages of “how are you, haven’t seen you in a while” when you first “friend” them, then you probably won’t message them for a year or two. As I said, some I haven’t even contacted yet. I’m making it a point to contact everybody though, just at a comfortable pace. They shouldn’t be my “friend” if I don’t contact them at least once I’d think (probably more would seem most right).

I don’t know if this Facebook will really amount to anything for me. The discussions have been brief and mostly provided me with little hope of even increasing the number of people I regularly communicate with, let alone real world friends. One a number of recent events or things in my life I had hope for but have proven to just be the same old thing. I think the problem is me


The Facebook

I managed to make it for several years in the face of The Facebook without joining it while people all around did. With my lack of real life friends and of interest in an online social network, I saw no need. There’s also the privacy and security concerns. But in recent months I had some of my cousins and a few others suggest I join. Last week, a chance encounter with a former classmate from high school pushed me over the edge to finally join. She said she’d friend me if I joined, and our conversation was brief enough that I figured at that point joining might allow me to at least briefly reacquaint myself with her and perhaps other people from the past, who for all intents and purposes no longer exist. I didn’t join immediately due to apprehension about the whole thing and because I was fairly busy trying to spend time with my brother on his short visit.

I finally gave in and joined a few days ago. I gave my name and email address, then chose to delve deeper by providing my location, schooling and job history, and attempted to provide my favorite music, movies, books, and activities.

The Facebook now has a nice beginning understanding of Toby Mackenzie. However, none of The Facebook members do, at least not through The Facebook. I have no The Facebook friends. 0. This is, again, not too different from real life, but I was hoping to at least “friend” some of the folk who suggested I join. Unfortunately, I couldn’t find them. In searching for the former Woodridge friend who pushed me over that hump of joining, I found four people with that name, and based on photos, three definitely weren’t her and one as discernible as a shadow on the side of a tent, which is what the photo looked like. I could not find my cousins either, with similar results.

I did find some people I knew. The most recent was one of my teachers at Tri-C, but I don’t really talk to her anymore and knew her more in a school and web design capacity, maybe not the best first move into the “social” world that I envision “The Facebook” to be. I also found some other Woodridge people, but I haven’t talked to almost any of them in a long long time. I can still be shy on The Internet. There aren’t too many other people I could really look for. I found a handful of Winking Lizard people, but we didn’t get far in conversation even in real life (I guess that’s true of most everybody though anyway).

I did find my one most friend-like non-family friend, my former guitarist and multi-time roommate. I do still talk to him on the phone from time to time. I’ll let him “friend” me if he’d find that of benefit. I’ll let these people who know how to work The Facebook to handle the “friending”. Otherwise, I’ll see how long I can maintain 0 friends.

Besides for the friend bit, there really isn’t much of interest on The Facebook. There seems to be applications and games, but I have those outside of The Facebook. So far it’s not seeming worthwhile to have joined.


HTML5 href Anywhere Attempt

XHTML 2 was going to allow use of the href attribute on any element, allowing for block level anchors and eliminating repetition of the same anchor in some cases or unnecessary additional tags in others. This really made sense, since the <a> tag is just a span, but the only span with an added ability of linking to somewhere else. There is really no special semantic meaning to the <a>, and all links on a page could be found in parsing by finding tags with the href. In the early days of the development of HTML 5, the “href anywhere” approach was discussed, and I was excited thinking it was going to be part of HTML 5. At the time, that was the most interesting thing about HTML 5 to me. But “href anywhere” would mean all previous browsers would not be able to see links at all (besides for the ones put in <a> tags for some reason), so the idea was scrapped. Instead, the HTML 5 creators took advantage of an against-spec ability that current browsers already had: block level anchors. Browsers at least back to IE 6 will happily make “flow content” placed in an <a> tag into a link.

I was somewhat unhappy that we had to kowtow to current browsers by preventing such a wonderful ability as href’s on any tag, but the backwards compatibility thing is huge in real world development (though I would have just done some server side browser sniffing to output the <a>‘s in appropriate places for incompatible browsers) and the solution handles most use cases, though with a bit of extra markup. Over time, I began thinking that perhaps I could just use <a>‘s in place of any tags that have no semantic meaning (ie <div> and <span>), only using href when required and thus have href available most anywhere.

Continue reading post "HTML5 href Anywhere Attempt"

Cogneato: Lost a Developer

At my place of work, Cogneato, we recently lost one of our developers. It’s kinda sad because I talked to him the most out of the people there. I was also feeling somewhat comfortable with the number of people there. Sometimes I had to look for things to do, but now there will probably be more than enough for me. I will be taking over parts of what he did, so I will be doing more back-end type development. My job at RPM was much more in the back-end area, so it shouldn’t be much trouble. I will get to work on and learn about our CMS, which will give me much more knowledge about building them. I’ve been trying to build my own for a long while now, and this will give me a lot more capability to do so. They have been upgrading the CMS to use Qooxdoo, a framework for web applications, so I will be learning that as well. I’ll probably post some of what I learn with that here. Hopefully it won’t be too hard for me to jump into this upgrade in the middle of it. With this change, I will also be getting more of various tasks such as development type fixes and solutions for sites, upgrading the CMS for older sites, and dealing with server issues. And possibly I’ll move away from doing SEO and some other more front-end tasks. I’ll probably continue doing layouts, most likely handing them off to others earlier though, dealing less with the content and specifics.

Hopefully this change will work out for the better. And hopefully our lost developer will do alright wherever he ends up.


CSS3: Rotation

Continuing my adoption of new CSS3 capabilities, I’ve built my first site using rotation. CSS3 allows rotation of elements with the transform: rotate(); declaration. It is as simple as giving a value between the rotate parenthesis with a number and the unit deg. Positive values go clockwise, negative values counter-clockwise. I don’t think any browsers yet support the CSS3 spec transform property, so you must use the vendor-specific hack prefixed properties -moz-transform, -webkit-transform, and -o-transform. There is in fact a CSS3 proposed rotation property, but I believe that has no current support at all.

Then, there is IE. For IE, the matrix filter must be used. It, unfortunately, does not allow for nice degree values to be used and instead uses four numbers derived by some confusing math. I could not get Microsoft’s example script working, but I found this matrix rotation calculator to calculate the values and create the declarations. It shows that a similar matrix transformation is available in the transform property, but the value is more confusing, so I just used the rotate transformation for transform capable browsers. So for IE I must go to the calculator for every degree value of rotation I want to have. Somewhat of a pain, but at least it works.

The site I built is for Amy’s Shoes. The new version has not yet gone live, but I’ll link to it once it has [We no longer run this site]. The design utilized a lot of rotation, with many different elements rotated in different orientations. It also needed to be able to handle some dynamic and AJAXed content. I ran into a number of issues while building the site that are worth mentioning.

Continue reading post "CSS3: Rotation"

PHP: Outputting Lists in Arbitrary Number of Columns

For lists of narrow pieces of content, it can make sense to put them in multiple columns to better use available space. For things like image galleries (a list of images), where it tends to be easier to read from right to left, or when order is irrelevant, it is easy to turn a regular list into columns (like a grid in the case of the images) by simply making each item a fixed width and height and then floating the items left. This works fine back to IE6 and remains fully semantic and accessible as one list.

Text lists tend to be easier to read top to bottom though, so when they are in alphabetical or some other important order, it is generally better to order them top to bottom in each column. I haven’t delved into the CSS3 multi-column layout abilities yet, as that is not widely supported (especially no IE). The float item method cannot be made to appear in the proper order while truly keeping the items in proper order in the list for accessibility and semantics, and putting the data in the proper improper order to make that work would be complicated anyway. The only real way I am aware of to currently make the columns be in proper order is to separate the list into a list for each column and then float each column left. This is not ideal semantically and for accessibility, but will still read in the proper order for all users.

Continue reading post "PHP: Outputting Lists in Arbitrary Number of Columns"

Javascript: Objects and Callbacks

I’ve been doing my JavaScript coding directly in objects. Before I had been doing them without objects, then modifying them if I had time, but now that I have experience with JS objects, it is much nicer to do the OO straight off. When making objects that are versatile, allowing multiple instances, it is often necessary to be able to perform different operations for different instances. As an example, you might create a single class to handle auto-suggest type functionality, and want it to do different things when you choose one of its suggestions or cancel for different instances of its use. In JS, you could either create forks in the parent class for each possible behavior and use a test to determine which behavior is appropriate, or you could create a callback on instance instantiation or in a function call. The callback method can be very versatile and clean, allowing you to leave alone the core class and modify the calling class or global call.

Continue reading post "Javascript: Objects and Callbacks"

Piwik and XHTML 5: Document.write and Noscript

I’ve been using Piwik recently for my site analytic purposes. I added it to my “professional” site, which is served as XHTML 5 for anything but IE. On that site, no visits were registering, though awstats showed that there were visitors. As it happens, this is because the javascript “document.write” is not allowed in XHTML. I believe older versions of XHTML still allowed it to be run, but it certainly wasn’t being run on my XHTML 5 site. Firefox showed an error in the console. This is mentioned on the WHATWG’s page about the differences between HTML5 and XHTML5.

The Piwik community doesn’t seem to have much mention of this, other than one mailing list thread. I modified the script to something similar to the one in that thread, like this:

Continue reading post "Piwik and XHTML 5: Document.write and Noscript"

CSS: IE Shadows and Rounded Corners With HTC

[Update Synopsis] I’ve improved color support, now working for hex, rgb, and rgba at the beginning or end, re-added Nick’s text-shadow support while giving it the same color support as box-shadow, and added an -ms- prefix to target IE for these properties with. I’ve made a simple example page and you can find the file for download in this Google Groups thread. [/Update]

At Cogneato we use a lot of drop-shadows on elements in our designs, and a number of sites use rounded corners as well. In the past, images had to be used for shadows and rounded corners, using a variety of techniques and often adding to page weight and requiring new images be made for site changes. But CSS 2 and 3 introduced properties text-shadow, box-shadow, and border-radius to handle these display niceties without images. These have slowly gained support among browsers, and now, with vendor specific versions, are supported by the most used non-IE browsers. But IE still offers no support for them up to version 8.

HTC’s (basically javascript that can be attached to CSS selectors in IE) have been used to handle a number of IE issues, and Remiz Rahnas created one to support these CSS properties. It has been updated by Nick Fetchak and moved to Google Code. It allows you to add behavior: url('ie-css3.htc'); to any elements with those properties and the properties are automatically applied in IE. It works rather well, though it does still have some issues. For instance, on sites with fading and other animations like the one I started using this on at Cogneato, the shadows don’t fade or move with the rest of the content.

Another issue I had with the script is its handling of the color attributes of the box-shadow property. If you place the color attribute before the unit declarations like I do (ie box-shadow: #123456 5px 5px 5px;), the htc doesn’t work at all. This was easy to change in the htc to get working. It uses regex, so I just removed the ^ character, which denotes the beginning of a string, so the regex could be matched anywhere in the property.

It also happens that the htc doesn’t support color for shadows.

Continue reading post "CSS: IE Shadows and Rounded Corners With HTC"

WordPress: My First Plugin

I made my first WordPress plugin today. It’s very simple and for my own site only: It adds the script bits for the Piwik analytics of my personal blog. It showed me just how easy it is to create a plugin in WordPress. Normally, for clients, I’d just add additional functionality in the “functions.php” file, but for my personal site I’m using the new default theme for WordPress 3.0 (in part out of laziness and in part to try out some of the new features it introduced). I decided rather than modify the theme at all I’d create a plugin, and was happy with how easily and well it worked.

Creating a simple plugin involves creating a PHP file in the ‘plugins’ folder (in ‘wp-content’). It can be named anything, and could also go inside of a folder if multiple files are needed. The plugin file starts with a snippet like the following:

Continue reading post "WordPress: My First Plugin"