​Wix.com: Make the Web Your Playground

(This is a sponsored post.)
Here’s something you should consider having: your own professional website. The only thing you’ll need to get started is your imagination, a little free time, and an innovative website builder.
Wix is the world’s most technologically advanced website builder. Sign up for Wix, choose a template, and start customizing it. Whether you’re a novice, a business owner, a sophisticated designer, or a professional website builder, you’ll have full control of your website – from …

​Wix.com: Make the Web Your Playground is a post from CSS-Tricks

Link: http://synd.co/2EGZwLr

Wufoo Forms Integrate With Everything

(This is a sponsored post.)
Wufoo helps you build forms you can put on any website. There’s a million reasons you might need to do that, from the humble contact form, to a sales lead generation form, to a sales or registration form.
That’s powerful and useful all by itself. But Wufoo is even more powerful when you consider that it integrates with over 1,000 other web services.

Wufoo integrates with over a dozen CRM solutions, including Salesforce,

Wufoo Forms Integrate With Everything is a post from CSS-Tricks

Link: https://ad.doubleclick.net/ddm/clk/303181152;128762502;s

Enhanced Email Validation with mailboxlayer (Sponsored)

Validation is an important part of managing any data you receive, especially when it comes to web forms.  If you really want to be secure with the data, you use HTML5 validation rules, JavaScript validation, and then the most importantly layer, the server-side layer.  Even then, you’re only validating text patterns. What’s one of the […]
The post Enhanced Email Validation with mailboxlayer (Sponsored) appeared first on David Walsh Blog.

Link: https://davidwalsh.name/email-validation-mailboxlayer

How to Enable AI with Secure Communications

This article was sponsored by BlackBerry. Thank you for supporting the partners who make SitePoint possible.
Imagine a healthcare platform that designs the perfect treatment plan for a patient based on their medical history. Picture a chatbot that automatically generates legal appeals or resolves customer disputes in minutes. Imagine a virtual assistant that knows your habits, likes, and dislikes, and can suggest activities based on this knowledge.
This technology already exists today, and it is just the beginning. Alongside the Enterprise of Things, we are on the verge of a second revolution. Artificial intelligence will change everything, from how we protect ourselves from cyberattacks to how we go about our daily lives.
And much like the Enterprise of Things, businesses that do not start planning for artificial intelligence now will be left behind – according to Tata Consultancy Services, 84% of businesses believe AI will be essential.
Building A Smarter Enterprise – Artificial Intelligence and App Development
Application development will be the foundation of the move towards artificial intelligence. Businesses that integrate AI into their apps will be able to provide new services and a better, more personalized user experience. They will be able to gain deeper insights into how their customers think and act, and open new revenue streams through those insights.
Moreover, artificial intelligence will power new, transformative interactions between people, machines, and the Internet of Things.
Through AI-driven analysis, businesses will gain a deeper understanding of their market and their staff. Automation will allow workers to respond proactively to customer complaints or security incidents, boost productivity, reduce costs, and minimize employee error. And through machine learning, businesses will be able to make better, more informed decisions than ever before.
In time, people will demand such capabilities. Next-generation apps and services will be expected to not only support human-to-human interactions, but also human-to-machine and machine-to-machine interactions. Just as mobile apps are critical to business success today, artificial intelligence will be critical to success very soon.
Getting Past The Roadblocks to Enterprise AI
Though most businesses acknowledge artificial intelligence’s importance, AI remains elusive. The issue is primarily one of complexity and cost. In a 2017 study by Infosys, 72% of IT professionals found time constraints were a roadblock to AI adoption, while 71% referenced financial limitations. Resistance to change and a lack of clarity around AI’s value were also hindrances.
Even for businesses that manage to overcome those challenges, security remains a core issue. AI apps will routinely deal with sensitive data such as customer information, internal messages, login credentials, usage details, and even intellectual property. Left unencrypted, such services could leak that data into the wrong hands.
Communications Platform as a Service (CPaaS) tools are central to overcoming these challenges. By integrating real-time communications into their apps – and tying that functionality to its AI services – developers allow for better, deeper interactions between AI and user. More importantly, with the right CPaaS solution, they ensure those interactions are kept secure, and that the AI does not leak critical data.
How The BBM Enterprise SDK Makes Your Apps Smarter
Here’s where the BBM Enterprise SDK comes in. A secure CPaaS platform built on BlackBerry’s strength in secure mobile messaging, it gives your developers everything they need to incorporate secure, enterprise-grade messaging functionality in their apps. You can use commonly used identity and user management providers to make development even easier.
More importantly, it offers several features that directly empower artificial intelligence:

Embedded voice, video, chat. Enable your users to reach out to anyone around the world and be reached they want, whether for emergency communications, peer-to-peer collaboration, or by receiving personalize support services.
Publish/Subscribe Services. Create channels which broadcast to subscribing users. This keeps them updated on all new activity in a collaboration space, whether by another user or from the machine-readable information your application consumes.
Chatbots and Routing Services. Provide real-time support for your users via a chatbot which can process their data, activity, and messages. This information is then used to route them to the correct contact.
AI-Driven Predictive Analytics. AI algorithms enable behind-the-scenes user empowerment, delivering relevant information to users when they need it. These include location-based alerts or suggested actions based on user behavior.
Secure IoT Data Sharing. Eliminate the worry of cached copies or “fingerprints in the cloud” that could compromise privacy while also supporting real-time data sharing across all endpoints – human and machine.

We suggest that you first download the free SDK and familiarize yourself with the BBM Enterprise SDK with Blackberry’s Getting Started Guide.
Now that you’re ready, let’s dive into some examples that can help you get started with your AI journey…
How to Create Data Streams via Whiteboarding
This example shows how you can send arbitrary data in a BBM Enterprise SDK chat to create a shared whiteboard that allows us to do the following:

Create new whiteboards with one or more users
Share pictures and markup

Continue reading %How to Enable AI with Secure Communications%

Link: https://www.sitepoint.com/ai-the-future-of-apps/

Take a coding quiz, get offers from top tech companies

(This is a sponsored post.)
That’s how TripleByte works. The companies that find hires from TripleByte (like Dropbox, Apple, Reddit, Twitch, etc) don’t have as many underqualified applicants to sort through because they’ve come through a technical interview of sorts already.
Direct Link to Article — Permalink…

Take a coding quiz, get offers from top tech companies is a post from CSS-Tricks

Link: http://synd.co/2CbkdxU

The Wix Code Database and Data Modeling

This article was created in partnership with Wix. Thank you for supporting the partners who make SitePoint possible.
One of the cool features of Wix Code is the ability to separate your site’s design and layout from its content. This means you can create and maintain your information in a database and then have your pages dynamically retrieve and display this information in whatever way you like.
Let’s take an in-depth look at what you can do with the Wix Code database, including the types of information you can store, ways you can manipulate data with code, and how you can dynamically display the information on your site.
Throughout this article, we’ll use a simplified example of an art school that stores and displays information about its courses and teachers.
The Wix Code Database
Like all databases, the Wix Code database is made up of individual tables, which we call collections. In our example of the art school (see image below), we have two collections, one each for the courses and teachers.

You can create as many collections as you need and populate them with a near unending amount of data. A robust permissions model means you have complete control over who can access your information and what they can do with it.
You can work directly in your Live data, which is the information your visitors see when they view your pages. You can also work with Sandbox data, so you can try stuff out without affecting your live site. You can sync between them at any time.
Populating Collections
You have several options for populating your collections. You can manually enter data directly in the Wix Content Manager, either to your Live data or your Sandbox data.
If you’re an Excel ace, you can do all the work in Excel (or whatever spreadsheet program you prefer), save your sheet as a CSV file, and then import it into the Wix Code database. In fact, you can create your entire collection this way, schema and all. You can import to your Live data or your Sandbox data.
You can also export your Wix data to CSV files. If you make sure to include the built-in ID system field, you will be able to modify your content in your spreadsheet and then re-import it into your Wix Code database so that each record, or what we call item, is updated.
A third option is to build a form to capture user input and store it in your database.
Using External Databases
If you already have a database somewhere, you might be thinking that you don’t want to recreate it in Wix. The good news is that you don’t have to. As long as your database exposes an API, you can access it from your Wix site.
For simple applications, you can use the wix-fetch module—an implementation of the standard JavaScript Fetch API—to access your external database with an HTTP request and use that data in your Wix site’s pages.
You can also pair the wix-fetch module with another Wix module, wix-router, that lets you control the routing of incoming requests. Using the functionality provided by both of these modules, you can create SEO-friendly dynamic pages that show different data depending on the URLs used to reach them.
For example, you can design a single member profile page that can be used by all of your site’s members.
Using wix-router and wix-fetch you can write code that pulls information from incoming requests for the profile page, queries an external database to retrieve the information for the page, and then injects that data into the profile page. You can even add security to your page by using the wix-users module.
So if you create another page for users to update their profile pages, you can check who is trying to access it and only allow users to update their own profiles.
Data Hooks
You can add hooks to actions on your collections using the wix-data API.
For example, in our Teachers collection, we have two separate fields: First name and Last name. To make displaying names on our pages easier, we also want to have one field that has both names together. To do this, we can add a beforeInsert hook to our Teachers collection that hooks into the insert action, reads the contents of the First name and Last name fields, and then concatenates them and populates the Full name field.
Modeling Your Data
Now that we’ve covered the database itself, let’s talk about modeling your data in the Wix Code database.
Collection Schemas
Like all databases, each collection has a schema to define its fields. All standard field types are supported, including text, image, boolean, number, date and time, and rich text.
There is also a field type specifically designed for URLs. It automatically formats the URL into clickable links that you can add to your pages. For example, teachers in your school could supply the URL of their portfolio website, and you could include that link on their dynamic page.
You can also use the document field type to store a wide range of file types. You can allow your users to download files stored in your collections (such as reading lists for each course) or to upload their own files.
ID Fields and Primary Fields
Each collection has an _ID field, which is the primary key for that table. Collections also have a primary field (indicated by a lock icon), which is the display key for each item.
When you create joins using reference fields (see the next section), the values come from the primary field. The reference itself uses the _ID field, of course. If you plan on using reference fields, it’s a good idea to make sure the data you store in the primary field is unique.

Reference Fields
Reference fields create a connection between collections that is defined in the collection schema itself. This is similar to foreign keys in relational databases.
Each reference field points to a specific collection. The value that is displayed in the reference field in each item in the collection is taken from the value of the primary field of the referenced collection.

In our example, we created a reference field in our Courses collection that points to our Teachers collection so that we can indicate who teaches each class.
The advantage of reference fields is three-fold. First, they help maintain data integrity because their value is taken directly from the referenced collection. Second, they help eliminate data duplication, which we all know is the enemy of good database design. And third, when we create our page layouts, reference fields let us access information in the referenced collection as well as in the main collection we are using. This allows us to create master-detail pages, such as a list of all the courses taught by each teacher.
Creating Pages from Your Content
Of course, storing and maintaining data is nice, but the real point of having a website is displaying content to visitors. So let’s talk about how that works with Wix Code.
Back to our art school example. We have two different types of information: courses and teachers. So you could start by designing a page layout to display all the information about each of the courses. Then you might want to create a master-detail page that lists all of your teachers and the courses they teach.
Continue reading %The Wix Code Database and Data Modeling%

Link: https://www.sitepoint.com/the-wix-code-database-and-data-modeling/

The Wix Code Database and Data Modeling

(This is a sponsored post.)
I happen to know many of the readers of CSS-Tricks are strong web designers and developers. Most of you probably don’t use website builders very often, as you are a website builder. You love the control. You love the possibilities. You want to be close to the metal because that’s your expertise.
But you also know the costs. Everything you chose to yourself piles on to the responsibility you take on. Technical debt. Using …

The Wix Code Database and Data Modeling is a post from CSS-Tricks

Link: http://synd.co/2DfBsM3

The Ultimate Guide to Headless CMS

(This is a sponsored post.)
The World Has Changed—So Must the CMS
Having a responsive website is no longer enough. Your audience expects a seamless and personalized customer experience across all their devices—the age of headless technology is coming.
Headless CMS is the next generation in content management for brands that want to stay ahead of the curve by engaging customers through the growing number of channels.
Download The Ultimate Guide to Headless CMS ebook for a deep look …

The Ultimate Guide to Headless CMS is a post from CSS-Tricks

Link: http://synd.co/2mxvC1p

Build George Costanza’s Bathroom Finder using WRLD

This article was sponsored by WRLD 3D. Thank you for supporting the partners who make SitePoint possible.
“Anywhere in the city? Anywhere in the city: I’ll tell you the best public toilet.”
These are the words of George Costanza to Jerry Seinfeld in 1991. In that episode of Seinfeld; the visionary George invented an app before his time – the bathroom finder! If you’re a frequent traveller, a parent, or just someone who knows the importance of a clean and well-maintained space for some “serenity", you’ll understand the utility of this idea.

So, this time in the second tutorial of our WRLD series we’re going to build a… let’s call it a "facility finder app".

It’s not the first time someone has tried this mind you. In 2010, bathroomreview.ca did just that (as described in Forbes). But the site is no longer operational.

We covered quite a bit of ground in the last tutorial, this time round, we’re going to reuse some of that learning. For instance, we’ll use ParcelJS to build our static files, but we won’t go into too much detail about how to set it up again. We’ll also highlight buildings and set the appropriate weather conditions and time of day, depending on what they are for the user. If you’re unsure about how these work, refer back to the previous tutorial.
In this tutorial, we’re going to cover these topics:

Creating a simple AdonisJS server-side API (to cache location data and handle CORS requests).
Requesting public facilities data, from refugerestrooms.org, if there are no cached locations within 10 meters of the user. We’ll use the Google Distance Matrix API to calculate the distance between points of interest.
Highlighting buildings with public facilities, colored to match their rating. Green for good, red for bad. Each building will have an info card for extra info (like how to reach the bathroom).

At the end, we’ll talk a bit about how to turn this kind of app into a viable business. That’s really the point of this isn’t it? The WRLD APIs provide tools to visualise real-world data in a map of the real world. Our job is to work out how to use this technology for commercial applications!

The code for this tutorial can be found on Github. It has been tested with a modern versions or Firefox, Node, and macOS.

Getting Facility Data
Let’s begin by learning how to get the facility data, and the form we get it in. We’re going to use refugerestrooms.org as a source of data. We learn that we can search by latitude and longitude, by looking at the documentation. In fact, we can make the following request, and see a set of facilities close to my location:
curl https://www.refugerestrooms.org/api/v1/restrooms/by_location.json? ↵
lat=-33.872571799999996&lng=18.6339362

There are a few other parameters we could be specifying (like whether to filter by accessible and/or unisex facilities), but the main thing this gives us is a way to plug coordinates into a search and get close-by locations.
We can’t just call this from the browser, though. There are all sorts of security reasons why this is disallowed. There are also performance reasons. What if 10 people made the same request, standing 10 meters apart from each other? It would be a waste to fire off 10 requests to the same remote server, when we could serve it faster from a caching proxy.
Instead, we’re going to set up a simple AdonisJS caching API. Our browser app will send requests to the AdonisJS API, and if there’s no “nearby” data; it will send a request to the Refuge API. We can’t spend too much time on the details of AdonisJS, so you’ll have to check out the documentation for details.

I’m also just about done writing a book about it, so that’s the best place to learn how it works!

The easiest way, to create a new AdonisJS app, is to install the command-line tool:
npm install –global @adonisjs/cli

This enables the adonis command-line globally. We can use it to create a new application skeleton:
adonis new proxy

This takes a little while, since it’s installed a few things. When it finishes, you should see a message to run the development server. This can be done with:
adonis serve –dev

Open up http://127.0.0.1:3333 in your browser, and you should be greeted by this beauty:

Creating Migrations and Models
Let’s story the search data in a database. AdonisJS supports a few different engines, but we’ll use SQLite for the sake of simplicity. We can install the appropriate driver, using:
npm install –save sqlite3

Next, let’s make a migration and a model. We’re only interested in the coordinates used to search, and the returned JSON. If the coordinates are close enough to where a user is searching for, we’ll reuse the existing search response instead of re-requesting the search data.
We can use the adonis command-line utility to create migrations and models:
adonis make:migration search
adonis make:model search

That creates a couple files. The first is a migration, to which we can add three fields:
"use strict"

const Schema = use("Schema")

class SearchSchema extends Schema {
up() {
this.create("searches", table => {
table.increments()
table.string("latitude")
table.string("longitude")
table.text("response")
table.timestamps()
})
}

down() {
this.drop("searches")
}
}

module.exports = SearchSchema

This is from proxy/database/migrations/x_search_schema.js

We’ve added the latitude, longitude, and response fields. The first two make sense as string even though they contain float data, because we want to do sub-string searches with them.
Next, let’s create a single API endpoint:
"use strict"

const Route = use("Route")

// we don’t need this anymore…
// Route.on("/").render("welcome")

Route.get("search", ({ request, response }) => {
const { latitude, longitude } = request.all()

// …do something with latitude and longitude
})

This is from proxy/start/routes.js

Each AdonisJS route is defined in the routes.js file. Here, we’ve commented out the initial “welcome” route, and added a new “search” route. The closure is called with a context object; which has access to the request and request objects.
We can expect search requests to provide latitude and longitude query string parameters; and we can get these with request.all. We should check to see if we have any vaguely related coordinates. We can do this by using the Search model:
const Search = use("App/Models/Search")

const searchablePoint = (raw, characters = 8) => {
const abs = Math.abs(parseFloat(raw))
return parseFloat(abs.toString().substr(0, characters))
}

Route.get("search", async ({ request, response }) => {
const { latitude, longitude } = request.all()

const searchableLatitude = searchablePoint(latitude)
const searchableLongitude = searchablePoint(longitude)

// console.log(searchableLatitude, searchableLongitude)

const searches = await Search.query()
.where("latitude", "like", `%${searchableLatitude}%`)
.where("longitude", "like", `%${searchableLongitude}%`)
.fetch()

// console.log(searches.toJSON())

response.send("done")

// …do something with latitude and longitude
})

This is from proxy/start/routes.js

We begin by importing the Search model. This is a code representation of the database table we created (using the migration). We’ll use this to query the database for “nearby” searches.
Before we can do that, we need a way to search for nearly coordinates. The searchablePoint function takes a raw coordinate string and creates an absolute float value, removing the optional – from the front of the string. Then, it returns the first 8 characters of the coordinate string. This will shorten -33.872527399999996 to 33.872527. We can then use these 8 characters in a SQL “where like” clause, to return all searches with similar coordinate strings.
AdonisJS uses the async and await keywords to great effect. Methods like Search.query return promises, so we can await their results while still writing 100% asynchronous code.

I’m skipping a lot of AdonisJS details, which I really don’t like doing. If you’re struggling with this part; speak to me on Twitter, and I’ll point you in the right direction.

Matching Nearby Locations
Now that we’ve got the “nearby” locations, we can compare their relative distances to where the user is standing. If you don’t yet have a Google API key, refer back to the previous tutorial for how to get one. We’re about to be the Google Distance Matrix service:
https://maps.googleapis.com/maps/api/distancematrix/json? ↵
mode=walking& ↵
units=metric& ↵
origins=-33.872527399999996,18.6339164& ↵
destinations=-33.872527399999997,18.6339165& ↵
key=YOUR_API_KEY

The Distance Matrix service actually allows multiple origins, so we can combine all of your previous searches into a longish origin string:
const reduceSearches = (acc, search) => {
const { latitude, longitude } = search
return `${acc}|${latitude},${longitude}`
}

Route.get("search", async ({ request, response }) => {
const { latitude, longitude } = request.all()

// …get searches

const origins = searches
.toJSON()
.reduce(reduceSearches, "")
.substr(1)

// console.log(origins)

response.send("done")

// …do something with latitude and longitude
})

This is from proxy/start/routes.js

We can convert the search results into an array of objects. This is useful because we can reduce the array, combining each search’s latitude and longitude into a string. That string will begin with a |, so we need to get the string starting at index 1.
Continue reading %Build George Costanza’s Bathroom Finder using WRLD%

Link: https://www.sitepoint.com/build-seinfeld-bathroom-finder/

​Incapsula’s Global DDoS Threat Landscape Report

(This is a sponsored post.)
The newly released Q3 2017 Global DDoS Threat Landscape Report features insights on attacks and mitigation. These are some of the key findings:

Bitcoin was one of the most targeted industries
High packet rate attacks grew more common
A third of network layer attacks were highly persistent
Botnet activity out of India and Turkey continued to climb

Learn about the top attacked countries, industries, and vectors here and how to protect your site with …

​Incapsula’s Global DDoS Threat Landscape Report is a post from CSS-Tricks

Link: http://synd.co/2EN1es9