WordPress Carousel

I am taking a college class on WordPress. Have not been really doing any coding in the class. So I am not having a whole lot of fun. I planned out my semester project web site. The initial page was going to have an image slider on it. I figured I would use a Carousel plugin for WordPress. Easier said than done.

I don't know how many plugins I tried. It was at least five. Maybe closer to ten. Lots of them were duds. Yes they were free. But I figured that a carousel was a common item these days. Many times the plugin would not display a single image. Others would display an image or two, but they would not move.

Finally I found Tiny Carousel Horizontal Slider Plus, also known as tchsp. I will admit that I initially had some trouble getting my images into this carousel. Once I did though, the magic happened. Thank you Gopi.

I uploaded a bunch of images to my gallery. However I had trouble getting them to work with tchsp, which requires that you enter the image URL. Turns out if you edit the image in your gallery, there is a File URL in gray over on the right hand side of the screen.

I sure hope the rest of my site will not be as much pain as the carousel was.

Brute Force PHP

I have long since finished my PHP class. Did a simple game earlier this year where I saved the state of the player to my online MySQL database. Now I am teaming up with a friend to write another database application - The Fan Fiction Database.

The minimum viable product is going to only have three fields to display, each of which you can query against. My code is doing a brute force analysis of the combinations of entries the user can make. I have an "if statement" for each combination of inputs. They each produce a custom SQL to execute.

I did do some good stuff in my PHP. It posts back to itself, so I only have one PHP source file. It also detects weird conditions like the database is missing, or there are no matches for your query. I will post the actual user interface in a little while after my partner does her part.

PHP Promotion


I am two weeks into my PHP Programming college course. I am writing small PHP code snippets in my HTML files now. To run the code on my machine, I decided to install WAMP. This gave me automatic installations of Apache, MySQL, PHP, and so on.

To start with, I am just dropping HTML files with PHP code into the root Apache web server. That way I can access them via localhost using my browser. As soon as I started making changes to my PHP code to fix bugs, I found some annoying behavior. I click refresh in Internet Explorer. However the browser just shows the results from the old PHP code.

I eventually found a work around. I could click the Back button in IE, then the Forward button, and finally Refresh would work. That was just too many steps to see the latest output from my new code. I was using Internet Explorer 9. But I doubt that version had anything to do with the problem.

I emailed my instructor. He told me to see him after class. Doh. There he walked me through some settings to jiggle in IE. Specifically I chose Internet Options from the Tools menu in IE. Then I clicked the Settings button under the Browsing History group. There I clicked the radio button that said "Every time I visit the web page" under the "Check for new versions of stored pages" label.

Turns out the default value of "Automatically" does not check for new versions of stored pages. I found this to be a weird location for such an option. But I am just glad that every time I click Refresh, IE actually does refresh my browser with a new run of my PHP code.

JavaScript Library Performance Penalty


Just checked out a deck by Nicholas C Zakas. He shares his insight in making modern web pages load fast. Apparently this is not rocket science. These days a lot of JavaScript library code is downloaded before the page finishes loading. Not all of that code is required up front. You should just download what you absolutely need on page load. Then grab other JavaScript library code on demand. Why didn't I think of that LOL?

Luckily I do not depend on heavy JavaScript libraries in my own code. Heck. I sometimes don't even use jQuery. Yes that is a recipe for pain. But sometimes you got to roll with just your own code. Makes for a quick page load time. You are in full control.

Making JavaScript Fast

The good folks over at Mozilla have posted many tips on how to make JavaScript fast in Firefox. Many of these ideas can speed up JavaScript on any browser. One interesting point was to avoid a lot of local storage calls. Otherwise your main thread gets blocked slowing everything down. That makes sense. Instead you should access a cache of local storage data that is held in memory. Nice.

XSL Plus Local Links

We are coming to the home stretch of my XML college class. The current topic of interest is the eXtensible Stylesheet Language. At first XSL seemed a bit confusing. Like XML Schema, it was not a simple topic if you don't know what the heck is going on. Luckily we got a few homework assignments that are driving the points home.

My latest chore was to produce a list of unique cities from our big file of XML data. No trouble. I put together a little template that compared the current node to the preceeding ones. Any dups got culled, leaving me with a unique list. Simple to put it in order with too. We also needed to show all the raw data, grouped and sorted by city. Another template took care of that in short order.

Next came what seemed to be the tricky part. The unique city listing needed to be comprised of links that took you to the section in the raw data there people from that city are listed. I figured I needed a link to a local in my HTML file. Just need to generate an ID, and reference that ID. And what better a way to generate these anchors? XSL templates of course.

I wonder how some of my other classmates are doing. Some of them got stuck in the XML Schema assignments and never came out. I just hope they know their HTML. It is a requirement for this course.

Almost a Hoodie Ninja


I just read some info on the Hoodie library. This thing claims to let you write web apps quick. One fun thing was that it stores stuff locally, and can work even if you are online. A lot of the sample code looked positively simple. Can this possibly work? I don't know. But it has my interest.

Then I came to the following declaration:

Hoodie is currently a developer preview. Some features are missing, some things might change, there's a lot of optimization to be done. Don't use this for production.
Oh snap. That did not instill confidence. I guess it is nice to get an early look at what they might have going. But I don't fool around much. I write code that I want to ship now. Perhaps I should wait and see how Hoodie pans out. Too bad. It seemed pretty cool.