Sunday, August 7, 2011

The Lost Coconut Tree and a Bee

This Sunday morning after breakfast I decided to weed the "weed patch". Everyone of our plants was absolutely filled with them. Mind you we have about 20 potted plants.

Our new lawn guy (I used to be the old lawn guy) doesn't take care of them, nor does the flower beds and I let them get away from me.

So I was checking out this coconut tree I have had since 2001 in a pot. I actually brought it back from Big Pine Key to Ohio on the last big "family" trip down there (we stayed a month). I grew this tree in a pot from the nut.

Well, I think it got sick and had a lack of water this last dry season and didn't recover. It saddens me as I had come to think of the tree as Mason's tree (our first son, born an angel). My old boss had suggested I buy him the book Chicka Chicka Boom Boom where the letters go up the coconut tree. See the connection?

Well, as I investigate the tree to verify I cannot save it, I sigh and realize it's time to move on. As I look up, I see a small honey bee buzz on the flowers next to me. We never, NEVER see honey bees. That means something is growing and food is being produced.

Life moves on.

~Jeffrey

Vibes at the farmers market

Saturday Jessica, Parker and I were coming back from breakfast at Annie's (local greasy spoon in Cape Coral - decent price and portions, bad coffee, and friendly service) and decided to pass up the house and head to Cape Harbor (BTW Cape Harbor, somebody else has your domain name now) for their summer farmers Market.

Well, after getting some green beans and sweet potatoes, we went to look at the non food vendors. There were two next to each other that caught my eye.

The first was a guy selling items (wood, shells, cloth) laser etched with images. Apparently he did it with "some program" after doing the images in photo shop. I found it interesting he was very secretive about this "program", as it reminded me of some of the inventors at the Edison Inventors Association. Fair enough.

The second man and his wife were promoting his website SloopScoop.com. Now if you are a boater here locally, and have looked up tide charts from NOAA, you know they are not the most user friendly looking things in the world. Well, Brian Fuller and his wife Kim made them friendly (coincidentally, Brian is also they guy responsible for the Newspress' Hurricane Tracker App). Brian showed me how things worked, and we talked shop on development and mobile programming. A very different vibe than the first fellow.

I personally like Brian's approach much better than the other fellow's. It probably comes from working in computers with open source. I do think he will do well with it on his new website. I wish them both good luck.

Jeffrey

Friday, August 5, 2011

Nerd Post: Hacking Wordpress's admin pages to add a hidden link

As some of you know, Kinetic Thoughts is working in partnership with another firm to produce some niche Wordpress plugins. In creating the plugins, we wanted to create an admin menu, with sub-menu entries. No problem. Wordpress has mechanisms for that.

Now, when you add in a menu choice (or sub-menu choice) the URL generated when the menu is click is something akin to: http://host/wp-admin/admin.php?page=your_custom_menu_handle

This handle is actually created with the code like (assuming it is a sub-menu, the menu's function has a slightly different signature):

add_submenu_page(
'my_plugins_toplevel_link'
, 'Page Title (seen in browser)'
, 'Menu Link Text'
, 'administrator' //security level
, 'your_custom_menu_handle' // here's the page handle for page one
, 'page_callback_function' //the function that renders this menu's page
);



Now, I want to get to my sub-menu page and preserve the URL structure of:
http://host/wp-admin/admin.php?page=your_custom_menu_handle
One way to do this is to add a sub-menu entry pointing to your first sub-menu's handle:
add_submenu_page(
'your_custom_menu_handle' // set the parent to your first page and it wont appear
, 'Hidden Menu Page Title (seen in brower)'
, 'Hidden Menu Link Name' // unused
, 'administrator' //security level
, 'your_hidden_menu_custom_handle'
, 'hidden_page_callback_function' //the function that renders this menu's page
);



I want to thank the guys on this post at StackOverFlow.


This works quite well. Now I don't condone hacks usually, but sometimes you just got to get to the MVP (Minimum Viable Product) and fix things later. More than likely, Wordpress was coded to allow for multiple levels of sub-menus, but only displays the first. Something to investigate in the future.

Nice, huh?

Jeff

Wednesday, August 3, 2011

A Thought on Life Planning

This is not a brag, but I have taken quite a few higher education classes.

The opening day was almost always started with introductions of your name, what you do (or it is volunteered) and what would you do if you won the lottery.

Most people answer (and these are weighted):

1.) Travel
2.) Pay off bills
3.) Take care of my family
4.) Start a charity

Got me thinking that most people really don't know what they want to do in life.

It seems perhaps they just flow through life with a loosely devised plan of what they think they should follow (or what someone else thinks they should follow).

Many don't expand their thinking and thus life planning using Creative Problem Solving (CPS), SWOT analysis, or even just deferred judgement brainstorming.

I think more should.

Monday, August 1, 2011

Nerd Post: Mixing it up with the Custom List Table Example and $wpdb

Here at Kinetic Thoughts, we have been working in partnership with another firm to produce some niche Wordpress plugins. Without getting to much into the "niche", I want to talk about a slight "gotcha" I found today in trying to hook up the WP_LIST_TABLE class to other tables in the $wpdb




Now, for 3 really great background information sources, I would suggest investigating the following:


1.) Download the Custom List Table Example and inspect fully (and read the comments!).

2.) Theme.fm's article on Column Hacking

3.) $wpdb's Class reference



Now, I am not going to get into give step by step code - there is enough in the above links to get you started. What I do want to give you is one of those small tidbits that sometimes are implied, but get missed.



If you were to copy and modify the Custom List Table Example and attempt to use the $data = $wpdb->results("select column1,column2,column3 from mytable"); you are going to get a couple of weird errors.



Why? Look closely at the $wpdb's link above. It is actually pointing to the function get_row(). Notice the 3 constants? Those determine the returned datatype. You want ARRAY_A. Simply change your code to: $data = $wpdb->results("select column1,column2,column3 from mytable", ARRAY_A);

That's it.



Nice, huh?



Jeff