amf_programming

Computer Programming / Development

On Software Developer Limits

As a matter of fact, if you try to launch an unsigned or unvalidatable app on a Mac with Gatekeeper enabled, the default button is “Move To Trash”. Pretty hardcore. Kind of awesome.

Panic, the developer of my favorite code editor on Mac, wrote a great review of the need for the recently announced Gatekeeper feature, which protects Macs from villainous programs/code.  While I don’t do any Cocoa or Carbon development (I’m all web-based, baby …) — this feature sounds like exactly what’s needed.

Mac users will proceed at their own risk … knowing Apple has their back.

Bible Taxonomy – AJAX / WP Integration

BibleTax_Featured_5
Note: This post is series explaining how I created the new Bible Taxonomy tool as seen on DiscipleShare. To see it in action, or to find great, free curriculum to use in churches, visit: http://www.discipleshare.net/

So how does the user input get saved dynamically to the database? It already happens in a similar way with post tags. Users enter them on the fly and they’re processed and the user interface is updated without needing a postback or page refresh.

The hard part was figuring how to tap into the existing AJAX / PHP functions from my child theme. After some deep, deep digging, I found the interactions in the WordPress core.
« Continue »

Bible Taxonomy – Parsing Input

BibleTax_Featured_4a
Note: This post is series explaining how I created the new Bible Taxonomy tool as seen on DiscipleShare. To see it in action, or to find great, free curriculum to use in churches, visit: http://www.discipleshare.net/

Here’s a confession: this part of the plugin is only half-baked. It’s a work in progress.

Users can select Books, Chapters, Verses using the Javascript tool. But what about quick entries? Surely a good user interface maximizes keystrokes and minimizes mouse clicks, right?

Well, I tried. The issue is how many permutations of entry types I’d have to deal with — let alone the abbreviations and commonplace names of books that I’d need to check for.

For instance, how many ways can you cite a scripture reference?

  • B
  • B C
  • B C:V
  • B C-C
  • B C:V-V
  • B C:V, V
  • B C:V – C:V
  • B C:V – B C:V
    B = Book, C = Chapter, V = Verse. And this obviously doesn’t account for other styles of notation (such as using a period (.) instead of a semi-colon (:) ).

    « Continue »

Bible Taxonomy – User Interface Look

BibleTax_Featured_3
Note: This post is series explaining how I created the new Bible Taxonomy tool as seen on DiscipleShare. To see it in action, or to find great, free curriculum to use in churches, visit: http://www.discipleshare.net/

The Bible’s BIG. 32341 elements in the XML file, to be exact.

The WordPress custom metabox spaces are pretty small. I started out wanting to put this in the side panel on the Admin screen. How do I fit that many elements into a 300px width and not have the page go miles and miles deep?

Javascript was the easy solution — but not so-easy was figuring out what UI tools I could use within the JS. I started with tables, bot those became clunky and inconsisted very quickly. Plus, they broke horribly. I wanted it so that if the user shrunk their window < 800px wide then they'd still be able to have the tool degrade gracefully (and maybe even still work). Tables were shooting off the edges and messing up the spacing. Fluid web design != tables; and in this case, it didn't even = div tags. I did it with unordered lists (ul) and list-items (li) carefully controlled by the CSS. « Continue »

Bible Taxonomy – User Interface Data

BibleTax_Featured_2
Note: This post is series explaining how I created the new Bible Taxonomy tool as seen on DiscipleShare. To see it in action, or to find great, free curriculum to use in churches, visit: http://www.discipleshare.net/

So the CSS was the eas(ier) part. Then came the Javascript. It had to be snappy and non-clunky.

I started out trying to parse the XML with my own logic. Not a good idea. I used the JQuery framework to get it working. Here’s the resulting JS code snippets with commentary:

« Continue »

Bible Taxonomy – Start Off Right (Minimized XML)

BibleTax_Featured_1
Note: This post is series explaining how I created the new Bible Taxonomy tool as seen on DiscipleShare. To see it in action, or to find great, free curriculum to use in churches, visit: http://www.discipleshare.net/

To start, I looked for data objects that already existed for the bible on the internet. I looked at using existing APIs for popular online Bible services, but didn’t find any that offered the backend database support I’d need for relational tables in MySQL.

I googled “NRSV xml” and found some good stuff, including a file that’s no doubt a copyright violation and might be taken down at any time.

(If starting over, I’d use the SBL GNT or a KJV version that’s now public domain)

« Continue »

Launch – discipleshare.net

DS_Evolution_featured_image

So I dropped the ball. In announcing all the sites I rolled out and launched for different organizations in the fall, I forgot to tell about my pet project.

DiscipleShare

« Continue »

Every ms counts

JSON-Bible-Object

I’m trying to teach myself this workflow and how to get all of the code to interact.

The red connection and path are what I just stopped on.  The JSON is working like a charm.  In creating the PHP Web Service, I ran into a bit of an obstacle with large sections of scripture verses.  The XPath query on the Full XML File was getting taxed pretty hard when iterating through the bible’s data structure with a do-while loop.  Returning over 300 verses and here’s what the do-while loop looked like:

Do-While Loop

The do-while loop was iterating through the xml nodes linearly (since the bounds are known by the bible verse locations).  It had to do a switch statement on the node type to determine how to output the JSON.  Needless to say, it was a lot of operations for every node.

Instead, I changed it to target the XPath so it iterates with the exact path, already knowing every node type.  The difference was dramatic:

For Loop

My next step is to finish connecting the PHP code to the database (green line).  Then, once I know it works, I’ll put it into a WordPress plugin.  Hopefully it will be live on DiscipleShare before 2011!

Custom Bible Taxonomy – Fail

bible_taxonomy_fail_1_thumb

I’ve spent a couple weeks’ free time building a custom Bible verse tagger for curriculum on DiscipleShare.

It’s close, but not close enough that I can post the code for other developers to use.

Right now I’m keeping it out of the WordPress structure.  It’ll eventually be its own taxonomy plugin for a WordPress database — so users can tag with scripture verses and have them database-searchable.  But for now, it’s just a simple Javascript/XML parser (with some wicked CSS to make it great amongst all web browsers).

As you can probably guess, the “green” box is to set the starting verse; the “red” box is to set the ending verse.  Yep — there’s a problem in the logic.  Two steps forward, one step back.  :)

More to come.

Finally! Feeds in Facebook Notes

Feedburner_Facebook

I thought I’d never solve this.  I was event tempted to use a 3rd-party app in Facebook to get this solved.  For weeks I’ve run into errors with the Facebook notes importing tool.

The gist of the tool is simple: give us your blog address and we’ll import any new content and sent traffic your way.

For my blog, it’s not a BIG deal (I don’t have many readers).

But for my regional position, this is huge!  Users on Facebook can see anything added to the site without remembering to check the site for updates — or without needing to subscribe to the RSS feed.

So here’s the trick to getting Facebook to recognize your RSS feed from WordPress blogs:  act like protocols don’t exist.  Don’t put an address (either from the blog or the feed) where it begins with anything before the //.

Good luck!