Saturday 16 June 2018

Going through the new opiod system in 2018. Will be updated as we go through.

This is a story of unnecessary harm to individuals.

My common law husband has pinched nerves that, when the pain is unmanaged, reduce him to living in the corner of the couch except to go to the washroom. He went through the old system.

It took months of trying every drug before opiods, during which time scary things happened like black pee, pain getting worse, joints not involved in the injury freezing and more. There were a few times I thought that the non-opiod drugs would land him in hospital for good. Then we finally reach the pain clinic (by this time Mark has gone through all of the drugs that he could so he is on an opiod that is working). The pain clinic does a rushed interview in which they take no notes, do an assessment of his walk and shoulder height, then send a letter to the family doctor stating that the pain is in a completely different region than we told them and they demonstrated in the meeting; clearly getting cases confused since they took no notes. The letter suggested adding anticonvulsants. We did add them, because the family doctor agreed, but our trust in the pain clinic was zero. That helped enough that he could get out of bed with less than an hours self-talk and do the odd bit of moving.

At the same time we're going through the system to gain some more permanent repairs and he has surgery to fuse to vertebrae.

The pain reduces at first, then the insurance company harasses my husband into going to physiotherapy more often. The physio and physician don't suggest this, but my husband does it because he's drug addled and convinced insurance has some sort of right to make medical suggestions. Of course the pain starts to get worse, at first they blame the new swelling on over-activity. When the swelling goes down we face the truth. You see, we knew there was a risk that if the bones didn't heal just right other vertebrae would be in crisis. The other vertebrae showed in the MRI and were identified as potential future issues long ago. Now C7-C8 had joined C6-C7 in their need for immediate attention. The net gain, 2 hours of being awake a day as even pain hidden by opiods is exhausting, being able to drop the anticonvulsant which was causing side effects, and being able to lower the dose of opiods.

A couple months ago he was sent a letter from our family physician. The family physician may no longer be able to prescribe opiods so we need to find a physician to add to the care group just for pain medication. My husband delays and delays more even after I email the College of Physicians and Surgeons to gain the list of approved MDs. Finally he goes in.

This is where I get mad. Think about costs to the taxpayers for all these tests and appointments, and read about my caregiver terrors and husband's pains.

Four appointments are required by the new physician to even talk in a meaningful way to the new MD about pain drugs. Fine, our family physician hasn't had his ability pulled yet. Really annoying looking at the amount of money and time being wasted, as all of these appointments are repeats. Somehow my partner develops horseshoes up his ass and the clinic he chose has most of these physicians in the same building. So, first; is he really taking opiods. Another pee test. Something he's had to do regularly to prove that he is still taking this regulated drug. Yes, yes he is. Second, the usual scans for health and consult with the MD who tells him that he has to run the entire gambit of non-opiods again except this time he has to add in medical marijuana. He advised the doctor that he has had bad reactions to marijuana, even other people smoking in a room when he isn't. Nope, he must try it and in fact MUST try it first (huh? Why would you try something that you know can cause issues first; money grab?). In order to try it he needs to go to another pain clinic type MD. There's one at this office, he goes. The pain clinic decides that my husband is a candidate despite the second warning that my husband has had a bad reaction to marijuana in the past and has high anxiety which is supposed to be a contraindication to marijuana usage. To add insult to injury my husband is advised that he will be forced to pay a $100 fee to have the privilege of carrying a card saying that he can take a drug that is likely to hurt him, payment due before receiving the drug. This now has to go back to the MD that will prescribe for pain and he's totally gung-ho to do this.

What am I going through as a caregiver?
I don't know if I can take the next step. Will I have to take my choice of life partner to the hospital? How will I get him there if he is having an anxiety attack and goes into a fugue state where he thinks that everyone is trying to kill him. I've had to chase after him down the street before. What about all the other drugs that we tried before, why do we have to try them again. How many days will I be kneeling beside his frozen body on the floor wondering, should I go to the hospital this time or will this time too pass safely.

Add to this that the money is running short. The $100 has me considering closing my business for good. If I have to call an ambulance... I have no idea where that money is coming from. I'm already eating less and less to help keep finances up and taking riskier jobs.

This is insanely evil treatment of people. Trying to get my not addicted husband off opiods is insane. Want to know how I know that he isn't addicted? Addiction has a definition. See whether he even comes close to qualifying in my heartfelt comments in each set of square brackets.

The DSM V checklist as quoted in the article, "A Guide to DSM 5 Criteria for Substance Use Disorders", by  Elizabeth Hartney, PhD at https://www.verywellmind.com/dsm-5-criteria-for-substance-use-disorders-21926 states:
  1. Taking the substance in larger amounts or for longer than you're meant to. [has reduced his use since starting and after the first surgery]
  2. Wanting to cut down or stop using the substance but not managing to. [If you want to call the medically confirmed failure of his next vertebrae down meeting this marker, yah, OK. He couldn't continue to cut down because the next vertebra failed. Pretty sure that isn't what they mean here.]
  3. Spending a lot of time getting, using, or recovering from use of the substance. [I get the meds, he often forgets, and he sometimes even forgets a dose only to find himself almost paralyzed by pain within an hour and is stupid enough to wait until the next dose comes around]
  4. Cravings and urges to use the substance. [I would say no, he keeps talking to me about not wanting to become addicted and does stupid things when I'm away like try to take a day off the drugs; which always backfires in pain and never causes him to develop an urge for drugs, just an urge to reduce pain]
  5. Not managing to do what you should at work, home, or school because of substance use. [Not a problem, tries to do more than he should and keeps tiring himself out. Often the pain level is high enough that he should take more drugs, but doesn't]
  6. Continuing to use, even when it causes problems in relationships. [Let me be perfectly clear here, his desire not to use the drugs is causing a problem in our relationship. If there's a fire and he can't get out because he decided to skip a dose... ARGH]
  7. Giving up important social, occupational, or recreational activities because of substance use. [Nope, but has given up to some extent because of pain.]
  8. Using substances again and again, even when it puts you in danger. [No danger detected, being carefully monitored by the MDs, no changes to metabolic function detected.]
  9. Continuing to use, even when you know you have a physical or psychological problem that could have been caused or made worse by the substance. [Again, a problem if he doesn't take it. It's nice to feel human enough to clean yourself, occasionally feed yourself, and be able to move more than four feet. I have seen no signs of anything being made worse by the opiod other than a foggy memory at times.]
  1. Needing more of the substance to get the effect you want (tolerance). [again, he's taking less now than before so, nope. No dosage increase for a long time by now, remember he didn't act on the letter stating we needed to find a new MD for a while. This article doesn't give you dosages and a timeline, but even when the pain started to increase again when the next vertebrae pinched in, he tried to stay at the same dose until we confirmed that the swelling wasn't the problem. So, attempts to increase, zero. Family MD and wife telling him he damned well better increase the dose or diversity of drugs so that he can have some sort of functionality now at 3 since he kept refusing the take more when the first baseline was being set before the first surgery. The MD finally convinced him by showing him how much damage his pain riddled muscles could do by tightening too much.]
  2. Development of withdrawal symptoms, which can be relieved by taking more of the substance. [no shakes. The drug treats pain so yes, if he doesn't take it the pain comes back. However, since he has been stupid enough to do this experiment I can clearly state he has no withdrawal symptoms other than life altering pain. Also, the pain never really goes fully away, it only becomes manageable.]
Well, I hope me documenting the hell out of what we are going through changes someone's mind. I will be emailing this to the college every time that I post - Well, except once, I'm posting the college's update to me.

Here's the gist of the phone call.
The College of Physicians and Surgeons is saying that this extenuating process is not their recommendation. They sent me what they have told MDs to do and I am still re-reading and processing it. First, does Mark, according to the College HAVE TO try marijuana? No. Second, should he have been sent through such extensive re-assessment; perhaps, but they don't require it. They do require assessment of the data in Netcare, they do require an evaluation of whether or not the dosage could be lowered by adding or removing other types of pain management. They do require following some Standards of Practice. He was going to send me a document about this, which was titled "We Care About Patients". One really weird thing... Even if Mark was prescribed marijuana apparently there is no card to carry or licence. The College does register the patient as taking, but the registration is free. So, where's this $100 coming from? I was advised that they can charge $100 for training in how to use the drug, but nothing like a card or registration fee. So, is this just a milk of the system by one MD or do they really believe that they have to do all of this and why?

I would post the email as a snippet, but it has a confidentiality statement on it. I can post a link to the We Care about Patients thing because I found it online - Yay! http://www.cpsa.ca/wp-content/uploads/2017/04/FINAL-Message-to-Albertans-with-Chronic-pain-vertical-4.95x13.58.pdf The quote I find interesting and clearly not what is happening; "It is never appropriate to abandon a patient on long-term opioid therapy, or abruptly cut off or threaten to cut off the patient’s medication." Mark was told he HAS to try other treatments, specifically marijuana, after he identified a contraindication. That sounds like a threat to me. To be clear, we're open to trying other medications, just would like open discussion and choice, not being forced into trying marijuana.

Truly, trying to understand the MDs side of things here. My initial expectation, and it seems the College's expectation was a Netcare review, discussion, and decision to continue with the same treatment or add more treatments in one appointment. At most I expected some lab tests to see if Mark's system was being negatively affected by the drugs. So, why would an MD do so much more? If I knew that many MDs were facing the loss of their opiod prescription ability what would I do? To be honest, check that Netcare already used at least 3 confirmable independent MDs or diagnostic tests and move on to the next patient after assessing stability. At most a single consult - which this MD does using their on-site doctors 'in training' anyway. In the past we've used more than three confirmable sources to document the issue and pain already with pain clinics, X-Rays, MRIs, nerve tests, surgeon, and physiotherapy. However, this other MD must have patients that cause red flags. So, would that be enough for a diligent, and possibly terrified, new doctor taking someone on that might cause red flags on their profile? I would hope so. Apparently our new MD disagrees.

This still leaves me wondering. What can the governing bodies and protective associations be saying about this that is causing such extreme costs? I don't think this ends with the College saying no, we didn't suggest this. Is our new MD just that scared, or are there really other recommendations. I will find out, because this is insane. I don't know if clinic fees have increased. So, I assumed that they have and made some estimated rounded costs of the LAST 4 WEEKS of my husbands care that taxpayers would not otherwise pay based upon two old articles.  https://globalnews.ca/news/2898641/how-much-is-your-doctor-making-what-you-need-to-know-about-canadas-physician-workforce/ https://www.bloomberg.com/news/features/2017-11-06/how-doctors-are-getting-rich-on-urine-tests-for-opioid-patients,
$50 per 'front-line' MD visit. 4 visits so far = $200
(NOTE: This is probably higher, this MD has a neat process set up involving himself, an assistant with unknown title, and an MD completing practicum.)
$60 per 'specialist' visit. 1 visit so far.
$?? for consult with in-office allergist. It was an appoint with Dr. Han and the allergist in the same room.
$20 to unknown (CAD) for the simple cup plus charges for storage and staff and shipping, but they aren't using the simple detecting strip according to the paperwork, so I'll say a generously low $100 lab tests.
$25 the minimum the College had to pay for the nice list of MDs they send to us and the person manning email.
$25 to 50 for the phone call, probably more toward 50, but I'll put down $25.
= about $350 taxpayer cost. with at least 2 more MD appointments coming so, a minimum of $450 in 5 weeks of care.

If we were in the US, would it be getting close to cheaper to buy the drugs off the street? I know the care costs would be higher. Not quite yet, I guess. https://www.researchgate.net/post/What_is_the_predictive_value_of_STREET_PRICES_in_determining_potential_for_misuse_of_substances

Time to update more.
We brought up our concerns again to both the office assistant and MD. The MD didn't really listen. Instead he touted the wonders of marijuana and handed us forms. Mark was willing to try it just to move ahead. So, we filled out the forms which had a ton of grammatical errors as well as spelling errors. I asked Mark not to sign because the form basically made us lie, saying that Mark had tried various previous medications and that they had not worked. That isn't true, the opiod is working fine and Mark shows no signs of addiction and his blood work is terrific (run recently due to his diabetes). Mark pointed out that the wording didn't state that all previous therapies had failed, only that some had. I grumbled. So, we didn't go out to meet with our friends, we ate less, and Mark paid the $100. We asked several times what the next step was and what the future costs were. I was quite concerned that we had to use a mail order pharmacist. Mark wasn't at the time.

After being reassured that the marijuana would arrive in the mail along with some Atavan, which is what the hospital would give to him anyway if he started to have an adverse reaction causing anxiety we left the office thinking that it would be 3 days to delivery and NOTHING else had to happen.

Well, turns out the mail order pharmacist didn't receive enough information. The form was missing our address. Next, the mail order pharmacist charges $90 per fill of prescription and NONE of that is covered by health care. We had specifically asked if there were any more payments to be made. The MD lied to us. Oh... and there is no Atavan being sent.

So, now Mark is finally getting upset. What kind of kickback is going on here? Why is the MD pushing this so hard despite clear concerns? At this time we can't really afford to try to marijuana anyway and we just lost $100 in administration fee that shouldn't be charged. There was no patient education; what information was provided was wrong and the administration fee, you'd think at that price you could at least afford an editor. Clearly no lawyer or editor went over it.

Onto the next problem. We were told that CannTrust 18557942266 would be handling the oil delivery and to expect oil in the mail.

Turns out that there are additional costs and we have to order through CannTrust, which is $90 per bottle plus shipping for each bottle, and each bottle is way less than the amount prescribed for a month - plus the bottles being offered don't match the THC amount prescribed, which was pretty much 0%. Then I do some research and CannTrust isn't even allowed to operate in Alberta. Aurora, at first, had to handle all mail order marijuana for the province. Now there are three companies that can sell, but CannTrust is NOT one of them. That leaves one hell of a conundrum, Mark has signed a piece of paper saying he will exclusively use a company that isn't even allowed to operate in the province. Um, what. Kind of glad we couldn't afford it while I try to figure out what we are supposed to do from here.
Article that lays everything out: https://kushtourism.com/alberta-canada-marijuana-information/
List of distributors allowed in the provinces to start: https://kushtourism.com/canadian-medical-marijuana-producer-directory/ (not only Aurora is in the list https://www.auroramj.com/)
Health Canada list for Alberta, note 7 distributors now, but only three for sale: https://www.canada.ca/en/health-canada/services/drugs-medication/cannabis/licensed-producers/authorized-licensed-producers-medical-purposes.html Aurora - both, Acreage Pharms - both, Sundial Growers - both, Alberta Craft Cannabis Inc. - cultivate only, Aurora 2nd facility - cultivate only, Bloom Cultivation Ltd - cultivate only,  Boaz Pharmaceuticals Inc. - cultivate only.

Now I have to make a call to Health Canada and find out if we are even allowed to order from these blokes, and if not report the clinic. That'll make Mark super-happy as he really doesn't want to rock the boat. However, I'm not going to stand by while Dr. Han does something that could put his patients at risk, even if it is a small legal risk.

Health Canada claims the website doesn't sat that the seller is limited to selling in their province. At least one thing is working here. CannTrust is OK to deal with.

Next trouble? Insurance will not cover any of the costs for the cannabis. There's an application process for CannTrust though. Also, still no word on what is happening with the Atavan.

Guess we have to make another appointment and go back since the MD is not responding to the email address on his business card.

Well, we are now three more appointments into the future. The cannabis has arrived. I was reading the Alberta Health magazine and it specifically says the cannabis, opioids, and alcohol mixed together are a bad thing. Weird that they would print that and the MD would prescribe exactly that. The Alberta College of Physicians has been helpful. However, Dr. Han is whom he is and hasn't been. This last visit to the MD was to find out why we still don't have the Atavan Mark was supposed to have in case of a negative reaction to the cannabis. Turns out that if Dr. Han had done what he said he would the other MD in the same building thinks things would have gotten much worse as far as psychotic break instead of better.

What a mess. Everything you read says don't do this. Everything we've been pushed to do by Dr. Han has been to do it anyway. The College did offer to stop this nonsense and step in. Unfortunately, that offer came immediately after Dr. Han called Mark in for an emergency appointment and insisted that Mark try the drops soon, finally providing an opiod script for 2 weeks since Mark's scripts are about to run out. Every indication is that Dr. Han talked to the College before Saturday, when we went for the appointment. Yet, the College has specifically asked him not change his practices in general. If I were Mark, I'd be running away from this MD. However, I'm not Mark and I can't make his choices for him. He's going to stay and take the cannabis without accepting the College's generous offer to step in.

As his caregiver, I'm starting to have a panic attack. When something goes wrong; which it is clear to me that it will, how bad will it be?



Thursday 14 December 2017

Been a while

Lately I haven't had a lot to write about.

Looking for work seems to be a trend, the newspaper says there are jobs. The businesses post job offers, the job offers are never filled so that you see the same jobs over and over. No response at all is the norm, when you do get a response they usually have a person in mind already and are willing to talk to you, but not make a serious offer.

Oddly the only two serious offers I've had require moving. I don't have the money to move though - so catch 22. No money to move, no place to stay if I try anyway.

I don't have a lot of resources or space, so turning my home into a woodworking shop or something of that sort is out. I do have a camera and know how to use it. So, I've been a photographer for three years now.

I'm sick of working alone, sick of being bored, sick of the long hours editing photos and computer failures meaning refunding clients everything since I cannot afford to fix the computer and must limp along on a laptop. I love photography, don't get me wrong. I chose a passion. I just want so badly to be in a team again. I miss the team dynamic more than anything.

If photography took off and there were clients every day, I would still miss interacting with at least 20 people a day, driving projects forward, learning every day, and applying my brain full throttle.

I didn't want to get into business for myself. I wanted to do this while I found work. I knew what it takes to start a business. A min of 30 grand investment, advertising, etc. I knew I didn't have those resources. So... Why am I still here?

Resumes don't work.
Headhunters have been completely dismissive, often not even bothering to call back when they promised.

Government resources like a workshop in Red Deer were completely useless. They said my resume was great, refused to book me in with someone in the industry to confirm, and despite me making the trip from Edmonton to Red Deer for help, advised there was nothing they could do. The same woman went gaga for my roommate and called for him several times, although she also failed to help him with a resume or getting someone to call and go over it from his industry even though that was her job function.

At this point, it's time to start again. So, I went the quiet way, keeping most of my life private and giving no one fodder to say no. Now it's time to reverse that and see what happens.

Wednesday 16 October 2013

Thanksgiving and Halloween

Finally some time to really get out into the community. What a great time to be had with the River City Zombie Committee (RCZC) on the Oct 4 event, Undead 80's. One video complete (despite camera issues destroying over 1/2 of our footage) and a website up with Zombie photos.

Not bad for failing equipment, letting the fairly new video editor play, and one developing photographer out for a day of fun to get used to the Olympus. Next time we'll catch the Rigor Productions Zombies dancing and have some more fun editing the photos.

Thanks to the desire for blood splatter, I also was able to play more with fluid in Blender. BTW: F12 would rock if it would give me the same quality photo as rendering the whole file again. Cameras also need to be easier to adjust. There should be a camera view so I can click and drag to what I want to see.

Also, this week was about the office dog. For those who are using digestive enzymes for their pets or livestock, stop paying the vet price. Pancrease-V powder, what a nightmare. Our supplier has been sporadic about having it in and has sold away bottles we requested just before we drove over. This last time the clinic even demanded a vet appointment (as if the powder wasn't expensive enough). So, no more. Digestive enzymes are available without prescription and from now on, that's what I'm doing with the help of my friends at Nutriteck. They stock all kinds of digestive enzymes, supplements, and animal care products. You don't have to go to the wholesaler to obtain digestive enzymes without prescription, but the price is worth it.

That reminds me, thinking about sales. For some odd reason there have been over 10 discussions with random people in my life about value-adds this week. What is a value-add and what is a value-fail. For example, an Internet company decides they want to add anti-virus to their list of products. However, they add anti-virus that accidentally deletes primary system files (just once, but still), doesn't protect the computer as it boots (causing many clients to discover that viruses are still working their way onto their computers), and randomly turns off according to the Windows system log. Why do they go ahead and keep offering the product?

For advertising there seems to be a lot of push to get the word out - negative or positive. However, the people making real sales urgh against cold calls, products released to early, poor sales tactics, etc due to the long-term loss of sales. I think with a balance of getting the word out where people will look for it (e.g., Google maps, positive reviews, work showcases, etc) and ensuring that the vision shown is of why the business you do rocks any business can be successful.

Blender OMG

It is rare that technology has me wishing to be a much earlier adopter. Blender has me wishing I was into animation as far back as GIF animation. Oddly, it isn't the hard things in blender that are hard, it is the simple things.  For example, to make animated water is really easy. Click the fluid tab, choose the limits of your animation (bounding box, obstacles), and select your fluid options which are extremely nicely laid out.

However, moving about the screen and putting things together - that takes days. I've never been so frustrated with what should be simple mouse and keyboard controls. Oh, and it isn't just keyboard controls. You have to know which section of the program you are in since keyboard controls are re-used or moved around. There's a terrific video about what needs to be fixed, I couldn't state it better. Intuitive design is a must. http://www.youtube.com/watch?annotation_id=annotation_2735267151&feature=iv&src_vid=yIedljapuz0&v=xYiiD-p2q80

That being said, I made my first model, had my modelling friend remake it a million times better in 1/10th of the time, then made my second model, etc. Will I become a professional modeller? To be honest, I like the creativity. However, the tool is outrageously complex.  I feel like I'm back moo programming but with a much more verbose and abstract language. Oddly, I'm not programming at all, just moving about.

Did I make all of the newbie mistakes? Most likely, check out http://www.youtube.com/watch?v=WjMaAw2BjFE. However, you have to make the mistakes to get some idea of the flow of things. There is a flow, it's just really hard to understand at first.  The basic flow goes think about what parts need to be together or separate, then carefully build those parts (organic modellers beware, if you're animating later organic modelling is bizarrely weird to break apart - I made a part of my first model organic, really bad idea and cost me hours of keyboard control nightmares). Modify until it looks good, but don't apply - or at least try not to. Texturize. Include all of your textures and test that they are included. Then do advanced stuff like animation. Seems simple, but since the newb doesn't know how to animate yet - it is rather difficult to guess how to properly separate your pieces - oh and all of the videos seem to tell you to apply your modifications - Yikes! So many more issues arise. Don't apply until you absolutely must. Blender will let you see your unapplied mods for a reason.

However, for all those attempting to learn, despite the fact that he uses Maya controls - which actually locks you out of some features so you'll have to keep switching keyboard controls, I highly recommend
cannedmushrooms - http://www.youtube.com/user/cannedmushrooms

My second and third choices let me down a great deal. They kept skipping key presses/clicks or assuming knowledge that took me hours to gain.  However, once you have some background knowledge, the advanced courses by blenderguru (http://www.blenderguru.com/page/3/) are awesome.

For those looking for something quick to feel like they've accomplished something, check out this fluid tutorial http://www.youtube.com/watch?v=dgdGV0yaoM4 by Special Features.

Off to the next project at the moment, though. So, I'm going to leave the rest of my learnings from Blender far behind me and remember that next time I try, make the house first (cannedmushrooms way of teaching you basic navigation), make the cone second (box modelling in a nutshell), then worry about what I'm trying to accomplish third.

For those looking for a blender modeller, I'll put you in contact with my tutor, Bleu is available. Just ask me about modelling and I'll send you on over to him. He's the one that did all of the work I was attempting to accomplish in 1/10th of the time.

Zen Cart, PHP, HTML, CSS, and Javascript, and you

This is an old post, moved to keep my stuff in one blog.

If you don't want to set up your own carts, then give GEE Video Production a call and we'll get you a site. The reason for going with ZenCart in the first place what they call EZ pages and Define Pages. Its like having a Word Press (or if you're really new to content editors, like having a word processor such as Microsoft Word) editor for your entire store - sounds nice, right? It's even better than that! Way less bulky, fast results, and totally customizable without a million plugins.

I've been training someone in using ZenCart. I love the software, the customizability, and the speed at which I can accomplish a reasonable website with shopping card.

The issue is that I know HTML, CSS, and only had to pick up some PHP to accomplish a site. My very bright friend, however, had to pick it all up. This is his first website and his creativity drove some awesome modifications. It was totally worth having someone on board who didn't know any limits or just want to get things done quickly. I don't think he gets how important that is sometimes.

However, I think the rest of the world might be able to use Zen Cart way faster if there was a quick outline about what to look for on the web. So, here's my outline.

HTML Very Basic

First, the basics.  HTML. What is it and how to get it done.

To use the CSS Zen Cart offers you really should follow your best standards... ZenCart is HTML transitional, most likely in case you mess up, I found very few Zen Cart issues with going HTML 4 at least. What does that mean?

Well, I can't explain it all quickly, but here are the basics of an HTML page.
Tags and elements define things... The first tag/element you come across actually breaks the rules most of the rest of the tags, it doesn't end. The tag defines what kind of page it is. Most people just copy this and put it in:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

What does it mean in layman's terms? That I can use some old and some new tags and browsers won't try to die if the structure is a bit broken. What does mean in programming terms? Well, that's quite a read and shouldn't be attempted until I finish explaining a basic page. However, here's the link... for later:
  http://www.w3.org/TR/xhtml1

Normal HTML tags have a beginning and an end. These include the outside tags. So, the minimum  to make a webpage is to tell the browser we are using HTML.
<html>
</html>
The html tag (element) is the first time you run into properly formed element with attributes. The basics of attributes are that they occur after whitespace and after the main tag declaration (html, in this case). The first attribute here is xmlns. xmlns tells us something about the html tag. In this case, the immediately following quoted text is telling the browser where to look up any needed interpretations of the elements we are about to use. dir is the second attribute, and the assigned value (the stuff in the quotes) tells us we are in a language that reads 'ltr' or left-to-right. lang is the third properly and tells us to use english (default is US).

Remember every tag that start has to end. To end html we can either:

  • <html></html>  start and end the HTML node separately OR
  • <html/> end and start with the same tag (OK, don't do this.... there are some browsers that have their own rules, but let us assume that basic W3C rules actually work)
So the actual minimum for a properly formed page is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en"/>
OK, now if you're loony and want some punishment you can go read the standard.  

HTML Almost Useful

Beyond the end of the previous section, I will skip explaining most attributes, you can look them up later, when you need to use them. from:
http://www.w3schools.com/html/html_attributes.asp
To make a page that actually does something you need to fill some areas in.

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>
</head>
<body>
</body>
</html>

Head holds the header and some programming code, everything you want search engines to look at want the browser to pre-load. It has a few more of those weird tags that don't really end.
e.g., <meta name="keywords" content="webpage, basic, empty">

Meta areas contain data that are typically used by search engines. Other exceptions are link and base areas, they tell the browser where to look for the webpage content on the Internet.

Body holds all of the basic HTML tags, and some inline code from other languages... Just think of it as what the browser will actually show to the person visiting your page.

HTML Useful with Javascript

HTML is meant for structure. People mistaken structure for layout, this isn't quite true. Once things are in HTML you can move them on the page using CSS.  Just keep this in mind, HTML tells you what things belong with what other things while CSS tells you how to make it look. There are defaults in CSS, or else the Internet wouldn't work... or more properly, just structure will give you a good looking page.

This is about where I throw my student into the deep end... The HTML tag has to contain all of the data you need for the page... So, a fairly well thought out page might look like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">

<head>
<title>Show This on the Top Browser Bar</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="keywords" content="webpage, basic, empty">
<meta name="description" content="How to make a basic and well thought out page">
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" type="text/css" href="./stylesheet.css">
<link rel="stylesheet" type="text/css" href="./stylesheet_css_buttons.css">
<link rel="stylesheet" type="text/css" media="print" href="./print_stylesheet.css">
<script id="twitter-wjs" src="http://platform.twitter.com/widgets.js"></script><script type="text/javascript" src="./jscript_tabbedhighlight.js"></script>
</head>
<body id="contactusBody" onload=" if (document.contact_us){ if (document.contact_us.contactname) {document.contact_us.contactname.focus()} };" data-twttr-rendered="true">
<div id="mainWrapper">
<p>Show your business in action</p>
<script language="javascript">setPage()</script> 
</div>
<script id="hiddenlpsubmitdiv" style="display: none;"></script><script>try{for(var lastpass_iter=0; lastpass_iter < document.forms.length; lastpass_iter++){ var lastpass_f = document.forms[lastpass_iter]; if(typeof(lastpass_f.lpsubmitorig2)=="undefined"){ lastpass_f.lpsubmitorig2 = lastpass_f.submit; lastpass_f.submit = function(){ var form=this; var customEvent = document.createEvent("Event"); customEvent.initEvent("lpCustomEvent", true, true); var d = document.getElementById("hiddenlpsubmitdiv"); for(var i = 0; i < document.forms.length; i++){ if(document.forms[i]==form){ d.innerText=i; } } d.dispatchEvent(customEvent); form.lpsubmitorig2(); } } }}catch(e){}</script>
</body>
</html>

The above includes two javascripts.  The basics of Javascript are that you have a loading area for the script. You can include outside files like:
<script type="text/javascript" src="./jscript_tabbedhighlight.js"></script>
or you can put code into the page to pre-load it, but that gets ugly, so lets not.

To run the script you do something like:
<script language="javascript">setPage()</script> 
You can read more about javascript in webpages at:
http://www.w3schools.com/js/
The same basic principles are followed for CGI and some other included languages. The embedding outside code becomes quite handy when we look at other helpers like Flash and QuickTime:
http://www.w3schools.com/html/html_object.asp

CSS

CSS makes things pretty. The layout can change (the look and feel of any element on the page) per element, per attribute, and/or per structure. In my opinion good CSS uses mostly structure with attributes to help locate pieces of structure. The CSS file is an included external file... OK, there is such a thing as inline CSS. Let us ignore that for the moment, please. If you're interested check out.
http://www.w3schools.com/css/css_syntax.asp
In our example, there are four places in the head that included css:
<link rel="stylesheet" type="text/css" href="./stylesheet.css">
<link rel="stylesheet" type="text/css" href="./stylesheet_css_buttons.css">
<link rel="stylesheet" type="text/css" media="print" href="./print_stylesheet.css">
Based upon the href you can see that their is a main stylesheet, one for buttons, and one for print. CSS is cascading. So, items in ./stylesheet.css can be overridden by items in ./stylesheet_css_buttons.css. CSS is also dependant on the media. This means that, even though the ./print_stylesheet.css follows the previous two it does not override them. However, two print medias in a row would allow for possible overrides.
<link rel="stylesheet" type="text/css" media="print" href="./print_stylesheet.css">
<link rel="stylesheet" type="text/css" media="print" href="./print_stylesheet2.css">
CSS cares what you defined, exactly. In the print example, all of the items in  ./print_stylesheet.css will continue to affect the layout of the page when the page is printed unless ./print_stylesheet2.css has an overriding definition.

CSS has rules, but some are broken by specific web browsers. In general CSS looks like
element {
   what to change: what you want to change;
}

To understand CSS structure, it is best to play.  However, the basics are that CSS cares about what type of attribute you are referencing and is hierarchical.

Here's an element with three four ways to address it:
<div id="contactUsNoticeContent" class="content"/>
Address by class with:
.content {}
Address by element name with
div
Address by id with:
#contactUsNoticeContent
If you add some structure you add more ways to address the element.
<div class="testclass">
  <ul>
     <li>
  </ul>
</div>
Now I can address all list items within the testclass with:
.testclass li
Check out more on this at:
http://www.w3schools.com/cssref/css_selectors.asp
In some cases weird element definitions work, these often break the standard. They are poor form, but often necessary to make sure all of the browsers look the same. Here is a great example, thanks to Microsoft, for creating some weirdness like filter:
http://reference.sitepoint.com/css/filter
What does this look like in an actual CSS file? I chopped a small section of a CSS file out so that you can see:

/**
 * Main CSS Stylesheet
 *
 */
body {
margin: 0;
font-family: Gill Sans, Lucida Sans Unicode, Lucida Grande, Tahoma, sans-serif;
font-size: 62.5%;
color: #000000;
background-color: #e5edf5;
}
a img {border: none; }
a:link, #navEZPagesTOC ul li a {
color: #3300FF;
text-decoration: none;
}
TEXTAREA {
margin: auto;
display: block;
width: 95%;
}
input:focus, select:focus, textarea:focus {
background: #E4FEF5;
}

PHP

OK, onto PHP, the basic programming language for Zen Cart. It wraps around everything I've previously shown you... And goes right in the middle. In general PHP is used to write out everything in an HTML page and provide the ability to make choices based on outside factors. Where Javascript runs on the client's computer, PHP runs on the server. It is fast, fairly flexible, and quite easy to pick up if you know at least the basics of object oriented programming.

Any attribute on a page and any variable, global variable, or if statement can make a choice. This isn't meant to teach you PHP, this is meant to get you past being able to read the basics. w3schools can help out, but I found that Zen Cart's sites were better once you get past the basics. To be honest, use Google to search zen cart's site.. Their search isn't that great, but  here are the links to w3schools and Zen Cart anyway:
http://www.w3schools.com/php/
http://www.zen-cart.com/content.php?2-FAQs-and-Tutorials
To start the PHP in each php file in Zen Cart you'll see:
<?php
To 'end' PHP you'll see
?>
However, if the PHP includes a curly bracket, it will keep including the results of the following statements until the end of the bracket
 <?php if something {?>
    <html><body><p><?php $content = "the text to write out"; echo $content; ?></p></body></html>
<?php } ?>


A really nice way of writing HTML that is easy to follow is found in some files, but not most.  For the most part HTML and PHP are interspersed. The nice way is to keep adding to the string (in this case $content) based on some decisions, then output all of the string in one go (echo $content).
<?php
/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_ezpages.php 2982 2006-02-07 07:56:41Z birdbrain $
 */
  $content = "";
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
  $content  .= "\n" . '<ul style="margin: 0; padding: 0; list-style-type: none;">' . "\n";
  for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) {
    $content .= '<li><a href="' . $var_linksList[$i]['link'] . '">' . $var_linksList[$i]['name'] . '</a></li>' . "\n" ;
  } // end FOR loop
  $content  .= '</ul>' . "\n";
  $content .= '</div>';
echo $content;

The confusing way (and to be honest, the way most of the files are written) is to intersperse the two languages and decision trees. I'll only give a partial example:
<?php
/**
* Common Template - tpl_main_page.php...
if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
    $flag_disable_right = true;
  }
  $header_template = 'tpl_header.php';
  $footer_template = 'tpl_footer.php';
  $left_column_file = 'column_left.php';
  $right_column_file = 'column_right.php';
  $body_id = ($this_is_home_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);
?>
<body id="<?php echo $body_id . 'Body'; ?>"<?php if($zv_onload !='') echo ' onload="'.$zv_onload.'"'; ?>>
<?php
  if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
    if ($banner->RecordCount() > 0) {
?>
    <div id="bannerOne" class="banners">
     <?php echo zen_display_banner('static', $banner); ?>
    </div>
<?php
    }
  }
?>
Things in all caps like SHOW_BANNERS_GROUP_SET1 were written as global variables somewhere else. You don't have to do the normal $Global to address them. You just write them in all caps where they are.

Notice that here the php command ends, but the bracket hasn't ended:
if ($banner->RecordCount() > 0) {
?>
<div id="bannerOne" class="banners">
That means that everything to the end of that set of brackets will be part of the decisions and output processed for the if statement. Brackets can  be nested, and are in the example... and no, I didn't include all of the ends of brackets.

Notice that it is good practice to copy out any variables you need into something that doesn't conflict before using them:
$header_template = 'tpl_header.php';
$footer_template = 'tpl_footer.php';
$left_column_file = 'column_left.php';
$right_column_file = 'column_right.php';
This doesn't always happen in the files, so watch out as you can change a variable or constant to something and affect more than that page.

All right, well, that's the basics. Good luck from there. At least you can find the start and end of things and avoid the conflicts. The rest is up to you to learn, remember Zen Cart has tons of online help and support. Use it.

Intro Who am I and Make Google API Calls in Ruby 2.0.0

This month has been a time of bizarre growth so, it is time to start writing.
Forgive me for the ramblings. This blog post is meant to share in some ways, but mostly, to force me to start blogging. I promise the next one will show more organization and full working bits of code. This is my 'get yourself out there' article. You know, like the first time you were ever interviewed and the interviewer asks you a question you don't know so you look around for someone that does know the answer - we've all seen the kids do it.
First a thanks to a huge community on the Internet, developing with limited feedback and no direction is incredibly easy. Second, I'm not quite all alone. However, going from working with a huge team to a smaller one at Castle Rock and now in a team of four has been a great experience. Don't start here, really, go for the larger team first!
This month has been about programming, marketing, and wonderfully crazy friends.
Programming - Why would a CSO with no formal programming background want to program?  Reason: Marketing.

Marketing - Makes or breaks a business, we have to do it, and, to be honest, that's what I've been doing since starting at GEE. It just looks like development, when the reality is webpages, demo products, and inventive ways to market are all marketing. Oh - and sorry to say it world, but so is blogging. Does that mean I won't contribute to the world? Absolutely not, marketing is awfully soul destructive if it doesn't build the community around you.

Wonderfully Crazy Friends - if you don't have some, get some. I'm usually the supportive quiet type, until something needs to get done. Then, I turn into the business 'get it done' male mindset (Yes, I know I'm a woman - I hate to say it, but women have terrible ways of motivating people, if we want to motivate the world around us, we really have to tap into our inner male mindset).

Background - My (recent) background in programming is to be one of those crazy quality leads that knew nothing and was the best suited for the job. I learned a lot and all with a focus on the customer, which is perfect, because that is what business is about. While doing that I became a programmer, sort of. Had to release members of my team because I could program faster, more accurately, and with better results than the guys with the degrees... However, that doesn't mean that my team just wasn't qualified. Still wouldn't call myself a programmer as such, more of a manager that could pull off more focused results than the programmers.

Ruby/Marketing

If you need to learn Ruby check out _why. This author's style is beyond weird, however, my psychology background points out that it is extremely sound. Learn a bit, distract a bit, learn some more, and your subconscious and conscious minds will ensure that it all comes together quickly.
  Read his stuff at: http://mislav.uniqpath.com/poignant-guide/book/
  Who the hell is he at: http://en.wikipedia.org/wiki/Why_the_lucky_stiff
     and http://venturebeat.com/2013/04/19/why-oh-why/
  Is he going to come back? I hope so, but his website is back to being blank. At least we know he existed for a moment. I really hope he didn't sell out to Microsoft or pass away - but then, who else was showing him kindness and humanity... Kind of wouldn't blame him.
Was that marketing? Well, sort of.. Except Why's books are free and that is information sharing. Oh, yah, information sharing - that is what I was up to.

Concept

The concept? I'm out and about, have my phone/computer/whatever with me and it knows where I am. I don't know what businesses are around, so I ask Google. Right now Google tells me a bit about what's around me, but I wanted Google to tell me more. What businesses are within a short walk, what are their websites, phone numbers, and a short description? Can I, without walking, see their storefront and check out the inside of the business? I didn't get all of my answers, but as close as I can get without either paying for more API access or talking to a Google dev team rep. I might pay if the primary idea was that I was at home, my executive friend calls me, and I tell him about his area... Hrm. Anyway, I know it is an odd idea for people to want to know what is around them, however, I do.

Google and their API for places

The logic. You would think this would be truly easy. Google has an option for things close to you in their API, the issue is that the results are so limited in number, you might as well not get them.
*[] - indicates you need to fill this in. Use https://developers.google.com/places/documentation/search to help.

Google Places

Although it sounds wonderful, I found that the most useless results come from Google Places. The limit on results is incredibly low. So low that when I chose a mall as my testing point I could see more businesses with my eyes than they returned. However, it is a good way to start using the API as the cost is only 1 point to use it. So, I used it to start learning.
https://maps.googleapis.com/maps/api/place/nearbysearch/xml?key=[add your own key]&location=[lat and long in format 43.680934,-79.429741]&radius=10&sensor=false
*Note &types=food is a useful thing to add in.

Google Radar

First find where you are, use your cell phone coordinates or Google map or something. Here's a simple tool that will <a href="http://itouchmap.com/latlong.html">return your latitude and longitude</a>. Or you can just use the Google Reference number from the results of a search from the address or business.
Second, use Google Radar with a reference key or the latitude and longitude:
https://maps.googleapis.com/maps/api/place/radarsearch/json?key=[add your own key here]&sensor=false&location=53.541195,-113.490331&radius=1700
*Note if you're looking for food or something specific add on types &types=food|store|gym|doctor|dentist
**Keep results under 200, it will return a pretty random set of businesses within your radius.
***The results are cryptic. Keep the reference numbers and move on.

Google Place Details

This tool actually results in the details for the referenced location. This is the data I want, but notice that I have to do the search 200 times. Total daily search cost for one location works out to something like 205 API calls to receive what I want. Notice that I turned extensions on even though they are useless without paying Google. Still, I'll take whatever they will give me for free.
https://maps.googleapis.com/maps/api/place/details/xml?key=[add your own key]&sensor=false&extensions&reference=CnRnAAAABkIiDvc2RPQknkaJJclZfOmDfa9oRAavfKUoNlvYwtpakL2apCH29lc4M9IE8p9AX3VU1Ssn0QBPyvfBiCga3dFwi8HyMmGrgmmh93Zwc6Z2iWV3lUFLTsXLrgKPEjAGtzDObpKc56WBEN1NIhuTthIQeJDCi-f7W7LjZ9w_eHfGsBoU-_okOBQBpGWD1J66UJuLD6XXYmA

Resources

             The Internet - which, to be fair, is a good enough resource for any programmer
             The Über Geek that works with me... Except he has his own projects, still he's a good cheering section and he really has been one of the best people to work with. Just look up for long enough and he'll notice and find some way to elicit a smile. Although crass at times, Über Geek, you're the best cheering section ever - except my husband. Something about Shakespearean swears and odd rants keeps me with my man.

Toolchains, Google, and XML versus JSON results

A brief comment is required here. You can get the results above really easily. However, the future demands faster, smaller, and friendlier applications. I was hoping to use JSON. In the end, I abandoned it and my reasons follow.

Desired Chain

Java/Javascript with json results, perhaps some WebGL for fun, the Google API. Requirement jsonpath or xpath and Google API. Goal to appeal to both the "I love text info" and the "I love useful graphics" people.

Hurdles - JSON

OK, I like the concept of JSON. Beyond belief. I'm an executive and I was willing to spend a week trying to get a toolchain I liked working with it. That's a LOT of time for me and shows a bizarre level of commitment that my Über Geek pointed out to me is just ridiculous, give it up and move on. Let the Über Geeks sort it out later. Well, any json Über Geeks out there that will help me properly encode to the JSON RFC 4627 format are suddenly best friends. There's supposed to be a java file that does it. However, I couldn't find docs.
In the meantime, those unquoted bits kill the coolest and most widely adopted tools like json.parse and json.path. Although the browser itself and javascript basic still think they are JSON almost nothing else does and re-encoders are typically advanced regexp that have bug logs too long for me to consider. I'm not into the Google suggested search your way on down the lines of code thing. I want context without losing speed and quite frankly there is a reason bubble sort is still taught in programming and a reason for indexing. Results quickly please... Please? pretty please? No? OK, off to XML land, then. If I wanted to go line by line, I could get the same performance from perl, sed, aux, or grep with curl. Hashes and arrays are better, but still clunky and quite frankly, I don't have time for clunky. There are other options that are reasonable, I tried to get many of them working. All I can say is:
"Google, STOP BREAKING THE RULES and every developer's life will be so much sweeter. JSON will catch on as a faster, easier way than XML and all the XML fans will convert"
FYI: Whomever at Google thought it would be fun to return results without the quotes, since Google used to properly quote, you just made me despise you and your first born, but that's OK, it was only for a week, all is forgiven now.

Hurdles - Ruby

Really, ruby friends, you're dropping the ball on JSON, even in rails. And your included XML interpreter is still XML 1 and doesn't verify structures? Really? Come on. However, do I care that much? No, you had what I needed, just not what would have been cool. Thanks for reducing my workload and time spent based on limits of availability. However, I probably should have gone C#. I did try jsonpath in ruby and a few converters to see if I could get there. However, most converters convert the json into hash or array, so I was better off with XML. However, Ruby, love you to program in, I'm a fan of _why and so many other Ruby thinkers. However, wake up and take some of the JSON Kool-Aid and tons of the XML Kool-Aid.
Ruby 2.0.0 with 64 bit is where I headed. Should have stopped and thought about that. However, I have this brand new machine and wanted the latest. Suggestion to the next person, stick with 32, stay with older versions that still have SSL keys built in. However, keys were pretty easy to overcome. So, I'm not going to gripe that badly. Curl even makes it easy for every developer over at http://curl.haxx.se. Oh, and to all of you goofballs turning off SSL and calling that a fix, erm? Come on, really? Wow!

The Code Snippets that Make it Possible

#Set your requires. For my full project I needed:
require 'rubygems'
require 'openssl'
require 'net/https'
require 'rspec'
require 'rexml/document'

#Grab the SSL file
#Replace [FILE PATH] below with your own path.
Net::HTTP.start("curl.haxx.se") do |http|
  resp = http.get("/ca/cacert.pem")
  if resp.code == "200"
    open($cacert_file, "wb") { |file| file.write(resp.body) }
    puts "\n\nA bundle of certificate authorities has been installed to"
    puts "[FILE PATH]\n"
    puts "* Please set SSL_CERT_FILE in your current command prompt session with:"
    puts "     set SSL_CERT_FILE=[FILE PATH] + cacert.pem"
    puts "* To make this a permanent setting, add it to Environment Variables"
    puts "  under Control Panel -> Advanced -> Environment Variables"
    #or uncomment this line and set to the correct directory:
    #ENV['SSL_CERT_FILE'] = [FILE PATH] + "cacert.pem"
  else
    abort "\n\n>>>> A cacert.pem bundle could not be downloaded."
  end
end

#Parse your URI
$uri = URI.parse(your_html_api_call)

#Use a bit of code to make sure you actually obtain a result instead of a redirect
#by setting the limit to 1.
#You can use the same code to help out in finding redirects and still obtaining results
#if you need it, just raise the limit.

def fetch_ssl_body(your_html_api_call, limit)
  raise ArgumentError, 'This application does not allow redirects' if limit == 0
  http = Net::HTTP.new($uri.host, $uri.port)
  http.use_ssl = true
  http.cert = OpenSSL::X509::Certificate.new(File.read $cacert_file)
  request = Net::HTTP::Get.new(uri_str)
  response = http.request(request)
  case response
   when Net::HTTPSuccess then
      response.body
   when Net::HTTPRedirection then
      location = response['location']
      newLocation = location.gsub(Regexp.new(Regexp.escape($uri.to_s)),'')
      warn "redirected to #{location}"
      fetch(newLocation, limit - 1)
   else
      response.body
  end
end

#**everything above here was available from a previously trusted Ruby programmer, most of it was found directly on the Ruby site.

#Build an XML tree for parsing

include REXML
doc = Document.new fetch_ssl(your_html_api_call,1) #This always looks like it errors, expect undocumented
#puts doc #use this to prove to yourself you have a document
#shove only the data you want into something references = Array.new XPath.each( doc, "//reference") {|a| references << a.text}

End Notes

True, I didn't give you the whole app here, but this is all the code you need to build it. You can make calls and Ruby's each function will give you nice easy ways to iterate.