Javascript News

Syndicate content
Pipes Output
Updated: 48 weeks 6 days ago

Using Sass’s @error, @warn, and @debug Directives

Do, 2015-08-27 00:00

Feedback methods are essential in any programming language. In JavaScript, you’ve probably used console.log() or maybe alert(). In PHP, you can use var_dump() or print_r(). In Ruby, you may use debug or inspect. All these functions allow you to debug any value and find out what your code is doing at any point in the logic where you need help.

Sass has three directives for providing feedback to developers. They are @error, @warn, and @debug. In this post, we’ll look at how to use these directives, what use cases they’re best suited for, and what kind of feedback they can provide for other developers who use our code.

Basic Syntax and Use

All three of these directives follow the same syntax:

[code language="sass"]
@directive "String of text to output.";
[/code]

If you need to interpolate a variable’s value in that string, you can do so using the standard Sass interpolation (#{$variable}) and the value will be printed in the string. With this method, you can tell a developer both the name of the variable and its current value:

[code language="sass"]
@error "Sorry, but `#{$variable}` is not a valid value for $variable.";
[/code]

Note that the ticks (`) around the interpolation are not required. You may want to include them because they give the developer an obvious start/stop point for the variable’s contents.

If a developer makes a mistake when using your Sass code, these directives will send the specified message to the compiler and the compiler will show that message to the developer. For example, GUI apps (like CodeKit) will show a system notification with the error. Certain Grunt and Gulp notification packages can do that as well.

If a developer is compiling with the command line (Sass, Compass, Grunt, or Gulp), the message will likely end up in their console (Terminal, iTerm2, Putty, etc). If you’re writing Sass online with Sassmeister or Codepen, you’ll only get limited feedback, but you may get an inline notification in your editor or text in the output window.

Now that we know how to write @error, @warn, and @debug messages and where they’ll appear for the developer, let’s look at the difference between these directives and the best uses for each one.

Stop Everything – The @error Directive

Sass’s @error directive stops the Sass compiler completely and sends its string of text to the compiler’s output as a fatal error. Use this directive when you need to send a message that stops the developer immediately and forces them to correct their mistake right away. This is ideal for letting a developer know they’ve done something wrong or entered a value that’s entirely incompatible. Sass will include the line number with any fatal error, including @error output. The @error directive is ideal for validating arguments within a mixin or function.

Note: If your compiler is older than Sass 3.4 or LibSass 3.1, @error is not available. You can use this log() function to emulate @error in older Sass versions.

As an example, if you’ve written a function that relies on a certain input format for its calculations, you can validate the input and use @error to stop the compiler and alert the developer that they’ve made a mistake that can’t be overlooked. If you’ve written a function that relies on a key/value pair from a map, @error can make sure that the key that’s called from the map actually exists.

This Sass color management tool uses @error to ensure that the developer only uses a color name that’s a valid CSS color name or a key from a related map:

Map:

[code language="sass"]
$colors: (
brand-red: #c0392b,
brand-blue: #2980b9,
text-gray: #2c3e50,
text-silver: #bdc3c7
);
[/code]

Function:

[code language="sass"]
// Ignore the `$variation: false` bit here,
// or read the post for more information.

@function color-variation($color, $variation: false) {
@if map-has-key($colors, $color) {
$color: map-get($colors, $color);
} @else {
@if type-of($color) != color {
@error "Invalid color name: `#{$color}`.";
}
}
}
[/code]

Usage:

[code language="sass"]
.element {
color: color-variation(brand-orange);
}
[/code]

Output:

[code language="bash"]
>> Invalid color name: `brand-orange`.
>> Line 9 Column 7 sass/test.scss
[/code]

In this example, if the developer tries calling the color-variation() function with a string that’s neither a valid CSS color nor a key from the $colors map, there’s nothing Sass can do to output a valid color. Using @error gives the developer specific, actionable feedback.

Continue reading %Using Sass’s @error, @warn, and @debug Directives%

Getting Hired as a Developer: Tips from Senior Recruiters

Mi, 2015-08-26 22:00

There's no magic bullet for getting hired as a developer. But there is some great advice available to help in the process.

I recently interviewed Matt Langan and Christian Macolino, two Senior Tech Recruiters over at Atlassian. I wanted to get a realistic understanding of the subject from the perspective of the people involved with hiring tech talent for a $3.3 billion software company.

This article looks at issues surrounding getting hired, including some practical tips and pointers that arose out of the interview.

Resumes and Online Portfolios

Let's start with tried-and-tested resumes and portfolios. Through these, we present everything that's important about us to recruiters, interviewers, and anyone else involved in the hiring process.

Often developers invest more time in this portion of job hunting than in the actual searching process.

Digital or traditional?

When looking for a position with a tech company in particular, we might assume that digital portfolios—personal websites and online resumes—would be preferred to standard-format resumes. But that's not always the case. Especially for non-design roles, recruiters care more about just getting the information they need.

Christian phrased it this way:

As long as we've got the data there—enough information that we can dig into about their experience, and ask the right questions—that's all that we care about.

This also applies for smaller firms, or non-tech companies whose hiring processes involve more managerial oversight and less tech.

However, for those smaller companies, the online portfolio may be as important or more so. With less expertise and testing available to gauge your worth, a company may resort to carefully analyzing your past work even more than a large tech company might. Only you can judge how much time each of these tools is worth—by carefully considering what your target positions are.

Choosing Your Path

When we discussed education and the very first positions that developers take on, Matt had the following advice regarding education and getting started:

Get involved in side projects, hobbies, start a blog, join in on discussions on forums, get involved with Stack Overflow or Github, ask questions, provide answers, take part in coding competitions, go to tech meetups.

In your current job, master what you're doing, ask for more responsibility, and help others learn—particularly those more junior to you.

This, of course, is excellent advice. If you've been hired for a particular discipline, use your side projects not only to keep up with that core language or tool, but also to spread out your knowledge base and gain at least a basic understanding of some other languages, software, and other tools.

Constant learning is critical. On the point of continual education, Christian had a sobering point:

The first five years of your career really set the stage. In a new role or area, you're like a sponge, you're open to learning, you're curious, you ask questions.

But after the four or five year mark, you start to know a lot, people look to you for guidance, and your learning starts to switch off a little bit. So if you learn bad practices and bad habits early on in your career, you'll actually carry those with you.

Self assessment

For those already beyond that point, maybe this is time for some self-assessment.

Take a moment to consider where you are in your career. Are you still learning from your coworkers, your users, and your projects? Are you self-improving and growing through personal side projects? Do you still have a passion for your work?

Find the passion

It seems to be a common factor with a lot of companies that a passion for development is critical. Sometimes, especially for junior roles, it can even matter more than the specifics of education or knowledge.

Yet many of us are so caught up in the job security quest that we forget what drew us to programming in the beginning. We fail to realize sometimes that the passion and drive that got a lot of us here is what employers want.

Make a change

If you're already employed as a developer, and you're not still learning, and you're no longer passionate about your career, then consider what you can do to extract yourself from that position and change things. It could be as simple as an attitude shift or a change in responsibilities at your current workplace. It could be as dramatic as switching positions, employers, or even career paths.

Sometimes the hardest part is simply making the change. Beware of sticking with the status quo just because it's easier.

Continue reading %Getting Hired as a Developer: Tips from Senior Recruiters%

Responsive Web Design: Where Do We Go From Here?

Mi, 2015-08-26 21:00

This article is part of a web development series from Microsoft. Thank you for supporting the partners who make SitePoint possible.

I had the great pleasure of delivering the closing keynote at Responsive Day Out 3: The Final Breakpoint. Held in Brighton, UK on 19 June 2015, the conference is a gathering of designers and developers sharing their workflow strategies, techniques, and experiences with responsive web design.

Here’s what I had to say.

Today has provided an amazing tour of the world of responsive design. We’ve seen how to level-up our workflows and processes. We’ve learned new ways to improve the accessibility of our products. We’ve grappled with modern CSS and HTML capabilities that help us embrace the hugely variable display sizes that swirl and whirl around us.

We’ve explored the future of modular code and browsers’ capacity for working without network connectivity. And we’ve even taken a trip into the possible future of where the web might go.

We’ve come a long way since Ethan’s article, fluid grids, flexible media, and media queries. Those three tenets sowed a seed that has grown and flourished as we have come to better understand the implications of device proliferation. We’ve seen that the web is capable of going anywhere and doing pretty much anything.

I would argue that “Responsive Web Design” was the first article that really managed to capture the concepts that John Allsopp had discussed so many years before in “A Dao of Web Design” and distilled them into something the design and development community could really sink their teeth into. It provided a concrete example of the web’s ability to flex and mold itself into whatever shape it needed to take on.

It was the first time many designers had come to terms with the idea that “experience” was not some monolithic thing.

Sure, many of us in the web standards community had been talking the talk and walking the walk with regard to progressive enhancement. And we were gaining converts, but progress was slow. Ethan demonstrated—directly and succinctly—what the progressive enhancement of visual design could look like.

Providing an identical experience for each and every human being that tries to access our sites would be impossible. There are simply far too many factors to consider. We’ve got screen size, display density, CPU speed, amount of RAM, sensor availability, feature availability, interface methods … breathe … operating system type, operating system version, browser type, browser version, plug-ins installed, network speed, network latency, network congestion, firewalls, proxies, routers, and probably a dozen other factors my mind is incapable of plucking amid the whirlwind of technical considerations.

And that doesn’t even consider our users.

When it comes to the people we need to reach for our work to actually matter, we have to consider literacy level, reading acumen, level of domain knowledge, cognitive impairments like learning disabilities and dyslexia, attention deficit issues, environmental distractions, vision impairment, hearing impairment, motor impairment, how much they understand how to use their device, how much they understand how to use their browser, how well-versed in common web conventions they are, and a ton of other “human factors”.

Every person is different and everyone comes to the web with their own set of special needs. Some are always with them, blindness for example. Others are transient, like breaking your mousing arm. Still others are purely situational and dependent on the device you are using at the time and its technical capabilities or constraints.

Trying to devise one monolithic experience for each and every person to have in every context that considers every factor would be impossible. And yet, Sir Tim Berners Lee had a vision for a web that was capable of going anywhere. Was he insane?

Sir Tim’s vision for the web was that content could be created once and accessed from anywhere. Disparate but related pieces of “hypermedia” scattered across the globe could be connected to one another via links. Moreover, they would be retrievable by anyone on any device capable of reading HTML. For free.

Ultimately, Sir Tim envisioned universal accessibility.

For a great many of us, ensuring our websites are accessible is an afterthought. We talk a good game when it comes to “user centered” this or that, but often treat the word “accessibility” as a synonym for “screen reader”. It’s so much more than that. “Accessibility” is about people. People consume content and use interfaces in many different ways, some similar and some quite dissimilar to how we do it.

Sure, people with visual impairments often use a screen reader to consume content. But they might also use a braille touch feedback device or a braille printer. They probably also use a keyboard. Or they may use a touchscreen in concert with audio cues. Or they may even use a camera to allow them to “read” content via OCR and text-to-speech. And yes, visual impairment affects a decent percentage of the populace (especially as we age), but it is only part of the “accessibility” puzzle.

The contrast between text and the background is an important factor in ensuring content remains readable in different lighting situations. Color choice is an accessibility concern.

The language we use on our sites and in our interfaces directly affects how easy it is for our users to understand what we do, the products we are offering, and why it matters. It also affects how we make our users feel about themselves, their experience, and our companies. Language is an accessibility concern.

The size of our web pages has a direct effect on how long our pages take to download, how much it costs our customers to access them, and (sometimes) even whether or not the content can be reached. Performance is an accessibility concern.

Continue reading %Responsive Web Design: Where Do We Go From Here?%

Introducing enquire.js

Mi, 2015-08-26 20:00

For some time now, I’ve been using the enquire.js library to augment the use of media queries in JavaScript. I’ve had a lot of success using the library in various projects, but most developers I’ve met confessed they’ve never used or even heard of it.

In this article, I want to introduce you the library, explain why and how you’d want to use it.

What is enquire.js?

enquire.js is a lightweight, pure JavaScript library for responding to CSS media queries. In my own words, enquire.js gives you additional functionality and flexibility on top of window.matchMedia() when working with media queries in JavaScript.

The library was written by Nick Williams and it’s been around for about three years, having a healthy amount of open source activity. Its aim is not to replace or polyfill matchMedia; rather, it exists to provide additional functionality around media queries that don’t exist natively.

Why Would I Use It?

There are lots of use cases where enquire.js could be used, including:

  • Move nodes around the DOM
  • Load supplementary content (e.g. ads) via Ajax
  • Load and run a JavaScript library (e.g. Packery) to enhance a page

Each of these use cases is covered in the following sections.

Continue reading %Introducing enquire.js%

5 Beautiful Hotel Themes for WordPress

Mi, 2015-08-26 19:15

Despite its original intended use as blogging software, WordPress has succeeded to surpass many expectations and serve for much more universal purposes, turning it into a “Jack of all trades”. In many cases, WordPress is able to save a lot of effort and money for a range of rather complex websites, which would require much more resources.

Check-in!

Hotel and accommodation websites are among the group of websites which don’t require highly complex website infrastructure. That said, it isn't always possible to meet requirements with a WordPress installation out-of-the-box. You might not be a hotel owner, but you may need to deal with a hotel project at some point. For this case, I will introduce you to a fine selection of tasty hotel themes for WordPress which will get the job done, no matter it's a 5 star hotel or an AirBnB-like hostel.

Hotel Master

Continue reading %5 Beautiful Hotel Themes for WordPress%

CSS Properties to Control Web Typography

Mi, 2015-08-26 18:00

Web typography has the advantage of drawing on the wealth of knowledge belonging to the centuries-old tradition of print typography. By the same token, that tradition carries with it standards of best practices and excellence that web typography is called on to live up to.

However, the web as a medium of communication comes with its own peculiarities. So much so that we’re led to think that a seamless move from print to web typography is a tough call. In his book On Web Typography, p.110, Jason Santa Maria explains:

Printed books are a static format. From the designer’s initial layout of the book to its trip to the press bed, the warehouse, the bookshelf, and your hands, the output of that book doesn’t change. It’s delivered exactly as the designer conceived it.

When it comes to the web, the very same site can be experienced very differently according to a number of factors, e.g., various kinds of devices, screen resolutions, personalized browser settings, etc. Some of these factors, as Jason further explains …

… may give us the impression that the type is too small, others may cause us to miss something important just off screen, and still others may make it nearly impossible to view the web page at all.

That said, it’s also true that “The web is the best place for text.”, as Tim Brown claims in his talk on Universal Typography. Text on the Internet can be “searched, copied, translated, linked to other documents, it can be printed, it’s convenient, it’s accessible”.

The flexibility of the web doesn’t mean relinquishing control. On the contrary, as web designers, we’re still expected to make informed choices about anything we put into our work, and text is no exception. The way text elements are laid out, their color, size, typeface, all this and more communicate a website’s core message and brand.

To manipulate the appearance of text on the web, our primary tool of choice is CSS.

The CSS properties I’m going to present in this post can be found in the CSS Text Module specification.

This module describes the typesetting controls of CSS; that is, the
features of CSS that control the translation of source text to
formatted, line-wrapped text.

In other words, The CSS Text Module deals with the display of characters and words in the browser, and how they’re spaced, aligned, hyphenated, etc., using CSS.

What constitutes a basic unit of text or word, as well as where exactly a word is allowed to break in a given piece of text, significantly depends on the rules of the language being used in a website. For this reason, it’s important to declare this information in the HTML document (usually in the lang attribute of the <html> element).

Here, I won’t be discussing the following two topics:

  • fonts, that is, the visual representations of characters, i.e. glyphs, and their properties;
  • features of CSS related to text decoration, such as underlines, text shadows, and emphasis marks.

If you’re curious, you’ll find the latest documentation on fonts and text decoration properties in the CSS Fonts Module Level 3 and the CSS Text Decoration Module Level 3 respectively.

Manipulating Letter Case

There can be times when text elements need to be displayed in capital letters, for instance first and last name. CSS gives us control on letter case with the text-transform property.

The default value of the text-transform property is none, that is, no effect on letter case is applied.

The capitalize Value

If you’d like the first letter of each word to be displayed in uppercase while leaving the appearance of all other letters unaffected (whatever their case in the HTML document), using the value capitalize will achieve this:

The HTML:

[code language="html"]
<h2>alice's adventures in wonderland</h2>
[/code]

The CSS:

[code language="css"]
h2 {
text-transform: capitalize;
}
[/code]

Notice how capitalize doesn’t follow title case conventions: in fact, all first letters in the above example appear capitalized, including the word “in”. Authors who intend to follow a literary convention concerning titles will need to manipulate the letters manually in the source text.

The uppercase Value

If your goal is to have all letters displayed in uppercase, no matter their case in the HTML document, uppercase is the appropriate value to use:

The HTML:

[code language="html"]
<h2>alice's adventures in wonderland</h2>
[/code]

The CSS:

[code language="css"]
h2 {
text-transform: uppercase;
}
[/code]

The lowercase Value

Using the value lowercase will cause all letters to be displayed in lowercase. Naturally, this won’t affect the appearance of letters that are already lowercase in the original source document.

The HTML:

[code language="html"]
<h2>Alice's Adventures in Wonderland</h2>
[/code]

The CSS:

[code language="css"]
h2 {
text-transform: lowercase;
}
[/code]

The full-width Value

The specification has added a new value, full-width. This value constrains the character to appear inside a square as if it were an ideographic character, e.g., Japanese, Chinese, etc. This facilitates aligning Latin characters with ideographic characters.

Continue reading %CSS Properties to Control Web Typography%

What Makes a Startup Website Great?

Mi, 2015-08-26 17:47

Startups are taking over the Internet. It’s like we have an idea for everything and a website to go with it. If you don’t believe me just spend 10 minutes on Product Hunt. With all this competition around, how can you ensure that your startup’s website is a cut above the rest? In this article, […]

Continue reading %What Makes a Startup Website Great?%

Watch: Conditional Rendering in React

Mi, 2015-08-26 17:30

Today we'll build upon last week's Stopwatch component with conditional rendering. We'll conditionally show the "start" and "stop" buttons based on the state of our component. Additionally, we'll add a "reset" button so we can reset the timer.

This is part 2 of the Building a Stopwatch in React series.

Loading the player...

Continue reading %Watch: Conditional Rendering in React%

Firefox 40: Profiling JavaScript Performance and More

Di, 2015-08-25 22:00

Firefox 40 comes with some powerful new tools and some interesting shifts in strategy by Mozilla. Read on for the biggest changes in Firefox and what they mean for you.

New Performance Tools

Firefox 40 features new profiling tools that give developers a better understanding of what's happening from a performance standpoint within their applications. Developers can use these tools to profile performance in any kind of website, app, or game.

The Performance tab contains the new timeline, including three views:

  • a Waterfall view, giving insights into how your app is performing in the browser:

  • Call Tree view, highlighting any JavaScript performance bottlenecks:

  • Flame Chart view, showing the state of the JavaScript stack at every millisecond during the performance profile:

Mozilla Hacks has produced a video introduction to the new performance tools:

[youtube WBmttwfA_k8]

There's also a demo of how to optimize the JavaScript in an HTML5 game using the new performance tools.

Head over to the Mozilla Hacks article for more details on the new performance tools.

Continue reading %Firefox 40: Profiling JavaScript Performance and More%

10 Common Mistakes Web Developers Make

Di, 2015-08-25 19:30

This article is part of a web development series from Microsoft. Thank you for supporting the partners who make SitePoint possible.

There seems to be endless choices regarding how to accomplish the same task - to develop a website that works in today’s modern web. Web developers have to choose a web hosting platform and underlying data storage, which tools to write HTML, CSS, and JavaScript in, how design will be implemented, and what potential JavaScript libraries/frameworks to include. Once choices are narrowed down, the online world is filled with articles, forums, and samples that provide tips for making a better web experience. Yet no matter which path is taken, all developers are susceptible to mistakes. Although some mistakes will be related to a specific approach, there are challenges shared among all web developers. So through research, experience, and recent observations, I thought I would share a list I compiled of ten common mistakes I see web developers make - and how to avoid them.

The following list is in no particular order.

1) Writing Old School HTML

Mistake : The early days of the internet had much less options for markup than we do today. However, old habits die hard, and many still write their HTML as if we were still in the 20th century. Examples here are using

elements for layout , or elements when other semantic-specific tags would be more appropriate, or using tags that are not supported in current HTML standard such as or , or spacing items on a page with a large number of entities.

Impact : Writing last decade’s HTML can result in over-complicated markup that will behave inconsistently across multiple browsers. And it’s not necessary in more recent modern browsers like Microsoft Edge and even past versions of Internet Explorer (11, 10, 9).

How to avoid : Stop using

element for layout of content, and limit usage for it to displaying tabular data. Get acquainted with the current markup options available such as seen at whatwg.org. Use HTML to describe what the content is, not how it will be displayed. To display your content correctly, use CSS ( http://www.w3.org/Style/CSS/).

2) “It Works in My Browser…”

Mistake : A developer may be fond of a particular browser or really despise one, and might primarily test web pages with that bias in-view. It is also possible that code samples found online may be written without factoring how it would render in other browsers. Also, some browsers have different default values for styles.

Impact : Writing a browser-centric site will likely result in very poor quality when displayed in other browsers.

How to avoid : It would not be practical to test web pages in every browser & version during development. However, having a regular interval of checking how your site will appear in multiple browsers is a good approach. Nowadays free tools to help are readily available regardless of your preferred platform: free VMs, site scanners. Sites such as http://browsershots.org/ or https://www.browserstack.com/show snapshots of how a given page would render over multiple browsers/versions/platforms. Tools such as Visual Studio can also invoke multiple browsers to display a single page you are working on. When designing with CSS, consider “resetting” all the defaults as shown at meyerweb.com.

If your site is using any CSS features created specific for a browser, be cautious as to how you will approach vendor prefixes such as -webkit-, -moz-, or -ms-. For guidance on industry trends in this regard, it would be worth your time to examine the following references:

While the above references explain a movement away from vendor prefixes and why, this site provides practical suggestions on how to work through this today.

Continue reading %10 Common Mistakes Web Developers Make%

Watch: Reviewing CSS Animation Performance

Di, 2015-08-25 17:30

In this video we'll look at CSS animations, frame rates, and why some CSS properties are better to animate than others.

This is part 1 of the How to Hit 60fps with CSS Animations series. Watch out for part 2, coming soon.

Loading the player...

Continue reading %Watch: Reviewing CSS Animation Performance%

Using the YouTube API to Embed Video in an Android App

Di, 2015-08-25 17:00

The YouTube Android Player API enables you to incorporate video playback functionality into your Android applications. The API allows you to load and play YouTube videos (and playlists) and to customize and control the video playback experience.

You can load or cue videos into a player view embedded in your application's UI. You can then control playback programmatically. For example play, pause, or seek to a specific point in the loaded video. You can register event listeners to get callbacks for certain events, such as the player loading a video or the player state changing. The API also has helper functionality to support orientation changes as well as transitions to fullscreen playback.

Continue reading %Using the YouTube API to Embed Video in an Android App%

The Release-Ready Agile Team

Di, 2015-08-25 16:30

This article was sponsored by Atlassian. Thank you for supporting the sponsors who make SitePoint possible.

In today’s world of startups and exciting new products, engineering teams are expected to deliver long lasting and durable software in an increasingly short amount of time. Agile practices are helping teams meet this demand by enabling them to release early and often. If you’ve ever wondered how Agile can help your team, or how it helps the most successful teams to release on schedule with every sprint, then look no further. Over 500k agile projects are in JIRA, and Atlassian has taken a closer look at them in order to find the common trends that help to make these teams so successful.

Planning

Every successful team treats sprint planning as one of the most important phases of the agile process. Without a good sprint planning process, your team cannot guarantee a release on time and budget. So, what do the most successful agile teams do to ensure a productive sprint planning phase?

For starters, Atlassian found that on average no more than 30 issues were assigned to a sprint. This is an important part of ensuring that your engineering team isn’t taking on more work than they can realistically handle. When deadlines pile up, teams tend to see an increased workload. While this is often expected, it’s important to remember that rushed code is more likely to create technical debt over well planned and carefully written code. While sometimes a difficult standard to hold to, a limit on tickets per sprint will go on to help your team release code that lasts.

Another common metric found by Atlassian was that the most successful agile teams had an average of 12 “epics” in their backlogs. This is an important find because it highlights a team’s ability to visualize what’s coming next in the release plan. It’s also important to remember that backlogs are useless without communication. Your team might have a well-groomed backlog, but it’s important to make sure that your team leaders spend time looking through it while communicating the upcoming requirements to the rest of the team.

Tracking

Tracking the health of every sprint is another key factor that enables successful agile teams. One of the core metrics found by Atlassian was that on average, a sprint lasted for 10 days. If it seems difficult to fit an entire sprint in such a small time frame, it’s okay to move issues into a backlog. The key here is balance. Your team needs time to complete the sprint, but they also need time to review backlogs, adjust goals, and hold meaningful retrospectives. A sprint that lasts too long may detract from these equally important aspects of a successful agile process. Give your team time to reflect and refocus, and they’ll thank you with a successful release.

How much work should be in a 10 day sprint? Atlassian found that 73% of planned issues were completed. This usually occurs because teams often try to complete more work than they are capable of completing in a short time frame. Keeping track of your agile process gets a lot easier when your team is not overwhelmed by how many issues they have left to complete. It’s always better to decrease the amount of issues in your sprint if it means improving the health and clarity of your team.

Continue reading %The Release-Ready Agile Team%

Adobe Stock Will Change the Way You Work

Di, 2015-08-25 15:30

Depending on how long you've been around, you probably use stock photography every day. It doesn't matter if you are a print designer or a website design, or you create mockups, stock photos are an essential part of creating a professional design for your client.

Adobe recently announced that they had acquired Fotolia, for the sole purpose of providing quality stock photography to Adobe Creative Cloud members in a unique way. After months of integration work, the result is Adobe Stock Now, not only do Creative Cloud members who want to access and manage a huge library of stock content, the integration of Creative Cloud with Adobe Stock also solves some problems that have plagued designers for years.

The Typical Scenario

Think of how many times you have been working on a client project that required high-level stock photography.

  • You spend time searching for just the right image.
  • You either pay per download, you purchase credits, or you have a certain number of allotted downloads per month.
  • You spend your valuable credits downloading an image only to realize it just won't work.

It's frustrating, and it's a waste of money, but you add the image to a folder on your hard drive, hoping to be able to use it somewhere else. You end up scrapping the image and wasting your time, your money, and your revenue.

How Adobe Stock Solves This

While you are inside of Photoshop CC, you can click to link directly to the Adobe Stock website. When you arrive, you can search for images with specific keywords, which is typical of any professional stock photography site.

When you find the right image, you can add the watermarked image directly to your Creative Cloud library, which makes the image immediately available in your Photoshop CC, Illustrator CC, or InDesign CC (and Premiere Pro CC and After Effects CC) apps, where you can easily add it to your design. You can try out the watermarked version, adding effects to it, and making sure it is right for your creative vision - all before making a purchase.

Continue reading %Adobe Stock Will Change the Way You Work%

Easy Form Validation in AngularJS with ngMessages

Mo, 2015-08-24 20:00

Last fall, the ngMessages module was rolled out with the release of Angular 1.3. This added enhanced support for displaying messages to the user — typically error messages from form validation. Before the release of ngMessages, developers were forced to rely on directives such as ng-class and ng-show to display these errors. This resulted in cluttered, repetitive code.

Now, however, ngMessages provides the ability to display custom error messages without having to violate the D.R.Y. principle of coding — Don’t Repeat Yourself. And, as Angular steadily progresses towards version 2.0, Angular’s development team continues to roll out new features for it. Therefore, I thought it would be beneficial to demonstrate just how easy ngMessages makes the process of validating forms in AngularJS.

Getting started

This will be our basic template:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>ngMessages demo</title> </head> <body ng-app="app"> <script src="path/to/angular.min.js"></script> <script src="path/to/angular-messages.min.js"></script> <script> var app = angular.module('app', ['ngMessages']); </script> </body> </html>

As you can see, we are loading Angular, followed by the ngMessages module, before injecting it into our application. For those of you wishing to folow along at home, the code for this tutorial is available on GitHub. For the impatient, you can also skip to the demo at the end of the article.

Next we are going to create a form with the following fields:

  1. First Name
  2. Last Name
  3. Email Address
  4. Phone Number
  5. Message

I will add a required attribute to all of the fields (as they will be compulsory), as well as using an ng-model directive to bind them to properties on the current scope.

<form name="exampleForm" class="myForm" required> <label>First Name:</label> <input type="text" name="userFirstName" ng-model="firstName" required /> <label>Last Name:</label> <input type="text" name="userLastName" ng-model="lastName" required /> <label>Email Address:</label> <input type="email" name="userEmail" ng-model="email" required /> <label>Phone Number:</label> <input type="email" name="userPhoneNumber" ng-model="phoneNumber" required /> <label>User Message:</label> <textarea type="text" name="userMessage" ng-model="message" required></textarea> </form> Enter ngMessages

Now let’s dive into the code and check out how ngMessages allows us to use the attributes we specify on the inputs for simple form validation.

Required Fields

The first thing you should take note of is that the form is named exampleForm. When using the ng-messages directive, we pass it an angular expression evaluating to a key/value object (typically the $error object on an ngModel instance). In our case this will be the name of the form, chained to the name attribute of the respective form field, chained to the aforementioned $error object.

<div ng-messages="exampleForm.userFirstName.$error">

Once that is done, you just need to nest a div containing an ng-message attribute inside of the ngMessages div. The value passed to the ng-message attribute will depend upon the directives we added to the input field; in this case, the value will be required.

Continue reading %Easy Form Validation in AngularJS with ngMessages%

Building a WordPress Carousel Plugin: Part 2

Mo, 2015-08-24 19:00

A carousel is not just a list of links, it exists to display the links as items in a way that makes them more attractive. In our previous article we saw how to create a carousel, and how to display the HTML elements we need. Now it’s time to style our carousel.

Our carousel is currently a simple list of links, by the end of this article we will have a properly formatted carousel. We’ll see how to apply the styles we need to have the result I showed you in the sample image in Part 1. Of course there are many properties that you can customize, websites don’t have to be the same around the world!

First we’ll look at how we can properly link a CSS file to a web page within WordPress. Then we’ll style our elements, which will demonstrate some CSS tricks that can be useful in many different situations.

Linking an External CSS File

To make the styling of our carousel as flexible and easy as possible, we limited the use of inline styles to only one attribute, the background of each item. For all the other styles we will use an external CSS file (stylesheet). You can chose your own name for the file (such as carousel.css) and place it in your plugin’s folder (or in a subdirectory).

To include the file we’ll use the wp_enqueue_style() function as described in our article about the right way to include a script.

We can’t call this function just anywhere, it must be called before the call of wp_head() (unlike a script, we can’t include a CSS file in the footer!). We can use wp_enqueue_scripts, which is called when WordPress includes the scripts and the styles for the current page (in the front-end), so it’s perfect for this application.

The code below must appear in your plugin’s main file.

Continue reading %Building a WordPress Carousel Plugin: Part 2%

Getting Started With The Particle Photon

Mo, 2015-08-24 18:00

Late last year, the team at Particle announced their newest device - the Photon. After eager anticipation, my Photon arrived in the mail this week. I decided to give it a test run and compare the process to working with the Particle Core.

The Photon is the follow up device to their Particle Core, a tiny microcontroller with cloud connectivity. You may know it as the Spark Core - they renamed themselves recently and are now Particle! I've previously written about the Particle Core in my articles on Cloud Connected NeoPixels Using The Particle Core and Monitoring Your Particle Devices With IFTTT. Those demos are applicable to the Photon too - the Photon is pretty much backwards compatible with Core apps.

In this article, I'll cover the basics of connecting the Photon to Wi-Fi and what is involved in running some basic example code on it. First, I'll explain what some of the differences in hardware are in comparison to the Particle Core, for those who are already well versed in working with the Particle ecosystem and just want to know the hardware details!

Hardware Differences

For those who have used the Particle Core, there are a few hardware differences:

The MODE button has been renamed

The MODE button has been renamed to the SETUP button. This means when you want to reset your device, you hold down the SETUP button instead. Makes a lot more sense now to be honest.

Pin A6 is now a DAC pin

For those only looking to do simple builds with your Particle Photon similar to their efforts with the Particle Core, you can ignore this difference and refer to it as A6 in your code to use it as an analog or digital input just like you would have with the Particle Core. However, it is now capable of more than that!

The DAC pin's true calling in life is as a Digital to Analog Converter (DAC). This is a pin which accepts digital signals and converts them to an output voltage between 0 and 3.3V. This brings possibilities of outputting audio like voice and music or initiating the movement of mechanical parts.

Moving motors and such was already possible via the Pulse-Width Modulator (PWM) output pin capabilities of some of the pins on the Core, however PWM pins do not output a true analog signal with varying voltage. PWM pins' "duty cycle" can be varied to change the average power of the signal output. Audio and other more exact uses of analog outputs was not possible via PWM.

The DAC pin gives you a true analog pin output option. To use the DAC capabilities, refer to it as DAC or DAC1 in your code.

Pin A3 can also apparently run as a DAC output, if you refer to it as DAC2 in your code.

Pin A7 is now a WKP pin

WKP stands for Active-high Wakeup Pin. This pin can still be used as an analog or digital input on A7 in your code, however it can also be used to wake the Photon from sleep or standby. It can also be used as a PWM pin.

Improved Wi-Fi, CPU and Memory

The Photon uses a different and more reliable Wi-Fi chip - Broadcom's BCM43362 chip. The Photon's CPU is more powerful than the Core up from 72Mhz to 120Mhz. Flash memory is also up from 128KB of flash memory to 1MB and RAM is up from 20KB of RAM to 128KB. Overall, your creations should run even smoother on the Photon!

For more detailed hardware info, see the Photon Datasheet.

Getting Started With The Photon

I purchased the Photon Kit which delivers the Photon packed in a really neat little box which comes prepped with a sample breadboard diagram and a few sample components (an LED, two resistors and a light sensor) for people to get started. If you are new to the world of microcontollers, you will have enough to work out the absolute basics from their kit.

For my own simple test, I'll be connecting the LED they provide and blinking it using their sample code. My main aim is to compare the process of connecting the Photon to Wi-Fi, getting code onto it and to compare the overall hardware. Rest assured, there will be plenty of more complicated Photon powered demos in the coming months that build upon this!

I followed their breadboard layout, however I prefer setting up my microcontroller closer to the edge of the breadboard, so I've moved things down a bit. Overall - it is the same as the sketch provided in the Photon kit just without the light sensor connected. I connected the LED to pin D0 (the longer positive end to B19 on my breadboard and shorter end to B18) and connected a resistor between ground (A27 on my breadboard) and the negative end of the LED (A18 on my breadboard).

The example code we will select further down in this article actually has two LEDs, so you could add a second LED to D7 to make this a bit more exciting. I was focused on a quick set up and trial of the deployment process for this article, rather than accurately testing the code itself.

To connect the Photon to Wi-Fi, you can either connect it via a smartphone app or via USB. We'll be covering the smartphone app process here. It is almost exactly the same idea as the Core pairing process.

You'll need the new Particle smartphone app, which you can get on the iPhone App Store and the Android Play Store. I found it to be a lot prettier than the Spark app, it has a really lovely design. All of my instructions below are referring to the Android version of the app, I did not have access to an iPhone to try the other version but I am assuming most of the steps are the same.

Upon installing it and logging in using your Particle log in, you'll see a list of your devices. If you are like me and you have played around with Particle Cores in the past, you'll see these listed already:

Continue reading %Getting Started With The Particle Photon%

Watch: Fundamental PHP Arrays and Array Functions in PHP

Mo, 2015-08-24 17:30

In this screencast I'll walk you through 5 useful functions PHP provides to manipulate and extract data from arrays.

Loading the player...

Continue reading %Watch: Fundamental PHP Arrays and Array Functions in PHP%

Re-introducing PDO – the Right Way to Access Databases in PHP

Mo, 2015-08-24 16:00

PDO is the acronym of PHP Data Objects. As the name implies, this extension gives you the ability to interact with your database through objects.

Why not mysql and mysqli?

The very valid question people ask when confronted by a new technology is simply, why should they upgrade? What does this new technology give them that is worth the effort of going through their entire application and converting everything to this new library, extension, or whatever?

It’s a very valid concern. We’ve written about this to some degree before, but let’s go through why we think it’s worth it to upgrade.

PDO is object-oriented

Let’s face it: PHP is rapidly growing, and it is moving toward becoming a better programming language. Usually, when this happens in a dynamic language, the language increases its strictness in order to allow programmers to write enterprise applications with peace of mind.

In case of PHP, better PHP means object-oriented PHP. This means the more you get to use objects, the better you can test your code, write reusable components, and, usually, increase your salary.

Using PDO is the first step in making the database layer of your application object-oriented and reusable. As you will see in the rest of this article, writing object-oriented code with PDO is much simpler than you may think.

Abstraction

Imagine that you have written a killer application using MySQL at your current workplace. All of a sudden, someone up the chain decides that you must migrate your application to use Postgres. What are you going to do?

You have to do a lot of messy replaces, like converting mysql_connect or mysqli_connect to pg_connect, not to mention all the other functions you used for running queries and fetching results. If you were using PDO, it would be very simple. Just a few parameters in the main configuration file would need changing, and you’d be done.

It allows parameter binding

Parameter binding is a feature that allows you to replace placeholders in your query with the value of a variable. It means:

  • You don’t have to know, at runtime, how many placeholders you will have.
  • Your application will be much safer against SQL injection.
You can fetch data into objects

People who have used ORMs like Doctrine know the value of being able to represent data in your tables with objects. If you would like to have this feature, but don’t want to learn an ORM, or don’t want to integrate it into an already existing application, PDO will allow you to fetch the data in your table into an object.

The mysql extension is no longer supported!

Yes, the mysql extension is finally removed from PHP 7. That means if you’re going to use PHP 7, you need to change all those functions to mysqli_* instead of mysql_*. This is a great time to just upgrade straight to PDO because of how much it helps you in writing maintainable, portable code with much less effort.

I hope the reasons above have convinced you to start integrating PDO into your application. Don’t worry about setting it up; you may already have it on your system!

Continue reading %Re-introducing PDO – the Right Way to Access Databases in PHP%

6 Unique Geometric Fonts You Need in Your Toolkit

Mo, 2015-08-24 15:00

Typography is one of the most dynamic and ever-changing areas of design and it is determinant for the overall user experience of a work. Indeed, fonts give the possibility to evoke feelings and to convey ideas to the users just by choosing the appropriate fonts according to the circumstance.

In websites and in mobile applications, sans-serif fonts are usually preferred because they don’t have as many visual embellishments. This makes them a good fit for the flat design aesthetic and keeps readability high.

Sans-serif fonts are divided into four categories:

-####Humanist -####Grotesque -####Neo-grotesque & -####Geometric

In this article we're going to look at some designers who really know how to use geometric fonts well – and then we'll pick out a handful of fonts for our own projects.

Let’s go!

What Exactly Do We Mean By 'Geometric Fonts'?

As the name suggests, these fonts are based on simple geometric shapes such as circles and squares. Geometric fonts are used mainly for headings of printed works but also for web or mobile design projects.

Experts trace the rise of geometric fonts to the Bauhaus, the German art school which operated from 1919 to 1933.  It is no coincidence that 'Futura, one of the most famous geometric fonts, was released in 1927 by Paul Renner, a Bauhaus artist.

Geometric Fonts In Use**

Let’s now have a look at some examples of how geometric typefaces can be used with good results.

Jova

Jova is a construction enterprise which is specialized in renovations of houses and shops.

Their website features an unconventional navigation menu which is based on a grid-style layout and it creates a professional, simple and refined look which goes well with the brand image.

The designers decided to write the text with a geometric font: I think it is a good choice because the linearity of the subtle typeface reinforces the overall design.

Le Parc Records

My second example is “Le Parc Records”, a music label. Here, the website is able to evoke a dark, modern powerful vibe thanks to the rich background images and the font used.

Indeed, some spectacular photos are sliding but, without a proper typeface the global effect would be less strong. Although the font is a bit bizarre, it is definitely attractive. The font is a geometric one which has no decorative serifs at the tips of the letters, but instead employs small inserts in some letters such as “O” and “X”.

This shows that geometric fonts not only work well in a sharp, elegant and clean setting like Jova, but also in cooler and edgier situations like Le Parc.

Comedy Central

The last example is an American television channel, “Comedy Central”.  A few years ago, Comedy Central underwent a rebranding process which introduced a new logo and a new look.

The operation was carried out by “theLab”, a creative production agency, which decided to use the geometric font “Brandon Grotesque” to put into evidence the confidence and maturity of the company.

The font always appears in uppercase and it is used in the logo as well as in almost all the text which is present on the website. This evokes an idea of elegance and competence but at the same time, with the help of some images, it lets leak out the sense of humour which distinguishes Comedy Central.

Geometric Fonts: Get some!

Now that we have seen what geometric fonts are, it’s time to hunt down some of the best fonts you can download from the web.

Attitude

The designer of “Attitude”, Emil Kozole, says that the creation of the font was inspired by the Japanese and American popular culture of the early ‘90s. With this font, the designer, wanted to make some experiments with letters and shapes. The result is a typeface not unlike the one used in “Le Parc Records”.

The font has 7 different versions: “regular”, “inline”, “3d”, “sliced”, “soldier”, “drunk” and “wasted”. Each version, with the only exception of “inline”, has 2 different styles: “regular” and “alternate”. Since “Attitude” is minimal but also stylish, it can be used for posters, clothes design, magazines and cd covers and, of course, for headings of websites.

The font can be downloaded for free.

Download link Biko

[Biko.png]

Biko is a geometric sans serif font created by Marco Ugolini for Monofonts. The name is a tribute to Steve Biko, a South African activist who fought against the Apartheid.

Biko has a friendly but also strong character which makes the typeface good for websites, mobile apps, texts and logos.  It is available in four different families: light, regular, bold and black.

If you need the font for personal use, you can download Biko for free at: www.dafont.com/biko.font.

Download link

Continue reading %6 Unique Geometric Fonts You Need in Your Toolkit%