Wednesday, May 11, 2016

10 Ways To Allocate Marketing Budget On Social Media - infographic

10 Ways To Allocate Marketing Budget On Social Media - infographic

“Now more than ever, people are spending a significant part of their day on social media. According to Forbes, users are on Facebook and its related apps for an average of 50 minutes each day. And with over two new members per second signing up to join LinkedIn, it’s no wonder that advertising on these platforms has become a major point of interest. As users are already engaged in these websites, half the battle has already been won. That being said, the number of social media sites can make it difficult to assess which advertising methods are worth your budget.

Fortunately, determining where to allocate your social media budget isn’t too difficult once you start thinking of social platforms as separate entities, and not under one big social umbrella. It all starts with comparing data, and then looking separately at your advertising options for each network. You’ll find that this process is well worth your efforts.”

by Irfan Ahmad via Digital Information World

Mastering SVG Patterns Without Breaking Your Brain (or Budget)

I want to share a little feature of Jarek Foksa's Boxy SVG Editor that I think is nifty, but perhaps not super obvious to new users.

Patterns are the one of the most useful features of SVG – but it can be a little brain-bending trying to get tiling and scaling to do what you want it to.

Happily Boxy SVG handles pattern creation really nicely – if you know where to look. Here's a quick run-through.

Creating SVG Patterns with Boxy SVG.

[caption id="attachment_130242" align="alignright" width="464"]Pattern fill Pattern Fill[/caption]

1). When you've created a new shape, select it and go to the FILL menu and click the stripey Pattern fill tile (shown here).

2). Below the Pattern selector dropdown you'll see 'Add more patterns in DEFS Panel'. Click on the link to switch to the DEFS panel.

3). Now click the '+' button to start a new pattern tile. This will be a copy of your current pattern to begin with. Double-click it to open it in a new window for editing. Feel free to rename your pattern if you like, but it MUST begin with a '#'.

4). Delete whatever is currently in the editor view and begin creating your new pattern using the drawing tools. Resize your 'tile canvas' if you need to by using the 'VIEW' panel.

pattern-constructor

In this demo, I've created some overlapping sine curves that should tile perfectly.

5). When you're done (you can re-edit your pattern any time), click the SVG box at the top-left of screen to switch back to your main drawing again.

Pattern fill

6). Select a shape, go to the Pattern dropdown in FILL and select your newly created pattern (it should be in the list now). You should see something like this.

But what about scaling and positioning the pattern?

Pattern handles

7). In the tool panel on the left, select the shape Edit tool. You should now see pink pattern control handles inside your shape.

Use the pink circle to rotate your pattern. Use the pink square to re-scale it.

Rotate and position your pattern.

That's all there is to it. You can use that pattern as many times in the same SVG document, any SIZE you like without making the file any larger. For instance, I used a small patch of pattern for the grid in

SVG patterns are not a new idea but I've never found a tool as fast and easy as this one to manipulate them.

Pattern Inspiration

Now you have the power of SVG pattern mastery, how will you use it? Check out Phillip Rogers SVG Patterns Gallery and Patternbolt for some cool ideas.

Patternbolt

Continue reading %Mastering SVG Patterns Without Breaking Your Brain (or Budget)%


by Alex Walker via SitePoint

5 Common Problems Faced by Python Beginners

Are you in the process of learning Python? It’s a fantastic language to learn, but as with any language, it does present challenges that can seem overwhelming at times, especially if you’re teaching yourself.

Given all the different ways of doing things in Python, we decided to compile a helpful list of issues that beginners often face — along with their solutions.

learning Python

1. Reading from the Terminal

If you’re running a program on the terminal and you need user input, you may need to get it through the terminal itself. (Other alternatives include reading a file to get inputs.)

In Python, the raw_input function facilitates this. The only argument the function takes is the prompt. Let’s look at a small program to see the result:

[code]name = raw_input('Type your name and press enter: ')
print 'Hi ' + name[/code]

If you save those lines in a file (with a .py extension) and execute it, you get the following result:

[code]Type your name and press enter: Shaumik
Hi Shaumik[/code]

One important thing to note here is that the variable is a string, and you need to filter and convert it to use it in a different form (like an input for the number of iterations or the length of a matrix):

[code]name = raw_input('Type your name and press enter: ')
print 'Hi ' + name
num = raw_input('How many times do you want to print your name: ')
for i in range(int(num)):
print name[/code]

2. Enumerating in Python

Python often presents ways of doing things different from other popular programming languages like C++ and Java. When you traverse an array in other languages, you increment an integer from 0 and access the corresponding elements of the array. The following shows a crude way of doing the same:

[code]for (int i = 0; i < array_length; ++i)
cout << array[i];[/code]

However, in Python, you can simply traverse each element of the array without using the indices at all:

[code]for item in array:
print item[/code]

What if there’s a need to access the indices too? The enumerate function helps you do so. Enumeration of an array (or a list, as it’s known in Python) creates pairs of the items in an array and their indices. The same can be demonstrated as follows:

[code]>>> x = [10, 11, 12, 13, 14]
>>> for item in enumerate(x):
... print item
...
(0, 10)
(1, 11)
(2, 12)
(3, 13)
(4, 14)[/code]

Imagine a situation where you need to print every alternate item in an array. One way of doing so is as follows:

[code]>>> for index, item in enumerate(x):
... if index % 2 == 0:
... print item
...
10
12
14[/code]

Continue reading %5 Common Problems Faced by Python Beginners%


by Shaumik Daityari via SitePoint

Modular JavaScript: A Beginners Guide to SystemJS & jspm

Over the past few years, the JavaScript programming language has exploded in popularity. It has become the go-to language for developing both rich web applications, as well as hybrid mobile applications. And as JavaScript projects are becoming increasingly complex, developers are experiencing new requirements of the language. One of these is modularity.

As far as I can see, there are two aspects in which modularity has to be achieved:

  • Modules that we author
  • External modules that are installed as dependencies

ES6 brings a standard module syntax to JavaScript and a loader specification. This is a good step forward, however at the time of writing, there are no browsers that can natively load ES6 modules. This means that if you want to use modules today, you'll need to use a module bundler.

For an overview of the current landscape see: Understanding JavaScript Modules: Bundling & Transpiling

[author_more]

And what's more, we don't have a package manager that allows us to download a package and include it in our application. Package managers (such as Bower and npm) help us download front-end dependencies without having to visit a projects' website, but that's as far as it goes.

In this article, we will see how jspm and SystemJS can be used to overcome these problems.

What are jspm and SystemJS?

The JavaScript Package Manager (aka jspm) is a package manager that works on top of the SystemJS universal module loader. It is not an entirely new package manager with its own set of rules, rather it works on top of existing package sources. Out of the box, it works with GitHub and npm. As most of the Bower based packages are based on GitHub, we can install the those packages using jspm as well. It has a registry that lists most of the commonly used front-end packages for easier installation. Like npm, it can be used to differentiate the packages as development and production packages during installation.

SystemJS is a module loader that can import modules at run time in any of the popular formats used today (CommonJS, UMD, AMD, ES6). It is built on top of the ES6 module loader polyfill and is smart enough to detect the format being used and handle it appropriately. SystemJS can also transpile ES6 code (with Babel or Traceur) or other languages such as TypeScript and CoffeeScript using plugins. You configure these things within System.config({ ... }) before importing your module.

jspm uses SystemJS to manage packages and their dependencies, so we need not worry about putting the packages in the right order to load them.

Now that we know what jspm and SystemJS are, let's see how to use them.

Setting up Our Environment

If you haven't already, you'll need to have Node.js installed. A particularly easy way to do this is to use a version manager (such as nvm) and is detailed in this quick tip. Once you're up and running with Node, you can install jspm globally by running the following from the command line:

npm install -g jspm

Now we can use the jspm command line interface. Let's set up a project:

mkdir new-project && cd new-project
npm init -y
npm install jspm --save-dev

This creates a directory named new-project, initializes an npm project and installs jspm locally. This is the recommended way of doing things, as it locks down the jspm version for a project and ensures upgrades to the global jspm will not alter the behavior of your application.

Another advantage of this approach is that if your project is deployed through a continuous integration build, you can configure the build process to use the local jspm package instead of having to install jspm globally on the server as well.

You can use jspm -v to confirm the local version.

$ jspm -v
0.16.34
Running against local jspm install.

To use jspm in a project, run the following command:

jspm init

You will be prompted for a number of settings, hit enter to accept the default values or type a different value to change them. The following screenshot shows an instance when the command is executed with default settings:

Running the jspm init command in the terminal

Continue reading %Modular JavaScript: A Beginners Guide to SystemJS & jspm%


by Ravi via SitePoint

The Cutting Edge of Browser Security

Browser exploits are a big deal. Browsers present a huge target population and extensive attack surface, and in recent years, attack methods have matured and been productized like never before. In this talk we'll walk through what we're doing to make Edge safer than any browser we've ever shipped with improvements like MemGC, module code integrity, and AppContainer isolation.

Continue reading %The Cutting Edge of Browser Security%


by Microsoft Developers via SitePoint

Watch: Working with Lambda Functions in Python

Lambda Functions in Python It’s not just Python, it’s programming! Take a sneak peak at one of the lessons from our recently released Python course, Wrapping Your Head Around Python. In this video, you’ll explore how to create anonymous functions in Python, lambda functions. Loading the player… Want to know more about Python? Watch the […]

Continue reading %Watch: Working with Lambda Functions in Python%


by Angela Molina via SitePoint

Animated Transition Effects with CSS and jQuery

A library of animated transition effects, powered by CSS Animations and jQuery.


by via jQuery-Plugins.net RSS Feed