Monthly Archiv: July, 2016

Is Your Website Repelling Potential Customers?

Colors. Graphics. Original content.

These are all elements that work together to make your website interesting to potential customers. Unfortunately, you can’t just throw together a website with your two favorite colors, throw a graphic somewhere on the page and call it a day. There is research to prove that the appearance of your website has everything to do with conversions.

So is your website repelling your potential customers?

Ask yourself these few questions to find out!

Do you have hard-to-read content?

When visitors come to your website, one of the characteristics they value most is readability. Keep in mind that not everyone that visits your site will know all of the technical terms surrounding your industry.

If you are going to utilize technical terms, be sure to explain them on first reference so that your readers can understand. Better yet, save the technical terms until you’ve got them on board with your services.

Is your page overtaken with ads?

Ads are becoming increasingly annoying to Internet users. Your potential customers don’t want to spend time on sites that are ad-heavy, and for most businesses, it’s best not to have them at all.

Visitors are more likely to stay on your page if they don’t have to skim through ads to see the content they are looking for.

ads

Does your page take more than 3 seconds to load?

Any page that takes longer than three seconds to load loses nearly half of its traffic. This means that if your site is slow, you could lose half of your potential customers – and send them right back to the search results where they’ll find one of your competitors.

On mobile devices, the time frame is a little more forgiving, and pages are usually abandoned by 74% of people after 5 seconds. Still, load times are important – and if yours aren’t fast, you could be losing customers.

Ways to make your pages load faster

  • Reduce the size of your images
  • Remove unnecessary plugins
  • Be sure that you have a good hosting account

Do you have too many calls to action?

Though it is extremely important to have calls to action on your site, too many can be overwhelming. If visitors feel like they are bombarded with buttons asking for their information, they may be confused about which to choose – or worse, annoyed by the overly-salesy feel.

This image shows the perfect balance of what you should have on your page as far as calls to action. The buttons displayed are easy to find and they allow a place for visitors to act on their interest in your service.

The calls to action are shown in a way that doesn’t push for personal information, but rather provides the visitor with an option to contact when they are ready.

 

calls to action on webfx.com

Do you have videos that play when your page first opens?

Think back to the last time that you opened a site that blasted your speakers with an automatically-played video clip. Were you happy about not pressing play, but seeing and hearing the video anyway? Many visitors to your site will be extremely annoyed if your site does this, and will bounce almost immediately.

You may think it’s a perk to play the info for your visitors, but it’s actually quite the opposite. Turn off autoplay, and let your visitors decide whether or not to watch your video content.

Does your web design look like it’s from 1999?

As the world becomes increasingly technologically advanced, Internet users have certain expectations of company websites – especially ones that they are considering hiring for a service.

If your site is outdated or difficult to navigate, it’s time for an update. Work with a reputable design agency that can provide your business with a more modern look, and your visitors will be much more confident in working with you.

outdated website

Do you require too much of your visitors?

The minute you require visitors’ personal information, you are almost guaranteed to lose a portion of them.

More often than not, first-time visitors are looking to enter your site, find specific information, and leave. Later in the sales funnel, it’s okay to ask for information like their name and email address, but at the start of the process, your job is to eliminate any hoops that might be involved – not create them.

You can ask for information as part of your calls to action or newsletter signup forms, but don’t require it for the majority of your content.

Are your offers sneaky?

“Get 20% off our services today, just by signing up for our newsletter!”

If you offer perks like this, don’t make them conditional.

One of the biggest hassles for many Internet users is attempting to claim an offer, just to find more obstacles to navigate before actually getting it. If you won’t give a 20% voucher until your customer spends $1,000, list that stipulation up front!

Otherwise, potential customers may leave your site frustrated and annoyed that you offered a deal or discount to get their information, then let them down.

Is your website too busy?

If your website has an overwhelming number of colors and graphics, it may appear busy and confusing to your visitors. In many cases, they’ll leave in search of a site that’s cleaner and easier to navigate.

This can be a somewhat subjective quality, but it’s always a good idea to have people outside of your company test your site. If they find it confusing or difficult to find information, it may be time to rethink your design.

busy website

Do you use overly dramatized stock photos?

Bad stock photos are perhaps one of the worst things to include on a professional website. Not only do they appear spammy, but they also make it look like you don’t have the resources to take images of your own business.

Images can help to illustrate your business and what it can do for customers, but if they’re obviously staged, you aren’t doing your site any favors. Instead, consider hiring a photographer to take high quality images of your office, products, or past projects.

Do you hide the price of your services?

One thing that customers look for when they are seeking services is a transparent website that offers straightforward pricing information.

If you choose to make visitors jump through hoops in order to see the cost of your service, you will likely lose many potential customers.

Most often than not, visitors to your site are doing just that – visiting. This means that many will simply be researching and looking to find information on your service to compare to other services. Offer them pricing information so they can quickly get on with their process and be one step closer to picking your company to serve them.

Are your pages difficult to navigate?

There’s nothing more frustrating than visiting a website where you can’t find what you’re looking for. One of the most important qualities in any website is easy navigation throughout.

Think of the last time your visited a website and couldn’t find what you were looking for. It is extremely easy to become frustrated when you visit a website for one thing and can’t seem to find it. This is why ease of navigation is so important.

In order to ensure easy navigation, be sure to have a navigation bar that stands out from the rest of your page. Use logical organization for the difficult types of pages on your site, and have several people test it before launching it on your site. If you have a lot of product pages, it’s also a good idea to include a search bar so that customers can easily find the specific items they’re interested in.

Do you make customers determine their next steps on their own?

Not every site visitor is immediately ready to convert – but for the ones who are, it should be obvious how they can do so.

If you are serious about selling your services, you will have a call-to-action on every page of your website. These can be as simple as buttons with text like “call now,” “visit us today”, or “tell me more.” All of these phrases encourage your visitors to make the next move in committing to your service.

To ensure that your visitors can contact you from every page, with each of these calls-to-action, you should also have a field for the visitor to fill in their e-mail address. Even if they are just a little interested, after they disclose their e-mail, you can stay in contact with your newsletters or special offers.

This also gives you the opportunity to personally reach out, which is always better than a bulk email.

Is your tone off-putting?

“We do not work around the clock and we are closed on Mondays. Sorry.”

This is an example of exactly what you don’t want to sound like to customers. If you don’t write your website in a way that shows potential customers compassion for their needs, chances are they won’t want to work with you.

Is your site confusing to navigate on mobile devices?

Today, more Google searches take place on mobile devices than desktop computers. This means that your potential customers are searching for information on the go, and they need to be able to access it from their smartphones and other devices.

The only way to ensure this is with responsive design, which allows your site to adapt to any browser and screen size and provide a great user experience. Although it may require some extensive development work if your site is not currently mobile-friendly, it’s worth your time and resources to be able to reach more potential customers.

Does your site have any of these issues?

If you answered “yes” to any of the above questions, you have some work to do on your site. On the upside, it also means that you have plenty of room to improve your online presence and attract even more customers.

Have you faced any of these issues in the past? Let us know in the comments below!

The post Is Your Website Repelling Potential Customers? appeared first on WebFX Blog.

Learn TypeScript in 30 Minutes

learn-typescript-in-30

Today we’re going to take a look at TypeScript, a compile-to-JavaScript language designed for developers who build large and complex apps. It inherits many programming concepts from languages such as C# and Java that add more discipline and order to the otherwise very relaxed and free-typed JavaScript.

This tutorial is aimed at people who are fairly proficient in JavaScript but are still beginners when it comes to TypeScript. We’ve covered most of the basics and key features while including lots of examples with commented code to help you see the language in action. Let’s begin!


The Benefits of Using TypeScript

JavaScript is pretty good as it is and you may wonder Do I really need to learn TypeScript? Technically, you do not need to learn TypeScript to be a good developer, most people do just fine without it. However, working with TypeScript definitely has its benefits:

  • Due to the static typing, code written in TypeScript is more predictable, and is generally easier to debug.
  • Makes it easier to organize the code base for very large and complicated apps thanks to modules, namespaces and strong OOP support.
  • TypeScript has a compilation step to JavaScript that catches all kinds of errors before they reach runtime and break something.
  • The upcoming Angular 2 framework is written in TypeScript and it’s recommended that developers use the language in their projects as well.

The last point is actually the most important to many people and is the main reason to get them into TypeScript. Angular 2 is one of the hottest frameworks right now and although developers can use regular JavaScript with it, a majority of the tutorials and examples are written in TS. As Angular 2 expands its community, it’s natural that more and more people will be picking up TypeScript.

tscript-trend

Recent rise of TypeScript’s popularity, data from Google Trends.


1_Installation

Installing TypeScript

You will need Node.js and Npm for this tutorial. Go here if you don’t have them installed.

The easiest way to setup TypeScript is via npm. Using the command below we can install the TypeScript package globally, making the TS compiler available in all of our projects:

npm install -g typescript

Try opening a terminal anywhere and running tsc -v to see if it has been properly installed.

tsc -v
Version 1.8.10

2_text_editors

Text Editors With TypeScript Support

TypeScript is an open-source project but is developed and maintained by Microsoft and as such was originally supported only in Microsoft’s Visual Studio platform. Nowadays, there are a lot more text editors and IDEs that either natively or through plugins offer support for the TypeScript syntax, auto-complete suggestions, error catching, and even built-in compilers.

  • Visual Studio Code – Microsoft’s other, lightweight open-source code editor. TypeScript support is built in.
  • Official Free Plugin for Sublime Text.
  • The latest version of WebStorm comes with built in support.
  • More including Vim, Atom, Emacs and others.

Compiling to JavaScript

TypeScript is written in .ts files (or .tsx for JSX), which can’t be used directly in the browser and need to be translated to vanilla .js first. This compilation process can be done in a number of different ways:

  • In the terminal using the previously mentioned command line tool tsc.
  • Directly in Visual Studio or some of the other IDEs and text editors.
  • Using automated task runners such as gulp.

We found the first way to be easiest and most beginner friendly, so that’s what we’re going to use in our lesson.

The following command takes a TypeScript file named main.ts and translates it into its JavaScript version main.js. If main.js already exists it will be overwritten.

tsc main.ts

We can also compile multiple files at once by listing all of them or by applying wildcards:

# Will result in separate .js files: main.js worker.js.
tsc main.ts worker.ts    

# Compiles all .ts files in the current folder. Does NOT work recursively.
tsc *.ts

We can also use the --watch option to automatically compile a TypeScript file when changes are made:

# Initializes a watcher process that will keep main.js up to date.
tsc main.ts --watch

More advanced TypeScript users can also create a tsconfig.json file, consisting of various build settings. A configuration file is very handy when working on large projects with lots of .ts files since it somewhat automates the process. You can read more about tsconfig.json in the TypeScript docs here


Static Typing

A very distinctive feature of TypeScript is the support of static typing. This means that you can declare the types of variables, and the compiler will make sure that they aren’t assigned the wrong types of values. If type declarations are omitted, they will be inferred automatically from your code.

Here is an example. Any variable, function argument or return value can have its type defined on initialization:

var burger: string = 'hamburger',     // String 
    calories: number = 300,           // Numeric
    tasty: boolean = true;            // Boolean

// Alternatively, you can omit the type declaration:
// var burger = 'hamburger';

// The function expects a string and an integer.
// It doesn't return anything so the type of the function itself is void.

function speak(food: string, energy: number): void {
  console.log("Our " + food + " has " + energy + " calories.");
}

speak(burger, calories);

Because TypeScript is compiled to JavaScript, and the latter has no idea what types are, they are completely removed:

// JavaScript code from the above TS example.

var burger = 'hamburger',
    calories = 300, 
    tasty = true; 

function speak(food, energy) {
    console.log("Our " + food + " has " + energy + " calories.");
}

speak(burger, calories);

However, if we try to do something illegal, on compilation tsc will warn us that there is an error in our code. For example:

// The given type is boolean, the provided value is a string.
var tasty: boolean = "I haven't tried it yet";
main.ts(1,5): error TS2322: Type 'string' is not assignable to type 'boolean'.

It will also warn us if we pass the wrong argument to a function:

function speak(food: string, energy: number): void{
  console.log("Our " + food + " has " + energy + " calories.");
}

// Arguments don't match the function parameters.
speak("tripple cheesburger", "a ton of");
main.ts(5,30): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.

Here are some of the most commonly used data types:

  • Number – All numeric values are represented by the number type, there aren’t separate definitions for integers, floats or others.
  • String – The text type, just like in vanilla JS strings can be surrounded by ‘single quotes’ or “double quotes”.
  • Boolean – true or false, using 0 and 1 will cause a compilation error.
  • Any – A variable with this type can have it’s value set to a string, number, or anything else.
  • Arrays – Has two possible syntaxes: my_arr: number[]; or my_arr: Array<number>.
  • Void – Used on function that don’t return anything.

To see a list of all of the available types, go to the official TypeScript docs – here.


5_interfaces

Interfaces

Interfaces are used to type-check whether an object fits a certain structure. By defining an interface we can name a specific combination of variables, making sure that they will always go together. When translated to JavaScript, interfaces disappear – their only purpose is to help in the development stage.

In the below example we define a simple interface to type-check a function’s arguments:

// Here we define our Food interface, its properties, and their types.
interface Food {
    name: string;
    calories: number;
}

// We tell our function to expect an object that fulfills the Food interface. 
// This way we know that the properties we need will always be available.
function speak(food: Food): void{
  console.log("Our " + food.name + " has " + food.calories + " calories.");
}

// We define an object that has all of the properties the Food interface expects.
// Notice that types will be inferred automatically.
var ice_cream = {
  name: "ice cream", 
  calories: 200
}

speak(ice_cream);

The order of the properties does NOT matter. We just need the required properties to be present and to be the right type. If something is missing, has the wrong type, or is named differently, the compiler will warn us.

interface Food {
    name: string;
    calories: number;
}

function speak(food: Food): void{
  console.log("Our " + food.name + " has " + food.calories + " grams.");
}

// We've made a deliberate mistake and name is misspelled as nmae.
var ice_cream = {
  nmae: "ice cream", 
  calories: 200
}

speak(ice_cream);
main.ts(16,7): error TS2345: Argument of type '{ nmae: string; calories: number; } 
is not assignable to parameter of type 'Food'. 
Property 'name' is missing in type '{ nmae: string; calories: number; }'.

This is a beginners guide so we won’t be going into more detail about interfaces. However, there is a lot more to them than what we’ve mentioned here so we recommend you check out the TypeScript docs – here.


6_classes

Classes

When building large scale apps, the object oriented style of programming is preferred by many developers, most notably in languages such as Java or C#. TypeScript offers a class system that is very similar to the one in these languages, including inheritance, abstract classes, interface implementations, setters/getters, and more.

It’s also fair to mention that since the most recent JavaScript update (ECMAScript 2015), classes are native to vanilla JS and can be used without TypeScript. The two implementation are very similar but have their differences, TypeScript being a bit more strict.

Continuing with the food theme, here is a simple TypeScript class:

class Menu {
  // Our properties:
  // By default they are public, but can also be private or protected.
  items: Array<string>;  // The items in the menu, an array of strings.
  pages: number;         // How many pages will the menu be, a number.

  // A straightforward constructor. 
  constructor(item_list: Array<string>, total_pages: number) {
    // The this keyword is mandatory.
    this.items = item_list;    
    this.pages = total_pages;
  }

  // Methods
  list(): void {
    console.log("Our menu for today:");
    for(var i=0; i<this.items.length; i++) {
      console.log(this.items[i]);
    }
  }

} 

// Create a new instance of the Menu class.
var sundayMenu = new Menu(["pancakes","waffles","orange juice"], 1);

// Call the list method.
sundayMenu.list();

Anyone who has written at least a bit of Java or C# should find this syntax comfortably familiar. The same goes for inheritance:

class HappyMeal extends Menu {
  // Properties are inherited

  // A new constructor has to be defined.
  constructor(item_list: Array<string>, total_pages: number) {
    // In this case we want the exact same constructor as the parent class (Menu), 
    // To automatically copy it we can call super() - a reference to the parent's constructor.
    super(item_list, total_pages);
  }

  // Just like the properties, methods are inherited from the parent.
  // However, we want to override the list() function so we redefine it.
  list(): void{
    console.log("Our special menu for children:");
    for(var i=0; i<this.items.length; i++) {
      console.log(this.items[i]);
    }

  }
}

// Create a new instance of the HappyMeal class.
var menu_for_children = new HappyMeal(["candy","drink","toy"], 1);

// This time the log message will begin with the special introduction.
menu_for_children.list();

For a more in-depth look at classes in TS you can read the documentation – here.


7_generics

Generics

Generics are templates that allow the same function to accept arguments of various different types. Creating reusable components using generics is better than using the any data type, as generics preserve the types of the variables that go in and out of them.

A quick example would be a script that receives an argument and returns an array containing that same argument.

// The <T> after the function name symbolizes that it's a generic function.
// When we call the function, every instance of T will be replaced with the actual provided type.

// Receives one argument of type T,
// Returns an array of type T.

function genericFunc<T>(argument: T): T[] {    
  var arrayOfT: T[] = [];    // Create empty array of type T.
  arrayOfT.push(argument);   // Push, now arrayOfT = [argument].
  return arrayOfT;
}

var arrayFromString = genericFunc<string>("beep");
console.log(arrayFromString[0]);         // "beep"
console.log(typeof arrayFromString[0])   // String

var arrayFromNumber = genericFunc(42);
console.log(arrayFromNumber[0]);         // 42
console.log(typeof arrayFromNumber[0])   // number

The first time we called the function we manually set the type to string. This isn’t required as the compiler can see what argument has been passed and automatically decide what type suits it best, like in the second call. Although it’s not mandatory, providing the type every time is considered good practice as the compiler might fail to guess the right type in more complex scenarios.

The TypeScript docs include a couple of advanced examples including generics classes, combining them with interfaces, and more. You can find them here.


8_modules

Modules

Another important concept when working on large apps is modularity. Having your code split into many small reusable components helps your project stay organized and understandable, compared to having a single 10000-line file for everything.

TypeScript introduces a syntax for exporting and importing modules, but cannot handle the actual wiring between files. To enable external modules TS relies on third-party libraries: require.js for browser apps and CommonJS for Node.js. Let’s take a look at a simple example of TypeScript modules with require.js:

We will have two files. One exports a function, the other imports and calls it.

exporter.ts

var sayHi = function(): void {
    console.log("Hello!");
}

export = sayHi;

importer.ts

import sayHi = require('./exporter');
sayHi();

Now we need to download require.js and include it in a script tag – see how here. The last step is to compile our two .ts files. An extra parameter needs to be added to tell TypeScript that we are building modules for require.js (also referred to as AMD), as opposed to CommonJS ones.

tsc --module amd *.ts

Modules are quite complex and are out of the scope of this tutorial. If you want to continue reading about them head out to the TS docs – here.


9_declaration_files

Third-party Declaration Files

When using a library that was originally designed for regular JavaScript, we need to apply a declaration file to make that library compatible with TypeScript. A declaration file has the extension .d.ts and contains various information about the library and its API.

TypeScript declaration files are usually written by hand, but there’s a high chance that the library you need already has a .d.ts. file created by somebody else. DefinitelyTyped is the biggest public repository, containing files for over a thousand libraries. There is also a popular Node.js module for managing TypeScript definitions called Typings.

If you still need to write a declaration file yourself, this guide will get you started.


10_typescript_2

Upcoming Features in TypeScript 2.0

TypeScript is still under active development and is evlolving constantly. At the time of the writing of this tutorial the LTS version is 1.8.10, but Microsoft have already released a Beta for TypeScript 2.0. It’s available for public testing and you can try it out now:

npm install -g typescript@beta

It introduces some handy new concepts such as:

  • Non-nullable types flag which prevents some variables from having their vlaue set to null or underifned.
  • New improved system for getting declaration files directly with an npm install.
  • Control flow type analysis that catches errors previously missed by the compiler.
  • Some innovations in the module export/import syntax.

Another long-awaited feature is the ability to control the flow of asynchronous functions in an async/await block. This should be available in a future 2.1 update.

Further Reading

The amount of information in the official docs can be a bit overwhelming at first, but the benefits of going through it will be huge. Our tutorial is to be used as an introduction, so we haven’t covered all of the chapters from the TypeScript documentation. Here are some of the more useful concepts that we’ve skipped:

  • Namespaces – here.
  • Enums – here.
  • Advanced Types and Type Guards – here.
  • Writing JSX in TypeScript – here.

Conclusion

We hope you enjoyed this tutorial!

Do you have any thoughts on TypeScript and would you consider using it in your projects? Feel free to leave a comment below!

Faster PHP IP2Location (New)

winner
Package:
Faster PHP IP2Location
Summary:
Faster method to find the location of IP addresses
Groups:
Algorithms, Geography, PHP 5
Author:
Chi Hoang
Description:
This class implements a faster method to find the location of IP addresses...

Read more at http://www.phpclasses.org/package/9844-PHP-Faster-method-to-find-the-location-of-IP-addresses.html

Raptor 2

rp-1.png
Package:
Raptor 2
Summary:
Framework that takes routes from annotations
Groups:
Libraries, PHP 5
Author:
william amed
Description:
This package is a framework that takes routes from controller class annotations...

Read more at http://www.phpclasses.org/package/9823-PHP-Framework-that-takes-routes-from-annotations.html#2016-07-18-05:29:22
Powered by Gewgley