On:

I listen to music all day long as a work. The beat keeps me moving like a caller keeping rowers synchronized.

While I pay for Apple Music streaming but also have a big mp3 library which is aging. When I removed the mp3s leaving only streamed tracks, my Playlist lost many of my favorite Artists. That lead me to creating a Smart Playlists of Artists.

Just like when I write code for Web Apps, I broke the problem down to individual steps...

Step 1: Copy all the tracks in the playlist to the clipboard. Paste into a text file, open in Excel, copy the Artist column, paste into another text file and save as Artists.txt.

Step ...

On:

FMDump Migrator was able to generate Xanadu PHP code to import data from FileMaker into existing MySQL tables today!

I've migrated tables manually quite few times and wanted to automate for a while. The automation took a bit, but I think I could now migrate a bunch of tables in a day depending on how much it needed massaging. In Step 2 you can see five massages.

It's so easy now. FMDump from FileMaker to MySQL Create/Insert statements. Load the Dump files to MySQL. Then Migrator can use the Create statements to generate the SQL for new columns and PHP to set and massage the data.

I recently was helping a client with a migration and they refused to have a migration process since the import was a "one time thing". ...

On:

Yesterday I needed a PHP password generator for the soon to be migrated FileMaker users logins. I found a list of nouns and needed a random picker. A file seemed better than in memory. AI then suggested going to a random byte, then getting the next line which is fast even with large files!

PHP

PHP as Text

function strRandomNoun() {
    // Open File
    $filePath = PATH_ROOT_XAN . 'data-nouns-2315.txt';
    $fileSize = \filesize( $filePath );
    $file = \fopen( $filePath, 'r' );

    // Loop
    do {

        // Random Noun
        $randomByte = \random_int( 0, $fileSize - 1 );
        \fseek( $file, $randomByte );
        if ( $randomByte  ...
On:

FMDump for FileMaker is getting a helper tool called FMDump Migrator! It helps to import a table into an existing table. Paste in the CREATE RECORD statements, match up columns, or add and match.

When ready it will export MySQL to create columns and PHP to loop and "set fields". Here's a quick demo!

On:

Today on a FileMaker Reddit Post, I was asked what the code looks like. I start with a selected Contact record and starting with index.php, I show an over view of the code path and the code for the Contacts Info Card.

It's interesting to hear similar stories from fellow Developers like on that Reddit Post. FileMaker and Xojo have both, but separately, raised pricing. No official announcements have been made from ...

On:

We've been converting FileMaker databases to Xanadu Web Apps over the past few years. One conversion category is Reports. Reports vary, but there are four types:

  • 'Simple' with zero or minimal parameters with a simple query.
  • 'Flexible' reporting on ad hoc record sets with a simple query.
  • 'Forms' with data placed at specific coordinates.
  • 'Customized' with complex formatting, more than one format, or multiple queries.

For most reports, we use mPDF, a popular open-source PHP library for generating PDFs. We'll create a header, footer, and body in HTML using CSS for the styling and applying ...

On:

Today I read that Opera Development Browser added local AI. I ended up deleting it after trying it since it was in a window within the browser. Afterwards, I tried LocalAI.app and a few others and found Ollama!

Local AI's are interesting in that if the internet is down, you still have access to it. In our Xanadu Web Apps, we use local libraries as much as possible so it's less likely for a resource to disappear. Nothing is worse than going to run your app and not be able to if a Google Font cannot be reached. There are some things that cannot be local like payment processing, address correction, etc.

Ollama is interesting. Downloads ...

On:

Bootstrap rocks but sometimes you need more colors. Named Colors are a great solution.

Included are css files that can be included for Bootstrap like colors:

  • color-bg-AliceBlue
  • color-border-AliceBlue
  • color-text-AliceBlue
  • color-text-bg-AliceBlue

List of Named Colors with Color Swatches: https://www.w3.org/wiki/CSS/Properties/color/keywords

color-bg.css:

.color-bg-AliceBlue { background-color: #F0F8FF; }
.color-bg-AntiqueWhite { background-color: #FAEBD7; }
.color-bg-Aqua { background-color: #00FFFF; }
.color-bg-Aquamarine { background-color: #7FFFD4; }
.color-bg-Azure { background-color: #F0FFFF;  ...
On:

Reposted from INN: https://ifnotnil.com/t/php-for-xojo-programmers-0003-variables-from-the-url/1733

URL Variables

This time we'll work to add variables to the URL like "/products.php?item=widget" rather than create one page for every product. We could have 500 products and only need one PHP page and one HTML Template.

When we talked about Includes we had three files "template.htm", "helloWorld.php", and "helloEarth.php". That worked well but now let's now use variables to replace the need for multiple PHP pages.

Prep

Start off by duplicating "helloEarth.php" ...

On:

Reposted from INN: https://ifnotnil.com/t/php-for-xojo-programmers-0002-includes/1727

Includes

This time we'll talk about "includes". Includes are a way to pull in a file into the current file to reduce repetitive code or templates. Below we'll show how to make a simple template and use it.

We use Includes in Xanadu which is open source: https://github.com/campsoftware/xanadu

Here's Xanadu's template for almost every page. It'll look overwhelming, but broken down it's a simple template as well. https://github.com/campsoftware/xanadu/blob/master/templates/page-resp.php

Previously...

Last ...

On:

Reposted from INN: https://ifnotnil.com/t/php-for-xojo-programmers-0001-hello-world/1726

This is the first post in a series about PHP from a Xojo perspective.

I'll be showing how I developed different parts in detail of Xanadu which is open source: https://github.com/campsoftware/xanadu

Hello World!

When I first used Xojo I did the same thing you probably did. I dragged out a button and when clicked it showed a message box that just said 'Hello World'.

Think about what Xojo might be doing to make this work.

  • Define the page, even if blank
  • Define ...
On:

Fav Icons make identifying Web Apps clear in Browsers, Bookmarks, and saving to the Home screen. Generating Icons is easy!

First create an image file for your icon that's large. It should be square and at least 512px by 512px. Going larger is good like 1024 by 1024 so you can regenerate the icons in the future as devices demand larger images.

There are many tools that can create icons for you where you just upload your image and get back some html and several image files in different formats.

One free service is https://iconifier.net, shown below.

Along with the icons, you'll also receive the ...

On:

NOTE: Since posting this, we've made Xanadu semi-private.

Xanadu is reincarnated as a Web App developed in PHP / HTML / CSS / Bootstrap / Javascript. If you haven't heard of Xanadu it's a framework for developing Database Driven Web Apps.

It's been a long road, but Xanadu is a good place now. If you haven't heard about the speed bumps we hit with FileMaker and Xojo, we posted a bit about it last year. Not much has changed with FileMaker and Xojo since. FileMaker is still very expensive for Small Businesses as they focus on Enterprise. Xojo released Web 2.0 over the past year in pre-alpha quality. While Xojo has been ...

On:

Retrieves the GPS coordinates of the Browser.

  • Uses an inline callback.
  • Normalizes the output.
  • Makes the async call feel like a sync call, but it's still async.
  • This is a good template for similar async calls.

On Github: https://github.com/campsoftware/locationGet-js

Calling Example

xanLocationGet( function ( coords ) { alert( coords[`ErrorCode`] + `, ` + coords[`ErrorDesc`] + `, ` + coords[`Latitude`] + `, ` + coords[`Longitude`] + `, ` + coords[`Altitude`] );

Function

function xanLocationGet( pCallbackFunction ) {
    // Calling Example
   ...
On:

Gets a semaphore and attempts to acquire to prevent code from running more than one time.

  • Aborts if the semaphore cannot be retrieved.
  • Aborts if the semaphore in use.
  • The key must be an integer.

On Github: https://github.com/campsoftware/semaphoreCheck-php

On:

It's been a while since my last blog post. There's a reason for that. Software Development has been disappointing, but after five years, I'm ecstatic again!

Why? I think it has to do with greed along with a lack of communication. I'm just glad to see the pattern and have the technical ability to change development platforms.

As developers, what do we need? That depends on the app. Some apps are hardware generic while other apps need specific hardware features. We primarily develop database apps where folks view/edit data, print to paper or PDF, and document management. There aren't many specific hardware feature we need other that being able to work offline when internet isn't available.

There are lots of app types: Desktop ...