Do dreams have pixels?

My mind clicked awake at 2AM last night.  I thought I might be able to get back to sleep by creating a calming scenario…like sheep jumping over a fence. Who’s in charge here anyway? I went into the menu and chose: file > new. The sleepy part of my mind thought I could create a dream with me successfully singing my latest project: “Love Yourself”, by Justin Beiber and Ed Sheeran.

But I got stuck on the file > new  menu. What resolution should the file be? Should it be 1080p? Maybe 4K? So many questions…

We’ve been doing some really complicated projects in class recently. Our project this quarter is to build a portfolio website. It needs to be so good that it can help my students get a job. But the process is sooo complicated that I wrote a book about it,  you can buy it on Amazon.

But back to my dream. I worked on the song after class today…for hours. I must have been driving Sue crazy…obsessively finger picking the chords. Eventually I gave up when Lisa asked us if we wanted to run the stairs at our local stadium. Sue surprised me by challenging me to run them with her. She normally walks up. But there she went, running up, and I followed. We both reached the top…still alive. I couldn’t  believe how strong my 66 year old wife is. I struggled to keep up with her…and the stairs seemed endless.

There were a  dozen people in their teens and twenties running the stairs. Those kids are like electric motors. Definitely wired for 220 Volts on a 20 Amp circuit. They don’t even know the meaning of load.

Annnnd I’m back to the dream.

I discovered this song a couple weeks ago. I think it’s the hardest song I’ve ever learned. I’ve figured out how to play the lead part in the key of C, without a kapo. I still can’t sing and play lead at the same time, but I’ve got the chords and words down.

Here is the tutorial I’m following on how to finger pick the main verses:

I spent many hours studying the song before coming up with these chords. I love the way the words rush along, out of time to the music. It’s the kind of song that gets into your head. I don’t even like the words, they are a bit juvenile. But the melody and rhythm is very compelling, it just works.

F. and I climbed one day over Memorial day weekend. I was so rusty I had to cheat on South Face of Jello. My lack of gym power is making a difference. I got up Midway direct, but barely. I was terrified on the Midway step across move. I’ve had that wired for 30 years.

In other news, I was standing at the sink today and noticed that the soap dispenser bottle was looking particularly fetching. It’s your standard yellow liquid soap for washing dishes…but my artists eye saw it as a painting. I imagined mixing the colors with my palette knife and laying them down thick and juicy on the canvas, gradually building up the shape in thick layers of colored mayonnaise like oil paint.

I didn’t actually paint…but the fact that I thought…even hungered for painting, is in itself promising. I’ve been blocked since November. Doesn’t help that all the parks are closed…though that doesn’t stop my friends who are real working artists. Summer is coming in a month.

I wrote this post a couple weeks ago but have delayed posting it. Since then I’ve been climbing with F. three weekends in a row. Last weekend (yesterday) we went to Private Idaho at Index. I led Senior Citizens and Wild Turkey. He led Battered Sandwich and Istanbul. I might have been able to lead them, but was glad he stepped up to the plate. Battered would have freaked me out at the upper slab. I would have had to hang. I almost fell out on follow. It’s partly my new shoes. I don’t trust them yet. They are very aggressive and seem to have a stiffer than normal insole. I love them for crack…but don’t trust them yet on friction.

SpaceX just put two astronauts in orbit. Those guys are so brave! First US built astronaut launch in 9 years. The technology is much improved over the old space shuttle. I still remember where I was when the first one blew up. I was at JL Darling, working day shift in the bindery where they had a radio reporting on the tragedy.

Ever wanted to build a website from scratch?

For the last 18 years I’ve been teaching college students how to build websites, no prior experience required. I’ve written a step-by-step textbook on the process.

My book is not just another pretty face. The design and content has been tested under fire. When something broke, I re-wrote it. My students are quick to call me on errors. They are my best editors!

I had zero desire to write a book. But to do the job, I needed one, and I was tired of buying books from other authors that didn’t work in my classrooms. I needed a textbook that explained, in the shortest possible time,  how to build a state of the art web site…to total beginners.

My computer savvy students can race through it at their own pace. However, the book is written so well that even students who are less confident can still follow along, page by page.

Here is my book on Amazon

Editing my book, Apple watch review

I had some great students this quarter. A bunch of them recognized the power of what I was teaching and really ran with it, creating stellar websites. Especially considering that I only saw them 3 days a week for 11 weeks.

After a 3 year delay I finally buckled down and did a huge rewrite on my textbook…or at least the first 150 pages. It was probably 5 full days of work, and I did the editing  on the weekends and evenings after work. The biggest thing was that I learned how to do an automatic Table of Contents. This allowed me to break the book into numbered chapters that matched the lessons I grade in my classes.

All of this work is unpaid overtime of course. I plan to sell the book on Amazon, and my first task (after some time off) is to study some Lynda classes online on how the self publishing industry functions. I’m writing in Adobe Indesign, but many people write books in Microsoft Word. Many years ago McGraw Hill asked to publish my book, but they wanted me to extract all the text out of Indesign and send it to them in Word, double spaced.

I declined their offer. It’s classroom ready, I give the 214 page PDF to my students every quarter, why would I tear it apart? I get that I need an editor…but at the time I would have had to take a summer off to publish it their way…and that wasn’t happening.

As usual all the overtime made me want a reward. We work hard, we get a big paycheck right? Or at least that’s how it worked in the printing industry. Not so much in the book writing business. Not that I’m complaining. I know what I signed up for. If I write it well, I’m confident it will sell.

The only downside of writing is that I stopped painting. I guess there’s only room for one creative outlet at a time in my strange little brain. I’ll be painting in a few day though. It’s going to be awesome.

Now on to that reward

I’ve been saving money and splurged on the Apple Watch Series 5 with cellular. I’m not sure it’s really ready for primetime, but it’s a fun toy.

Cool things the watch does with  iPhone off:

  • While skiing up the Muir Snowfield. I called Sue from 8000 feet on Mt Rainier, with the watch only, Dick Tracy style
  • I worked out on the stairmaster and listened to my songs on bluetooth headphones, while it counted my heartbeats and calories burned
  • I can add and edit tasks using the native Apple Reminders app, which syncs on iCloud.com, my macbook, my phone and the watch…amazing!
  • It has an Electocardiogram function. My ER nurse kids found this fascinating
  • I can get 36 hours of life out of it, easy, if I turn off cellular. Watch cellular is only needed if I don’t want to carry the phone.
  • It has gps, altimeter and compass
  • A vibrating alarm that actually works!
  • Really fun watch faces with infinitely variable ‘complications’ you can add. Like the time, plus buttons for music, reminders, exercise sessons (stair stepper), texting, calling, etc.
  • The Activity app, closing my rings. Seriously, this is amazing! Look it up on youtube. It tracks your exercise and shows you trends, who knew this could be so cool?

Cons:

  • The battery life
  • The screen is too small to do anything serious, like composing a long email. But I say that about my iPhone too

Built a custom WordPress theme

I teach wordpress at work, and last quarter I had a student who wanted a really fancy wordpress site. She didn’t like any of the free themes. I told her I’d been tinkering with a custom theme for a couple years, but had never tried to use it on real, meaningful content. I simply had too many questions about how a custom theme worked in real life.

She was willing to put in the time, and I was being paid to teach…so we chipped away at it in the afternoons for a few weeks. Her website ended up looking so good I decided to try my hand coded custom theme on my 9 year old wordpress site. You are looking at it now. It’s a reasonably close match to my main www.websterart.com website, which is all handbuilt, not using wordpress. I’ve yet to try getting the PhotoSwipe plugin to work. Well, I did get it to work with my theme, but it caused problems.

WordPress, by default, puts thumbnails in definition lists. But PhotoSwipe requires them to be in figure elements. And I’d like to style the figure elements in variable column-count columns. However, there is simply too much code going on with his switch from dl’s to figures, which happens in JavaScript. More on that later.

There is a lot going on here. As far as explaining it, I don’t even know where to start. I may write a tutorial on it later. If you’d like to get the zip file of the theme, it is here. Be forewarned though, a lot of what goes on is in the form of widgets, menus and plugins that get added after you activate the theme in the wordpress dashboard.

Programmed a working calendar for journal

On February 3 I posted the working example from a calendar lesson I had learned in JavaScript. All it did was generate months of the year with the correct number of days, depending on which month you selected. It was dumb but it got me thinking.

As I moved forward in my JavaScript studies I was mulling over a way to make use of that calendar. To the right of this story you will see two calendars. The top one is a free WordPress plugin. I didn’t build it, I just installed the plugin.  It lets you switch between journal entries going back to 2011 when I first started using WordPress. All the post entry links are automatically populated from the WordPress database.

But I was keeping an online journal long before they invented WordPress. I have been writing since late 1997,  a year after I got my first computer. There was a story that year in the Seattle times about a woman who was keeping an online journal. She started it in ’97, and it inspired me to do the same. But as my journal grew it was difficult to build a navigation system back through the entries. I’ve struggled with a number of solutions, as you will see if you prowl around.

The one I used the longest was a flash calendar that I built from scratch. But even I refuse to download flash anymore. So if I was on a smartphone,  I couldn’t navigate my own journal until just recently.

My solution? Build a real working calendar in Javascript and embed it on every page , or at least the pages starting at September 2001, which is when I changed the interface drastically. To get it to work I had to create a JavaScript array for every year, about 10 of them.

As you can see to the right, I also embedded that new JavaScript calendar right here in WordPress below the plug in calendar. I got it to appear by using a WordPress plugin called shortcoder. The shortcoder plugin presents itself as a box in which you can paste html, css and js. Then it gives you a short little snippet of code, called a shortcode. That shortcode references the longer code. I pasted the shortcode snippet into a standard text widget, and dropped the widget into my WordPress sidebar.

You can see it all working here. It’s not search engine friendly yet…I have to think about that. I’ve linked to the contents (hand built index of the journal) page. It has links out to most of the good writing, perhaps that will negate the fact that a dynamically generated calendar can’t be spidered by google.

I’m fairly happy with this solution. It’s not perfect, I think Jessamyn does a better job of archiving, but at least mine was a fun way to practice my JavaScript.

Here is the array for the year 2000. Note that I didn’t start writing until March of 1999, or, at least that is the first named file: three99.html

/**************
begin 1999
****************/

//makes an array of the names of the html files for the year.
var calendar1999 = ['three99', 'four99', 'five99', 'six99', 'seven99','eight99', 'nine99', 'ten99', 'eleven99', 'twelve99'];

function createMonths1999(){
  //captures the <ul id="joynal1999">
  var joynal1999 = document.getElementById('joynal1999');//
  for(let i = 0; i < calendar1999.length; i++){

    //makes virtual <li></li> but doesn't use it in DOM yet
    var listItem = document.createElement("li");

    //makes virtual <a></a> but doesn't use it in DOM yet
    var anchorTag = document.createElement("a");

    /*makes a snippet of text containing a number based on loop iteration
    first one will be 0+4 = 4 which is April of 99...later found entries in March, and changed it to 3*/
    var monthNumber = document.createTextNode(i+3);

    //<a>4</a>//inserts 4 into virtual anchor tag
    anchorTag.appendChild(monthNumber);


    //adds the href property to the virtual element <a href="four99.html">4</a>
    anchorTag.setAttribute('href', calendar1999[i] + '.html');

    // <li><a href="four99.html">4</a></li>
    listItem.appendChild(anchorTag);

    //inserts the virtual "li" with clickable month into <ul> dom element so it can be seen
    joynal1999.appendChild(listItem);
  }//end month maker for loop
}//end createMonths99 function

Next I modified the simpler calendar function from a week ago so that it dynamically generated the months for the selected year, complete with clickable links for each month. But there was a problem. If you selected say, April of 2004, when you got there, the calendar did not display. You had to choose a year again. This was bad usability. I wanted the calendar to always display all the months of the year you were reading, no matter which month you were reading. But that meant getting the pages to talk to each other. The technical term is: passing data between html pages. I had a vague idea that it might be doable with cookies, but I’ve never baked cookies.

Google to the rescue! I discovered there is a way to store and pass variables between pages that have JavaScript. It’s called localStorage. You can write to it, and pull data from it. As long as they are on a long session on your website, you can make your html pages pass data from page to page.

The first line below listens for you to make a choice from the drop list. If you do ‘change’ it, the script fires off the ‘createYear‘ function.

That function puts the year you chose into a variable called ‘choice‘. At the same time, it places that year into session memory via the localStorage.setItem command. This is like registering at a hotel and telling the concierge that you would like the Seattle Times news paper each time you walk in. He remembers your preference during your session at the hotel…all week long.

As you surf from month to month, the concierge (localStorage data) remembers your year preference and keeps that year’s calendar visible

Next I do a couple checks to see whether this is your second journal month choice, or if you just arrived and haven’t made any previous choices. If the latter, I present the first years calendar, which is 1999.

Further down I have a switch-case conditional that fires off the correct createMonths function for the year you selected.

select.addEventListener('change', createYear);

function createYear(){
  if(select.value) {  //does data exist?
      var choice = select.value;  //ie: 2001
      localStorage.setItem('storageName',choice);// hold on to year choice like a cookie but in virtual session

     //empties out all <ul> from <div id="ulHolder">

      ulHolder.innerHTML = '';
  } else if (localStorage.getItem){// we found from session memory they've chosen a year on a previous page
      ulHolder.innerHTML = '';
      choice = localStorage.getItem('storageName');
  } else {// this is only true on first visit to joynal, new session
    ulHolder.innerHTML = '';
     choice = '1999';
  }
  // create ul
  var makeUl = document.createElement("ul");

  // <ul id="joynal1999"></ul>
  makeUl.setAttribute('id','joynal' + choice);
  makeUl.setAttribute('class', 'calendar')

  ulHolder.appendChild(makeUl);


/*
They drop the select drop list and make
a 'choice' of a year. We capture the year in the
'choice' variable.
So they 'switched' it and
we are examining the variable 'choice'
to see what we should do based on it's value
*/
  switch (choice) {
//in 'case' 'choice' is = to 1999
    case '1999':
    createMonths1999();
    h1.textContent = '1999';
    break;

    case '2000':
    createMonths2000();
    h1.textContent = '2000';
    break;

    case '2001':
    createMonths2001();
    h1.textContent = '2001';
    break;

    case '2002':
    createMonths2002();
    h1.textContent = '2002';
    break;

    case '2003':
    createMonths2003();
    h1.textContent = '2003';
    break;

    case '2004':
    createMonths2004();
    h1.textContent = '2004';
    break;

    case '2005':
    createMonths2005();
    h1.textContent = '2005';
    break;

    case '2006':
    createMonths2006();
    h1.textContent = '2006';
    break;

    case '2007':
    createMonths2007();
    h1.textContent = '2007';
    break;

    case '2008':
    createMonths2008();
    h1.textContent = '2008';
    break;

    case '2009':
    createMonths2009();
    h1.textContent = '2009';
    break;

    case '2010':
    createMonths2010();
    h1.textContent = '2010';
    break;

  }//end switch(choice) case


}//end function createYear()

In other news, Sue and I skied at Paradise yesterday. This was only her second trip of the year. She is still babying her rotator cuff surgery. It was a nice one inch covering of powder over a hard base. It wasn’t  grabby, and was lovely skiing, not counting the water runnels, which were as bad as moguls in spots. I went back up for another run, but the fog had settled in, masking the earlier bright blue sky. I turned around before Pan, and finished out the day.

Today I bought a $15 bouquet but discovered I’ve forgotten how to draw. Jeez! I’ve been so lost in programming I’ve not only forgotten how to climb, I can’t draw either. How come I can’t be good at everything? It would be so handy. Perhaps when I get a full time job again and get settled in I can get back to my hobbies. I miss them.

To keep from going crazy with all this studying I’ve been exercising every day and playing a fair amount of ping pong. Last week I played at the local community center with a bunch of seniors. We played doubles, which involves a very intricate dance around the end of the table. You have to hit the ball, but only every other time. This means you hit the ball, then run backwards to get out of the way so your partner can hit it…and repeat. It was so much fun I went to another public game out on 76th.

This was a beast of a different color. They were people of all ages, and they were serious, with a capital S! They literally wiped the floor with me. I lost.every.single.game. That’s nine games in a row, but who is counting? I walked out after an hour. I mean, what was the point? I love the game, but I don’t have the time to develop that kind of skill. I am already neglecting too many hobbies, don’t need to add ping pong to the list. I won’t stop playing, but I will avoid playing with people who live and breath the game.

When one door closes, another one opens

We’ve been making changes again to our program. The web program in which I teach has been around since last century. It’s always been a child of a larger program. First it was a certificate in the Media Program, which ran for over 20 years. When Media closed 5 years ago, we moved our web certificate over to the CPW program. That kept it alive, but it wasn’t an ideal fit. The CPW program focuses more on pure programming, as in building computer applications that manage a bowling competition, or allows students to view  college classes for the current quarter, complete with searchable query strings by teacher, program, etc.

CPW focuses on programming logic like Python, Java, .NET, C+, with a little bit of HTML and CSS thrown in, but no Photoshop at all. We have had great luck putting our smart students to work in places like insurance agencies, and the State of Washington  maintaining websites and databases.

But our long running web program was  the wild child in the CPW program. We cater  towards programmers who also see the artistic side of web development…as in, web design. We still feel that Photoshop and Illustrator are important skills for a free lance web developer to master. Of course, we also try to graduate full stack developers who can a build a responsive website with a hand built shopping cart written in JavaScript, PHP and MySQL. It is quite a good skill set we’ve been developing over the last 19 years, with a number of different teachers contributing various classes, including myself. As with CPW, we’ve had great success putting our smart students into full time jobs.

But because we include artistic concepts in our classes, it wasn’t a good fit with CPW. Not to say anything bad about them. They simply feel that they can hire out the artistic stuff…and that the programming is more important. We feel that both are important, programming, and design.

To make a long story short, our dean advised us to get a divorce. We are going to move our web program out of CPW and become our own degree. We’ve been teaching out the last students in the old web program, and not allowing new students in, to keep the transition period cleaner. What this means for me is that until our new web program starts up…and we’re not sure exactly when that will be, I am unemployed.

As the title of this post reads: When one door closes, another one opens. I’m super excited to have next quarter off. I plan to apply for unemployment, then start hitting the books, preparing myself for both the new program we hope to teach, and/or for working full time again as a web developer. I’m not sure which will happen first. If I do get a full time job, I’m sure our program will survive without me. Everyone is replaceable. And if I don’t find a full time job, by studying hard for an entire quarter, I will be able to get up to speed with some of the stuff I’ve fallen behind on, like frameworks and version control. I’ve done and used both, but not consistently, and not the latest versions.

So, to wrap up, next quarter is going to be very interesting. It will be odd to be on unemployment. I’ve only been truly unemployed once, and that was just for 3 weeks last century back when I was a printer. I was under-employed a few years ago for one quarter…but this time I will be truly out of work, and hitting the books everyday to make myself more employable. I’m going to have to be rigorous about turning down invitations to go skiing or climbing. I’ve got a lot of friends and family with great jobs who have a ton of time off. They’ve gotten used to inviting me on adventure trips mid week. I love those…but now I need to keep my nose to the grindstone. It will be fun learning new stuff.

Adding a logo in a WordPress custom theme

Add a logo image function to your custom theme

Geek alert! This post is for the students in my WordPress class. There is nothing here worth reading if you are looking for stories about climbing or painting. Read More