.comment-link {margin-left:.6em;}

Creative Web Development - CSS, XHTML, Javascript and RTML for Yahoo Store

Wednesday, January 25, 2006

RTML Ship-weight as a sequence, removing parenthesis

Another post on the forums about the ship-weight variable, and why TEXT @ship-weight will output something like this: (1.0)

Ship weight, for whatever reason, is actually a sequence (in general, if something outputs parens, it's a sequence - try TEXT @contents or TEXT @price). I think they were going to build in a feature where, similar to prices, you could have different weights for bulk packages? I'm not sure - maybe it even works. Anyway, the PAT-SUBST command (which uses Regular Expressions) works perfectly; another means to achieve the same end is using ELEMENT:
TEXT ELEMENT position 0
             sequence @ship-weight
Nothing too fancy, but I was sick yesterday and had to take a half day and I'm still not feeling up to speed - January is the worst!

Sunday, January 22, 2006

Adding custom properties in RTML; Adding a JavaScript onsubmit handler to a FORM

Someone on the forums today needed to add a Google Urchin (Analytics) onsubmit handler to their FORM command in RTML. I'm not sure if my answer solved their problem, but it leads to today's post, "Adding custom properties in RTML".

RTML used to be limited, in that whatever the Edit screen showed was what you had. For example, the TABLE operator has width, but not height. FORM only takes an action. And so on...until the latest RTML update. When I was out visiting Yahoo a while back, I was working with their RTML developer and he had this neat "Add" command on his Edit screen, where he could add custom properties with ease to any operator. My jaw dropped...I saw a piece of heaven! I told him how much this would help development and reduce hacks (see below) to the system, and he looked into it...a few weeks later, it was public. I'm just ecstatic about that.

The hack mentioned above went like this: if you had a command, say TABLE-CELL, and you wanted to add a class parameter to the TD tag, you had to trick the string to combine two parameters in one. What used to look like this:

TABLE-CELL align "center"
<td align="center">

now had to look like this

TABLE-CELL align "center\" class=\"someclass"
<td align="center" class="someclass">

The underlined quotes were created with the \" in the string, while the outer two were created by the TABLE-CELL operator.

Well, that's a thing of the past, since you can now add any parameter you want to any RTML command. Here is the example I typed up tonight using the FORM operator and the onsubmit handler.

  1. In your RTML, if you go to the ordering template...usually STORENAME-order, however this may be modified.
  2. Find the FORM command in RTML, usually it says FORM ORDER id.
  3. Click the FORM command in the RTML.
  4. Click Edit at the top of the screen.
  5. In the bottom box, type onsubmit and click Add (do not press Enter!)
  6. On the next page, where it says onsubmit, put this "javascript:__utmLinkPost(this)" (include quotes)
  7. Update the screen and give it a test


Original
<form method=post action="...wg-order?yhst-XXXXXXXXXXXXXX+itemid">

Modified
<form method=post action="...?yhst-XXXXXXXXXXXXXX+itemid" onSubmit="javascript:__utmLinkPost(this)">

Also, Pirates still exist. Garrr!

Saturday, January 21, 2006

Default search input text, and using CSS to clean up your search box

Quick one tonight, a nice simple script so your search box is a little more informative. By using the following code your search input will have the text "Enter Keywords", and it will disappear when the user clicks in the box. If they don't enter anything, it will reappear, otherwise it will let their entered text remain.

Is it necessary? Nope. But you might as well make it as simple as possible for those who are newer to the web - especially considering how little code it actually is.

<input 
 type="text" 
 name="query" 
 class="search" 
 value="Enter Keywords!" 
 onfocus="if(this.value=='Enter Keywords!') 
             this.value='';" 
 onblur="if(this.value=='') 
            this.value='Enter Keywords!';" />


And you can add the following CSS code to make it a little cleaner looking.

.search {
    border: 1px inset #000080;
    width: 150px;
    font: normal 11px verdana;
    padding: 1px;
    height: 18px;
}


Friday, January 20, 2006

Hard Drive Temperature Monitoring with DTemp and SpinRite

Well, today's post is short, because tonight was our bowling league, then we had a fundraiser for the local CYC. I shot a 224 (surrounded by some crap 160+'s) in the league, and then threw 8 in a row during the fundraiser before getting two stupid splits to end the game near 249 or so. Blah.

Anyway, like I mentioned earlier I set up my second PC, and am cleaning up Windows XP step by step for a long detailed blog post. However my initial concern is, "is this really a safe drive?" It whirs a lot when it's just sitting idle, so that scares me - 120gb is very tempting, and I don't want to fill it with files just to have it fail.

First, I installed a temperature monitor program. It's wonderfully small and it runs in the systray, showing a constant temp right there. Get it here: DTemp temperature monitoring program. This is important because I have a LOT of electronics running in a small upstairs bedroom with the door shut 90% of the time. Also, the PC is under a desk, and in an effort to get it hooked up faster I haven't cleaned the 2 years of dust that's collected inside yet (that's for this weekend). So, it's much likely to run hotter than a normal machine.

Then, I installed SpinRite, a general hard disk monitoring utility which tells you of failures, etc. From their website:
SpinRite now brings its legendary data recovery and drive maintenance magic to the latest file systems, operating systems, and hard drives. It runs MUCH faster than ever before, can help maintain all of your drives in tip top shape, can warn of impending disaster, and wrestle data from dying and nearly dead drives . . . before it's too late.

Sounds perfect - and so far so good. Drive seems OK, though I'm going to monitor it daily for a while, so I'll post if I have any more information on SpinRite. I read on a login-only forum the following user comment:
Just to comment on this. I had 2 x 200 GB drives spanned to appear as one 400 GB drive when one of them died. Thereby loosing ALL 400 GB of data. I used this app and ran it on the drive - it did a sector by sector analysis / repair of the HD. Took a LONG time because it was a spanned volume, but it DID recover 99% of the data. All but one 100 MB folder was recoverable. AND the disk is still running fine today over 5 months later! Totally recomended !!!

That's good enough confirmation for me to give it a solid shot! Also, from the same site (grc.com) I also recommend running the Shields Up utility, which is web based, and checks for any vulnerabilites your PC might have as far as allowing traffic to and from your PC. I'll post more on that later.

So, that's it for now, some hard drive utilities for your installing pleasure. I also read an interesting Digg post about freezing your hard drive to recover data, but I'll have to post about that later...gotta be prepared for a Friday at work by actually getting some sleep tonight!

Thursday, January 19, 2006

Quickly adding many posts in Movable Type - without import/export

Back on the 10th I posted about Movable Type, which I've been using a lot more as I prepare to move my blog over after the redesign is done (also, I've just finished setting up our work blog on it). In the ongoing debate between Movable Type and Wordpress and which is better, I really think it depends what you need. I started with Movable Type, (after Blogger of course) since it was the first one Yahoo released with their hosting package. I already know the language, like the clean interface and the easy access to the php, and how easily it interfaced it with phpMyAdmin, also available on Yahoo Hosting with our Yahoo Store. Whatever, that's not the point of this post.

One thing I don't like about Movable Type is how when creating a new post, if you set the status to "Published", it automatically publishes the post when you click Save. When I have 15 HTML files I'm ready to paste in and publish in bulk, I don't want to have to keep waiting for each to publish. At first I was Ctrl+clicking in Firefox on the New Entry link, so I would open 15 new tabs. Then I'd go to the first one, paste, publish. As it published, go and get the second HTML, and by the time I get back to the first tab it's done, so I close it and paste the second post. If there's one thing I learned from visiting the Edison estate (besides the fact that Banyan trees are wonderful and gorgeous) it's that the assembly line concept is solid. Repetition leads to increased efficiency in most cases.

So sure, this is more efficient than waiting each time...but if there's internet lag I'm still waiting a while (waiting just 1 second for my computer to keep up with my thought process aggravates me enough)...and having to even do this is just plain annoying. I can only imagine how long it will take when our work blog is huge. Well, there is a better way, which is awesome.

Basically, when you make new posts you set them to Unpublished instead of Published. Instead of publishing each it will save them, and mark them in your Entries list with a pencil icon. When you're done entering the 15 posts, go to the Entries page and click Power Editing Mode. Simply change all the Unpublished dropdowns to Published, and Save and Rebuild.

Wednesday, January 18, 2006

Mozilla Firefox 1.5 extension replaces Console; Javascript errors no longer cluttered with CSS!

So, I upgraded to Firefox 1.5 not knowing that you couldn't easily install it side-by-side with 1.0. Most things work ok, though there are some annoyances - but there's one HUGE annoyance, which is how they changed the way page errors and warnings are handled. It used to show the JS errors in the Console window, which made it pretty easy to skim. With 1.5 they decided to include CSS errors as well, making the list extremely long and annoying.

Well, today Greg at work found a great extension to fix it, called Console 2 (squared). It allows you to filter the results into JS/CSS/XML, choosing any combination of the three. I honestly don't know what I'd do without it. Now if only they would make the classes in the DOM Inspector copyable so I didn't have to keep retyping them when I'm debugging a page...

ConsoleĀ² on Mozillazine Forums

Friday, January 13, 2006

How to Disable Windows XP Security Center Alerts

Sick again today, worst day of the week (hopefully that means it's OVER!). Had to use a sick day at work, which I hate doing so early in the year. Oh well, what can you do? I know, get rid of one of a million Windows XP annoyances.

The Windows XP Security Center is sloppy and it's much safer to use 3rd party programs for the same tasks. For a firewall, I recommend ZoneAlarm Pro, though I have my router set up pretty strict, and a lot of antivirus/antispyware installed, so I don't actually use a PC firewall. McAfee's firewall is pretty strong, too - I use that at work.

Anyway, Windows doesn't always detect your firewall, and thus tends to give you a "your computer is insecure" warning in your systray. I HATE things cluttering up my cherished systray. So, here's how to kill that alert.

To turn off Security Center alerts
  1. Click Start and then click Control Panel.
  2. Double-click Security Center.
  3. In the Security Center, under Resources, click Change the way Security Center alerts me.
  4. In the Alert Settings dialog box, clear the Firewall, Automatic Updates, or Virus Protection check boxes, and then click OK.
From: Microsoft.com

Thursday, January 12, 2006

Drawings of a PSP by a 9 year old

Well, I didn't have time to post last night, I'm still sick and pretty much slept. So I'm just going to post something quick...since my blog redesign (which is finally past the conceptual stages!) will include a section just for fun links, such as those I find on boingboing, fark, slashdot, digg, etc.

Anyway today's is about some kid who REALLY wants a PSP, so much that he clips pictures of them, draws them to scale, and sells the pics to his friends for 50 cents (I remember when I used to run a Slim Jim ring in 5th grade before I got busted - I bought them wholesale at my dad's work, and sold them for a quarter to people at school - or a dollar if I didn't like you). Anyway good for him, kind of - obsession is never good, but having a goal and working towards it really is. Hopefully he can find a balance (or already has).

Anyway, I really agree with the last quote on the boingboing page: I think it's a great idea to get the kid a PSP, but I also wonder if he isn't having more fun dreaming and drawing than he would playing the games? Amen.

9 year old craves PSP

Wednesday, January 11, 2006

Remember Roxi and Sign the Petition

To sum up her story, she was a 15 yr old deaf german shepherd mix who wandered into the neighbor's yard during a Memorial Day BBQ and was kicked so hard in the abdomen by a 40 yr old man that she later died from her injuries in another neighbor's yard under a tree. Frank Aquino will be sentenced for the crime of animal cruelty on January 12, 2006, so get your signatures in fast, just in case they actually matter. And go to the third link and email the Justice as well.

Remember Roxi
Sign the Petition
How to Help

Wilkes-Barre Companies Lead Way As Computer Jobs Take Off In Region




Times Leader Staff Photo/Don Carey

There's been a lot of press about Solid Cactus lately - we were on the news last week (I was interviewed and on TV, but missed the 5pm broadcast). This week we were featured on the Times Leader business front page (I'm told), luckily for me it was reprinted online: Times Leader - Silicon Wyoming Valley?. One of my favorite parts is the bottom of the article, "If their plans hold up, the three companies interviewed for this article will add nearly 200 IT jobs this year alone." It's nice to be part of something that helps the community, even if it's only in a passive way.

I'm still feeling pretty sick and I'm in the process of making some Javascript training documents, so that's it for tonight.

Tuesday, January 10, 2006

Scary - Remote Control Device 'Controls' Humans

This is actually somewhat old news (2.5 months or so), but it's interesting and scary nonetheless (also I just noticed it's been a saved draft since 10/27).

Remote Control Device 'Controls' Humans - Yahoo! News

Plus, I want to keep up with somewhat daily content, even on nights I'm not feeling well. I slept a lot of the night after feeling pretty sick, and then woke up to work on some training material for CSS and Javascript for our team. Of course, a day or two after posting about being healthy, I start to feel sick - that's ok, I'm going to assume it's my body realigning itself, and ride it out.

Someone very close to me had a very spiritual/religious experience this weekend. It was a truly beautiful thing to see - more people in this society need to find faith in something, and the most important part is that it does not matter what that is, as long as it encourages curiosity, discovery, growth and most importantly, promotes positive interaction between people. For some, like Catholics, it's the Lord; for Buddhists, it's the Self; for Islamics it's Allah. Some churches stick with strict Latin mass; other churches (like the one I went to on Sunday) have a live band with guitar, singing, and people dancing everywhere; Buddhists quietly meditate on their day and their problems. Whatever it is and however you do it, it should an important part of everyone's life to at least some degree. Only through attempting to discover unknown truths about these mysteries can one truly grow as a person.

The greatest part of the experience, for me, was hearing a piece of literature (Catholic) read to me, the "thought" for the day, so to speak. It (as well as the day's sermon) was about spreading what you've found to others - but not with the preachy "Have you accepted Jesus" talk that makes people uncomfortable - instead, through compassion and loving for others, and it specifically used the term "loving kindness". I know this term very well as a Buddhist term, so to see it touted as a Catholic teaching strengthened my faith in my belief that no religion can truly be right or wrong, the only important thing is the morals it teaches. (honestly, does anyone think we're going to get an answer in this lifetime? what's all the debating for ... let everyone choose for themselves. we'll all find out if we're right or wrong when we're dead ... or maybe we won't ... woah, deep)

And on that note, back to bed for me.

Quick CSS code for Movable Type Power Editing Mode

In Movable Type, there's a Power Editing mode that allows you to bulk-edit the following: Publish State, Name, Author, Category, and Date. It's a bit clunky (like most web forms tend to be), because it's made to be accessable...but I like small fonts. So, here's the code I use in my Firefox sidebar (Ctrl+Shift+E if you have the Web Developer's Toolbar installed) that allows it to fit perfectly in my 1280x1024 monitor with the sidebar as small as it can be.

select {font-size: 10px;}
#list-entry table.compact tr td + td input {font-size: 10px; width: 525px;}
#list-entry table.compact tr td + td + td input {font-size: 10px; width: 110px;}


Friday, January 06, 2006

Is Splenda (or any artificial sweetener) safe? Living healthy in 2006...

This year, I'm trying to return to the healthy eater I used to be. Over the past few years (thanks to habits I easily picked up in college) I've eaten a lot of fast food, drank a lot of soda, and in general not taken care of my body. Besides the fact that I've gone from a basketball playing kid to a computer programming adult, like many Americans the convenience of Arby's, Grotto's Pizza, and Chinese Food delivery has beaten out my desire to go food shopping more often than I'd like to admit. Granted, I did give up Mountain Dew (almost cold turkey - from about 8 cups a day in November to 5 or 6 total all of last month) - but I still ingest a lot of random crap, especially in place of meals (the big problem).

Sure, I love healthy food - when they're there I eat my vegetables, especially leafy greens like spinach and collards (with hot sauce, of course); I like to go out for sushi; most importantly, I truly enjoy cooking and eating a healthy, home-cooked meal. But I just don't eat it as much as I should.

So, with the disappearence of a significant amount of sugar, caffeine [1], and carbonation that used to dance all day in my stomach, my insides took some time to balance, obviously. I now drink tea, Snapple and sometimes Sierra Mist, which is caffeine free, at work. It's amazing what an effect something as simple as Mountain Dew can do to a person's insides. I can seriously say I feel hundreds of times better with it out of my system, in many aspects. As everyone knows Mountain Dew is especially loaded with caffeine, having 10mg more caffeine in a 20oz bottle than Coke.

Check out school cafeterias: Kids are bypassing milk for cans of Coke (45 milligrams), Pepsi (37), Mountain Dew (55) and Sunkist (40), bought at school pop machines or served at the fast-food franchises now at 13 percent of the nation's schools. Glance at family shopping carts: Sodas are the best-selling product at grocery stores--$11.7 billion annually in sales. And four of the five most popular soft drinks in the United States are caffeinated, with No. 4 Sprite the sole exception. The top drinkers, teen boys, pop open an average of three sodas a day. [1]


Anyway, my family is prone to diabetes, so I feel much healthier and safer overall. I feel much less "randomly hostile", and my ups and downs have decreased significantly. I wake up with a "hangover head" (that heavy, need more sleep feeling you get after a great night out...or a night programming for 10 hours) about twice a month (not including nights I drink of course), compared to 3-4 workdays a week when I was doin the Dew. I have never been a morning person, and I stay up stupid late, so I always attributed those side effects to my terrible sleep habits. But, with the Dew gone, I still have the terrible sleep habits - but not the morning stomach and headaches I used to. So with Dew gone, it's time to phase out something else unhealthy that regularly sneaks its way into my life. Enter artificial sweeteners.

The chemical process to make sucralose alters the chemical composition of the sugar so much that it is somehow converted to a fructo-galactose molecule. This type of sugar molecule does not occur in nature and therefore your body does not possess the ability to properly metabolize it. As a result of this "unique" biochemical make-up, McNeil Nutritionals makes it's claim that Splenda is not digested or metabolized by the body, making it have zero calories.

It is not that Splenda is naturally zero calories. If your body had the capacity to metabolize it then it would no longer has (sic) zero calories. [6]


Now, with all the crazy news about Aspartame possibly (probably?) being extremely toxic [3], and now Splenda being under the knife [4-6], I think I'm going to drop artificial sweeteners from my diet altogether. I've already completely given up Coffeemate, whose first ingredient after water is "Corn Syrup Solids" and contains no milk, but instead Sodium Caseinate (A Milk Derivative, not a source of Lactose). I won't even go into details on what that stuff did to my stomach (brewed tea was my replacement for Dew at work, and the Coffeemate made me feel almost as bad as the Dew did, in much shorter order). Let's just say from now on it's milk, or nothing.

So goodbye, Mountain Dew - I'll see you again occasionally, I'm sure. And don't let the door hit you on the way out, artificial sweeteners. You're just no good for me - or anybody.

Resources

[1] Caffeine and Children
[2] Diabetes.org
[3] Aspartame on Wikipedia (see section 3.1 and 4)
[4] The Hidden Chemicals In Splenda
[5] The Secret Dangers of Splenda (Sucralose)
[6] 12 Questions You Need to Have Answered Before You Eat Splenda

The IVR (interactive voice response) Cheat Sheet by Paul English

If there's one thing about technology that drives me insane, it's the fact that companies think that it can replace human interaction. I develop e-commerce stores, so you'd think my stance is automate, automate, automate. In fact, that's kind of the entire point of this blog. But...there's a time for automation, and then there's a time for old-school human conversation. When I'm on a short lunch break or between meetings, and I have to call a company - especially if it's about a mistake they made - I don't want to have to sit and navigate through screen after screen, listening to some slow bot drone on and on about options that I already know don't affect my situation.

My general response is to say "operator", and if that doesn't work, I press 0. If that doesn't work, I start randomly pressing *, # and 0 in rapid succession. This almost always gets me to a human - otherwise I try to go straight to sales, because they tend to be waiting to talk to me.

Well, screw that from now on. Paul English has saved us all an unbelievable amount of time and frustration with his wonderful compliation of ways to get around interactive menus. The page is logically organized and has an amazing number of companies. Make sure when you go to his site, you read the info page at the top, there is a lot of good information there. Thanks for the link, mom!

IVRs ("interactive voice response") are the annoying computers that answer phones. They can sometimes be useful (check flight status etc), but consumers should be able to decide when they want to speak with a human, simply by pressing 0.

The IVR Cheat Sheet by Paul English

Thursday, January 05, 2006

Yahoo Store - Deleting one item deletes multiple items?

On the Yahoo Store forums today, someone asked why, when they deleted one item from their site, it removed other items as well (assuming I read their question correctly!) So, since I need to get to sleep before work, that's the topic of today's post - why does my store delete multiple items when I try to delete one?

The reason is because when you delete a page, all the Contents of that page are deleted.

This can come in handy if you want to bulk-delete items - create a temporary page, paste a ton of ids into the Contents, and then delete that temporary page.

But, it can also have its downsides - delete the "Dog Sale" section, and any items from "Dog Sale" that are also in "Dog Treats" or "Dog Toys" are deleted as well.

Ultimately, you should add a custom variable called "cross-sell" (for example) to your item Type (do this on the Types page in the Editor - you can't add type "ids" to Catalog Manager) and have your RTML templates use that variable instead. Because this variable is type "ids" and not "objects", they won't have the parent-child relationship, and won't delete all the other items on the page like the Contents variable does.

So, in order to safely delete a page, follow these steps:
  1. Make sure you are in Advanced mode in your editor (if you see two lines of yellow buttons on the home page, you are. If not, click the red arrow to the far right of them and you will be).
  2. Navigate to the item you want to delete.
  3. Click Edit
  4. Scroll to the Contents field.
  5. Select everything and delete it (use Ctrl+X so you have it on your clipboard in case you change your mind).
  6. Update your changes
  7. Press Delete in the yellow button bar.
Now that item, and only that item, is deleted. Good stuff.

Wednesday, January 04, 2006

The Top 10 Free Time Wasting Sites on the Net

I use Yahoo Widgets to stay on top of a lot of RSS feeds (I'll post about both widgets and my favorite rss feeds later - Slashdot, Digg, A List Apart, and Snopes to name a few), and will be posting them into a new category (which I have yet to create) full of interesting links.

The first interesting link to kick in the new year will be one that everyone who works on a computer needs - the top 10 ways to waste your time on the net. Is this comprehensive? (flips hair) Pshaw! But, it's fun nonetheless. So...have at at. (warning...this is on About.com, so prepare yourself for a popup or two)

The Top 10 Free Time Wasting Sites on the Net [via Digg]

Monday, January 02, 2006

New Year, and Cheat Sheet Roundup

Happy New Year, everybody.

What a year. I'm not going to get into all that sappy memories mumbo jumbo. Let's just say it was a year, it's over, and leave it at that. What's the new year got in store? Who knows...but it should be an interesting one. For me...a lot of woodworking and gardening, to say the least.

Now that my hell season at work is over and I'm done working 12+ hour days for a while, I'll be able to get back into the swing of things and start posting every day or two as I had originally planned (until I realized it was September, the beginning of every Yahoo Store programmer's worst nightmare).

So, I'm back in full force, and for the 3 loyals readers of my blog (thanks, Dad!) plan to see more updates (and a full blog redesign and restructuring) in January. I'm also considering moving this blog to Movable Type, so I can actually dig into the source code and customize more than just the design.

And for those of you who actually come here for information, I can't just post drivel, so here's a link to a page I found on PeteFreitag.com that I found most useful - some of these are just so convenient, you can't NOT print them and put them on your desk at work.

Cheat Sheet Roundup - Over 30 Cheatsheets for developers [petefreitag.com]

Google
 
nunzi.blogspot.com    Web