Wednesday, February 28, 2018

FileMaker and Python Micro-Services

Note to readers:  As a followup to the FileMaker and Java Micro-Services post from last Friday, today's post from FMP Dude shows how to use Python and Flask to create micro-services.  This post also appeared  first on the FileMaker community website, and is reposted here with his permission.  So, if Java isn't for you, the same micro-services are available using Python.  Enjoy!


The Simplest Micro-Service!  (Python and Flask)


If you want to start using micro-services in FMP, consider Python and the super simple framework: Flask. If you're unsure what benefits micro-services give you, check out this list below:



Key benefits of micro-services include:
  • Uses industry standard protocols (HTTP verbs!).

  • Enables you to tap into powerful modern languages.

  • Easy to Learn.

  • No need to "re-invent the wheel" in a proprietary FMP-only CF to duplicate existing tested/free library routines.

  • Cross platform so the service can reside ... anywhere (Linux, Mac, Win). Local/WAN, Server, you name it.

  • Allows any application that can do a GET to use the service (Terminal, FMP, Firefox, Opera, Chrome, ....)

  • Is FREE. No expensive FMP-ONLY plug-in(s) needed. Install anywhere or everywhere. 1 user or 10,000 users...FREE.

  • NO FMP plug-in installation and configuration for every copy of FMP you might have.

  • NO restrictive plug-in license agreements.

  • Extremely powerful (get the full power of free third-party libraries often written in fast C language)

  • Puts you in charge of the service code. Not a third party.

  • Service Code Runs .... FAST!

  • Externalize loops to keep loops out of slow FMP scripts.

  • Service programming tools manage dependencies --- automatically!

  • Offers high abstraction. The caller of the micro-service doesn't need to know any details how the micro-service code works. Parameters can almost always. be passed simply letting the micro-service handle translations or other messy details.


(Note: Most modern programming languages, including Java snd Python, support micro-services.)

------------

Below is about the simplest micro-service you can write.

NOTE: this service example below isn't intended to be "production ready"-- as you'd certainly have much more error handling and other code. Instead, the example code below is just a "see how simple it is to get started and see all you can do..." kind of thing.

(You will need to have Python installed, of course and you will need to install Flask. Check out "pip" and other simple installers for python add-ons like Flask.)

Python micro-service starting point code below:

from flask import Flask, request


import hashlib

app = Flask(__name__)

@app.route('/')

def hello_world():

   return 'Hello World!'

if __name__ == '__main__':

  app.run()

If you save the code above into a file called, for example: "simple.py", and then run it from the command line, you have a Python (starting point) web service you can call from FMP!

Running this code gives you this output (you can change the port if you need to:

$ python3 simple.py

* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

(the service is up!)

Let's give this micro-service a workout:


From Terminal: $ curl localhost:5000

Output: >>> Hello World!

----

From POSTMAN:



 

From the IDE built-in REST Client:



The browser works fine, too.

 

From FileMaker:

 

INSERT FROM URL only needs one line since we're not sending data: "http://localhost:5000"

 



 

And, in the IDE where the service is currently running (can also start from command line and other options), we see our call to the web service from FMP:

 



--------

Let's add a method to do a hash.


 

Just create a simple method in your web service code and run it again:

 

@app.route('/HashMe', methods=['GET'])

def hashMe():

stringToHash = request.args.get("password")

m = hashlib.sha3_512()

m.update(str.encode(stringToHash))

m.update(b" Some Salt here for more security!")

return m.hexdigest()

----

Note: if we had also imported the pyperclip library, we could also, with one line of code, copy our hash to the clipboard:

pyperclip.copy(m.hexdigest())

----

From POSTMAN:

So, in just a few lines of code, we added a hash method we can call from any application that can do a GET!

Conclusion:


Using, in this case, Python, and the super simple framework Flask, in just a few lines of code you can have a working web micro-service.

My advice: Start easy. Start small. Build from there.





Education is not preparation for life; education is life itself.

John Dewey


Wednesday, February 21, 2018

2018 UX Design Trends

UX Design Trends and FileMaker


What's happening in the UX design world for 2018?  What can we learn from the latest trends and how (and should we) apply it to FileMaker database designs?

Let's take a quick look.

Shopify Predictions


Shopify's Oliver Lindberg delves deep into the subject, covering topics from variable fonts to ethical design to the death of the home page:
Last year was very much about web animations and microinteractions, conversational interfaces and chatbots, design sprints and bespoke illustrations. Even an approach that rejected mainstream web design trends became a trend itself: brutalism.

All of these trends are going to grow in 2018. In fact, Andy Budd, co-founder of pioneering UX consultancy Clearleft, thinks the subtle shift from UX design to digital service design is going to continue, and that we’re going to see much more interest in the field of service design from the digital sector this year.

Of particular interest to me is the Brutalism trend, which is basically turning away from the snazzier design trends:

 

[caption id="attachment_19622" align="aligncenter" width="443"]Brutalism Design Brutally simple.[/caption]

As you can see from its description, it is brutally simple.  And increasingly popular.   Something FileMaker developer's might want to emulate, mainly because a simple interface without a lot of pizzaz might be easier on the senses of someone pounding away at data entry and analysis. Be warned, however

Flat Design


Depending upon who you read, flat design is changing to adapt to 2018 trends by "adding nuance and depth to its prior ascetic identity", also known as adding more color, or is finally dying.  I am hoping for the latter:  I never liked it and the sooner it goes away, the better.  One thing younger readers will find as they get older is that the ability to easily discern contrast fades.  Flat design is low contrast and harder to read/view.

[caption id="attachment_19632" align="aligncenter" width="300"]Flat Design Flat design can by much harder to see for some.[/caption]

Fortunately, FileMaker moved away from it after a brief affair.

Inclusive Design


The shortcomings of flat design lead naturally to inclusive design, a movement deservedly gaining momentum:
These Inclusive Design Principles are about putting people first. It's about designing for the needs of people with permanent, temporary, situational, or changing disabilities — all of us really.

Inclusive design features the following principles:
  • Provide comparable experience
    • Provide alternatives like alt text, audio, etc.


  • Consider situation
    • Color contrast for outdoor users


  • Be consistent
    • Use consistent design patterns to build familiarity


  • Give Control
    • Allow zoom, for example


  • Offer choice
    • Consider providing different ways for people to complete tasks


  • Prioritize Content
    • Progressively reveal features and content when needed, not all at one time


  • Add Value
    • Using voice interfaces to control multimedia



There is much more to inclusive design than listed here, much of it applicable to FileMaker database development. I highly recommend a closer look.

There's much more


I've run out of time to cover all the trends and possibilities, but here is a partial list to consider in your design efforts
  • Artificial Intelligence

  • Video

  • Ethical Design

  • Voice User Interfaces

  • Scrolling effects

  • Typography

  • Mobile Animation

  • Storytelling

Sources:

10 no-nonsense web design trends for 2018 | Econsultancy

UX Brutalism

Inclusive Design Principles

Still more info:

Design Trends 2018: 28 leading designers, creative directors & illustrators tell us what’s inspiring them for the year ahead



Design is a funny word. Some people think design means how it looks. But of course, if you dig deeper, it's really how it works.

Steve Jobs

Friday, February 16, 2018

Using FileMaker and API's to Connect to the Web

FileMaker and API's


Chris Ippolite, of iSolutions fame, and FileMaker, joined forces to make this webinar back in November.  If you need to connect FileMaker to the web, this webinar shows several practical examples of how to do it:
  • Integrating with Slack

  • Integrating with Zillow

  • Integrating with Mail Chimp

  • Integrating with google Calendar

  • Integrating google Maps and street view

  • Using the FileMaker Data API as a data source for hundreds of thousands of users!


That last item connects FileMaker to Nodejs to a special caching service to scale up to enterprise level.  Did you know FileMaker could do that?

There's also a bonus:  a free FileMaker Example file: the Books database uses the FileMaker Go's barcode scanning and the google books API to retrieve the data from the books barcode.  You'll have to get your own google API Key to make it work, but that's a pretty straightforward process.

Don't Be Intimidated


Viewing the connection process that goes on behind the scenes is scary the first time you look at it...just remember that most of the work is done in one script step:  Insert from URL.  A lot of the rest processing the returned data into FileMaker by parsing JSON into FileMaker. Spend some time working through this script and you'll pick up a valuable developer skill.

See the Power


Kudos to Ippolite and FileMaker for powerfully showing how connecting FileMaker and API's dramatically increases usability for your clients.

 

[embed]https://www.youtube.com/watch?time_continue=35&v=utkfFYIdXyU[/embed]

If you want to learn more about using FileMaker and API's, click here to see all the posts I've made in the past on this subject.  Enjoy!


Something important for developers to remember:

The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do.

Ted Nelson

Wednesday, February 14, 2018

You Are Paid to Solve Problems, Not Write Code

Solving Problems is Your Job


Most developers fall in love with writing code and making computers bend to their will....and of course solve problems.  But the reality is that most developers are paid to solve problems, which means much more that bringing coding skills to the table.

The successful programmer must learn much more than how to code to be successful:
  • The ability to communicate (very important!)

  • The ability to listen effectively

  • The ability to identify the problems

  • The ability to apply logic to solve a problem

  • And, finally, the ability to code efficiently in order to solve problems

You Can't Code in a Vacuüm


After applying all the skills you need to acquire, you still have to interact with others in a way that helps you succeed:
  • Working with your co-workers, client, and project manager

  • Keeping track of your time and effort

  • Commenting in your code to allow others to follow/improve/fix it

  • Learning the tools (and improving them) that allow you to interact effectively

  • Setting and meeting expectations with your client(s) and team

Keeping up with the Jones's


Don't forget that to do your job, you need to keep up to date with your skills:
  • Attend seminars to learn and to network

  • Read and apply new techniques

  • Study communication skills

  • Improve personal relationship skills

Improve your management skills


Most coders (sadly, say some) eventually move into management.  That's another whole set of skills that use many of the skills outlined above, so the transition will not be that difficult to master should you take that path.  What do you need to make that leap?
  • Study management techniques

  • Develop interpersonal skills

  • Learn how to become a mentor

  • Learn how to manage and support a team


As you can see, coding is just one important skill set of many if you want to be a successful programmer.  Just as you've learned to code, you need to now set new goals to be the best coder you be.

Good Luck!

Inspiration for this post came from Hacker Noon:  You Are Not Paid to Write Code – Hacker Noon


The best advice I ever got was that knowledge is power and to keep reading.

David Bailey

Monday, February 12, 2018

FileMaker, Spectre and Meltdown

FileMaker, Spectre and Meltdown


I haven't seen a lot of coverage on FileMaker, Spectre and Meltdown issues as they pertain to FileMaker server (and Wordpress, for that matter), but there are some guidelines and some safe practices to follow at this time.  The situation seems to be changing rapidly as more fixes are implemented and the true extent of the threat is revealed:
Meltdown was issued a Common Vulnerabilities and Exposures ID of CVE-2017-5754, also known as Rogue Data Cache Load,[2] in January 2018. It was disclosed in conjunction with another exploit, Spectre, with which it shares some, but not all characteristics. The Meltdown and Spectre vulnerabilities are considered "catastrophic" by security analysts.[10][11][12] The vulnerabilities are so severe that, initially, security researchers believed them to be false....Meltdown is a hardware vulnerability affecting Intel x86 microprocessors, IBM POWER processors, and some ARM-based microprocessors.[1][2][3] It allows a rogue process to read all memory, even when it is not authorized to do so.

Meltdown affects a wide range of systems. At the time of disclosure, this included all devices running any but the most recent and patched versions of iOS,[4] Linux,[5][6] macOS,[4] or Windows. Accordingly, many servers and cloud services were impacted,[7] as well as a potential majority of smart devices and embedded devices using ARM based processors (mobile devices, smart TVs and others), including a wide range of networking equipment. A purely software workaround to Meltdown has been assessed as slowing computers between 5 and 30 percent in certain specialized workloads,[8] although companies responsible for software correction of the exploit are reporting minimal impact from general benchmark testing....

Further, recommended preventions include: "promptly adopting software updates, avoiding unrecognized hyperlinks and websites, not downloading files or applications from unknown sources ... following secure password protocols ... [using] security software to help protect against malware (advanced threat prevention software or anti-virus)."[23][24]

For more up to date information, keep an eye on Wikipedia.

Servers are most vulnerable


This threat is real and will affect anyone with FileMaker servers on Mac or Windows, and cloud based servers as well (yes, even AWS).   Amazon issued a notice of fixes as it relates to Linux just last week.

Computer Weekly offers a somewhat more current take from January 18th and is worth a read, covering actions taken or planned by Microsoft.

What to do?


Tim Cimbura offered up some concrete advice recently in his post, Meltdown and Spectre Security Issues: What FileMaker and WordPress Users Need to Know - LuminFire:
From a FileMaker perspective, the impact may be a slow down at the application and server level. Estimates vary that it could be from 5%-30% but early reports are that the real world effects are not noticeable (unless your server is regularly running close to full load, which is not a best practice).

Stephen Blackwell started a thread that contains some useful links and advice for FileMaker users, as well.

The Bottom Line


Update your servers and software apps and keep them updated.  Increase server resources if your servers are running a heavy load.  And keep an eye on the issue – don't let it get lost in the daily shuffle.  Or you may end up with a massive security problem.

Friday, February 9, 2018

Build a Dynamic FileMaker Navigation Bar

Dynamic FileMaker Navigation Bar


Mike Duncan updated his ten year old dynamic FileMaker Navigation Bar, and it's pretty awesome.  And he included a free FileMaker Example File, as well!

(Looking for more ideas for FileMaker Navigation Bars?  Click here.)

Duncan's solution is easy to implement, loads fast, and changes if you change the order of your layout.  It also includes the following features:


    • Works in Browse and Find mode

    • Uses Themes and Styles

    • Allows manually navigating to layouts

    • Works in List View<

    • Works in Pro (both local and hosted), Go, and WebDirect

    • Works with multiple windows

    • Works natively (no plugins required)

    • Does not require additional schema

    • Handles a reasonable number of layouts

    • Minimal scripts required

    • Does not require custom functions, which is better for portability

    • Retains the last visited sub-section, allowing for navigation of multiple tiers



This solutions supports up to three tiers of menus, supports emojis, and the looks are easy to format due the use of Button Bars.

I've put this on a list of things to do and will hopefully report back soon.

Source: How to Build a Dynamic FileMaker Navigation Bar - An Introduction




 



 

Wednesday, February 7, 2018

Connecting FileMaker to Web Apps

Connecting FileMaker to Web Apps


Ibrahim Bittar presented at FileMaker DevCon 2017 on a topic that should be of interest to all FileMaker developers:  connecting FileMaker to web apps:

https://youtu.be/VMVaqG_-1ho

The video details what is involved, how to connect, and walks you through the process.  There is a free FileMaker Example database set up to connect to Producteev. a free project management online database – one I have been using for years. I like this.

Here is what you will learn in this video:


  • The Basics of JSON syntax

  • How oAuth2 works – from a practical point of view

  • Use of cURL to send and retrieve data from a web application (cURL is very powerful)

  • FileMaker scripting and calculation tips

  • Free FileMaker example file


Jump in and take a look.  It's hard the first time, but gets easier as you do more (just like anything else).

Creating Your Own SSL Certificates For FileMaker – beezwax

Creating Your Own SSL Certificate


Simon Brown, beezwax developer, solves a use case scenario not allowed for with FileMaker's insistence on SSL certificates:  A company that has a nonpublic domain and wants to issue their own certificate:
Typically, you buy an SSL certificate for a server from a SSL vendor. However, some companies may decide that they want to issue their own SSL certificates. Often this is because the domain is only used internally, and most vendors don’t easily allow (if at all) the signing of server certificates for non-public domains. Additionally, issuing your own certificates can remove complications caused by the certificate verification process used by most vendors, and there are no fees needed for each certificate.

Although this use case is not supported by FileMaker, I had a client who had no choice but to use their internally signed certificates, and was having issues getting to work on their newly updated server, which had been working fine with FileMaker Server 15. Since I didn’t have access to the server (their security protocols did not allow that), I decided to go through the process of creating my own CA (certificate authority), using it to issue an SSL certificate, and see if I could install it on a test instance of a FileMaker 16 Server.

It's not an easy process, but worth knowing about if you should run across this problem in the future.

Source: Creating Your Own SSL Certificates For FileMaker – beezwax > blog

Monday, February 5, 2018

FileMaker 16 cURL, Ghost Sessions, Motivation

FileMaker 16 cURL


Sunday was a marathon problem solving day for a client, trying to find a way to export and upload a file via FTP to a phone calling service.  I had a working solution for over a year on this, but the update to FileMaker 16 broke it somehow – it had more to do with upgrading to Sierra, I think, since my solution used Automator, Fetch, and Calendar to work around the inability of FileMaker to upload to this particular service (that's a story for another day).

So I spent some time getting to better know FileMaker 16's new cURL features, and found some great advice and great tools out there (for pre-FileMaker 16 cURL, check out this post from last year).  The solution lies with the ability of FileMaker to send the contents of a container field via FTP without downloading the file first.

In this instance, I still have to generate a file using a server side script and upload it to a container field, but once that is done I am able to FTP the file quickly from the server.

Luminfire's Andy Walz and Tim Cimbura blog post and free FileMake Example file (at the link below) helped immensely. I highly recommend reading it and playing with that file if you need to use FileMaker 16 cURL.

Source: cURLing in FileMaker 16 - LuminFire


How to Disconnect Ghost FileMaker Sessions on Your Server


With the cost of FileMaker clients being a factor all clients consider, it's good to have a way to kill ghost sessions...What's a ghost session, you might ask:
When you lose your network connection or your FileMaker quits, sometimes your session doesn't drop off on the FileMaker server. This becomes a problem when that session hogs up one of your license spots. This doesn’t seem to happen often, but when I talked prentices to colleagues at the annual FileMaker Developer Conference, I learned it happens more often than we think.

Agnes Riley to the rescue!  Her solution is pretty technical (and, sadly, does not include an example file), but all the coding you need is there to help you save your client from purchasing unneeded licenses.

Source: How to Disconnect Ghost FileMaker Sessions on Your Server


How to Get Motivated When You Don’t Feel Like It


Most of you know by now that I like James Clear's writing on motivation and habit building.  Clear finds and explains the latest scientific information to help you improve your life, and is never a boring read.

Check out this post on getting motivated:
The most important part of any task is starting. If you can't get motivated in the beginning, then you'll find that motivation often comes after starting. That's why your pre–game routine needs to be incredibly easy to start.

For example, you could create an exercise routine that starts with filling up your water bottle. That way, when you don’t feel like working out, you can simply tell yourself, “Just fill up the water bottle.” Your only goal is to start the routine and then continue from there.

There's more at the link - read up if you have trouble getting going.

Source: How to Get Motivated When You Don’t Feel Like It




 



 

Friday, February 2, 2018

FileMaker "Portal In A Portal", 4D Printing

Build a FileMaker Portal in a Portal


Kudos to Brian Ouimette of nedbs.com  for creating a solution to a problem that has flummoxed FileMaker and FileMaker developers for years:  building a portal in a portal.  Brian combined the power of JSON (a FileMaker 16 addition) with ExecuteSQL and one of the least used but very powerful features of FileMaker since the earliest versions:  Repeating fields.

Check out the Portal in a Portal video below:

[embed]https://www.youtube.com/watch?v=sn7SyAP0Sr0[/embed]

While this solution isn't technically a portal in a portal, it does duplicate the functionality and isn't too complex to implement:
In the following demo file, you’ll see a customer layout with an invoice portal. I can’t tell you how many times I have heard, “it would be nice to see what was on the invoice within the same portal.” With this example, this is finally something achievable.

There is an internal “portal” that has a set of buttons to allow scrolling one record up or down, and another set of buttons that will allow you to page up or down on the internal portal. The portal is setup in a way that allows clean and easy editing of these records. In addition to those features, this approach is modular and is as light weight as possible from a performance perspective. The JSON is built using a recursive custom function and the script can be run server side (PSOS).

I just gave it a test drive and it works great!

Bonus:  There is a free downloadable FileMaker example file at the link just below.  

Source: FileMaker "Portal In A Portal" - iSolutions


4D Printing:  What the heck is that?


There are visionaries in our world who think and do things that make life so much better, and I for one am glad they exist and do what they do.  Skylar Tibbets is one such guy, and his vision of manufacturing parts that self assemble is as cutting edge as it gets:
Back in February, Skylar Tibbits revealed that he was working on a project called 4D printing. In essence, the technology would allow for 3D printed parts to assemble themselves into usable objects. It's a concept straight out of futurism fiction, but various research facilities are making it into a reality.

I had to watch the TED video to figure out what he was talking about, and it is an eye opener.  The applications for what he is proposing are truly mind boggling:

https://www.ted.com/talks/skylar_tibbits_the_emergence_of_4d_printing

This presentation dates back to 2013, and much has been done since then.  Get an update on what Tibbets is doing now in self assembly here.

Here's Everything You Need To Know About 4D Printing


Robert Heinlein quote