Toby's Log page 103

The Case for DOM Element Insertion With CSS

CSS provides the “content” property for inserting content into documents, usually before or after elements. This can be bad if the content inserted is not strictly for presentational purposes, but when it is, it can be a very useful tool for changing a sites appearance with only CSS.

The property can be used to insert strings, images, even counters. Unfortunately, DOM elements cannot be inserted. Why would you want to insert DOM elements? Doesn’t that go against the separation of content and presentation even further than the “content” property already allowed?

Ideally, in marking up a document, one should not need to consider presentation at all, only the proper elements to stick a given block of content into. The CSS would be created separately and form those elements into any appearance desired. There are a lot of reasons this can’t currently be done, including sort order and hierarchy. Another is the limit of what is available to be styled in the HTML document.

Continue reading post "The Case for DOM Element Insertion With CSS"

Officially Done With School

Finally, after two months, I’ve got real word from Tri-C about my graduation. They sent me a congratulation letter and transcript. The letter verifies that I have completed my degree. It also explains that, indeed, they have just one ceremony in May. I will not receive my actual diploma until June, but I’ve got this letter until then. The transcript finally tells me my GPA, which is 3.93. I had been listing it as 3.8, the last verified number I had.

What can I do with my two degrees? Hopefully something that involves monetary compensation. Hopefully at least as much as I made as a line cook.


Canine: WordPress Custom Searches

The WordPress search by default looks through the title and content of all available posts and pages for given query words. But sometimes you might want to only search a certain category or search custom fields or some other criteria. On the Canine Lifeline site, we have a dog section where we want to be able to list dogs based on a number of parameters, such as age, gender, adoption status, et cetera. We are currently storing dogs as posts in a particular category, and using Magic Fields to add custom fields for various aspects of each dog.

WordPress sends search queries as GET requests from its search form. The “s” variable contains the search query, but others are allowed. In fact, if you’re familiar with the “query_posts” function, many of the parameters for that are available, and the rest can be enabled, because the search is basically just a regular WordPress query with parameters appended from the GET variables.

Continue reading post "Canine: WordPress Custom Searches"

Samba: Another Freelance Project

Yay! I’ve got another freelance project now, and this one I’ll actually get paid for. It won’t be much pay, I gave them a very low price, but it sounds like I will get paid more from this job in the future: They want me to be their go-to guy for updating the site and new features. They will probably have me do things like update dates and add images, so it may be like an hour a month or something, not a lot, but something.

So finally, the project is for Samba Soccer Club, a small Cleveland youth soccer club. I got the lead from Ronda Leffel, the coordinator of the eBusiness program I was in at Tri-C. I met with them Saturday at Baker’s Square to talk the project over.

They had a site at one point, but let that lapse, and now want a completely new site, from scratch. They still have the URL, so they will just have to get a host and transfer it, or however that works (I’ve never done it yet). I’m going to have to do a bit of research on hosts for them, but I might suggest they just let me manage their site on my hosting account. I’ve not done this before, but it sounds like Dreamhost‘s version of reselling is just letting us create users for our clients and bill them ourselves. They shouldn’t have too much traffic, so this should work fine.

Continue reading post "Samba: Another Freelance Project"

Lynda.com: Building an Online Shopping Cart

I’ve completed another Lynda.com certificate, my first since starting my solo lynda account. This one was titled Building an Online Shopping Cart. I don’t really have experience with eCommerce yet. I worked with the forms and some of the database information at my RPM internship, but the actual processing was already built and out of site, and all I was doing was modifications to something that existed.

The course had a fair amount of good information for doing eCommerce. It did kinda focus on Cartweaver a lot, which is unfortunate considering that I don’t do Coldfusion and don’t really have a desire to. The basic concepts of that could be applied to any shopping cart application though. It also didn’t go into enough detail for me about the specifics of working with gateways/processors or, to a lesser extent, SSL certificate companies. I will definitely have to actually do one to truly understand how to do it and what options there are.

Anyway, I think knowing this could easily help in getting a job or maybe a freelance project. Then I’d get some actual experience which will really help getting more.


New Theme Again

It wasn’t long with that last theme. It had some undesirable issues, such as the cut off code blocks, no page tabs, and a few general appearance things. I had looked at this Monochrome theme before and skipped over it because it lacked differentiation for “code” blocks. However, I’ve discovered that it does put any “pre” blocks into boxes, and they have overflow set so that any cut off width can be scrolled to. So now I’ll just have to go back and put everything in “pre” blocks, and it should be much more readable.

The theme is very clean and simple and almost monochromatic, fitting better with the current theme on my own site. I like how post meta information is set to the side in such a way that makes it more readable as well as the post. I don’t like the dates on pages, but I’ll live with that. There is a fair amount of “white” space, making things more readable, comfortable, airy.

I would like it to have a flexible width, so that my code blocks don’t have to be so scrunched if they don’t need to be. It lacks header differentiation, but it doesn’t seem to matter as much since the headers stand out less in general and the break in meta information differentiates posts. It uses a fair amount of medium-gray on semi-dark gray, which does not pass WCAG luminosity ratio requirements and thus can be hard to read: I’ll live with that for the other benefits I’m getting.


PHP Functions: Array as Argument

A while back, I wrote about using the JSONesque literal value parameters in Javascript, like jQuery does. This allows arguments to be passed: with names, in no particular order, all being optional. I set it up so that multiple arguments could be used as well, allowing for existing functions to still work or people who prefer that syntax to have it. I will now write about something similar for PHP.

In PHP, it is not quite as elegant, but almost. An array with key-value pairs is passed as the single argument for named argument mode. So you could call like this:

testFunction(array("arg1"=>"value1","arg3"=>"value3","argCallback"=>"testCallback"));

or with regular arguments:

testFunction("value1",null,"value3","testCallback");
Continue reading post "PHP Functions: Array as Argument"

Awstats

I am using Awstats for my site statistics on both my home server and my dreamhost host. Dreamhost provides statistics with Analog automatically installed, but I prefer Awstats. Awstats is very good at accounting for robots and has a nicer interface. It is also more configurable since I have access to the full configuration files.

I used the following method to use one install of Awstats for the multiple sites I have hosted on each server. I use SSH. If you don’t have that available, you can modify the instructions to work with FTP. The symbolic link (ln -s) bits would have to be modified. You’d simply put the actual configuration files in the cgi-bin directory (the conf directory was merely a convenience for upgrades) and probably put the actual “wwwroot” directory in the proper location on the site.

These are just my setup notes, so apologies if they are cryptic:

Continue reading post "Awstats"

Google finance adds split handling

Looks like it’s been a good while since I’ve posted on this blog. My “professional” blog, which gets much more traffic, has been getting my focus, and I’m still not sure what will be happening with this blog.

Anyway, on with the post.  I use Google Finance for my everyday checks on my stock portfolio and the market in general.  I check for prices and news.  It gives me a basic idea of my returns for each stock and for my overall portfolio, though it doesn’t seem to match perfectly with my tracking in Quicken.

A while back they began tracking dividend payouts.  They are not entirely accurate, which is probably why the numbers are off.  They also are not applied to the returns of individual stocks, only the whole portfolio.  Since Quicken can show me per-stock returns with dividends, this provides a nice comparison between market returns and overall returns.

So just today I looked at my portfolio after having not payed attention to it for several days or so, and suddenly my returns were way up (from around 60% overall to 80%).  I was somewhat excited for a second, but confused because the overall market had not jumped that much, and as I looked through prices, none seemed that different from where they were.

Continue reading post "Google finance adds split handling"

WordPress.com: Webmaster Tools and Site Explorer

I’ve been using Google’s Webmaster Tools and more recently Yahoo’s Site Explorer for my other sites.  They allow me to see crawl errors, keywords and some query ranking info, crawl statistics, and some other search engine related info as well as set some settings for how these engines handle my sites.

Because of the way these sites validate ownership of submitted sites (an uploaded file or a meta tag), I didn’t think I’d be able to use them with WordPress.com.  However, with a little searching, I found this page, which says how to do it.  In fact, had I payed more attention when exploring the admin section of my account, I might have noticed that the capability is built into the “Tools” page.

You just submit the URL like for other sites, then choose to validate with the meta tag.  Copy the meta tag and paste it into a specified field in that “Tools” page.  “Save Changes” and then press the validate button on Google or Yahoo.

This worked instantly on Google.  For some reason, Yahoo is just saying “Failed”.  Since it says it may take 24 hours to validate, I guess I’ll have to wait.  You’d figure a message other than failed would be used to say that it hasn’t been validated yet, but I’ve looked at the source of the page and verified the meta tag was there.

[Update 1/24/10] Finally Yahoo has validated by retrying. I had done this a few times spaced out after the initial setup, but it had just failed. I’m not sure why it finally worked. [update]


</toby>