Creative Meat Blog
Design

Oneupweb : So You Want to be A Graphic Designer?

Posted by admin in Design, Freebies, Opinions, Tools on January 24, 2012 - 4:42 pm

You want to be a Graphic Designer but no one will hire you because you don’t have any experience. Sound familiar? In general, for any fresh person trying to break into a career pathway, it can be incredibly difficult to get hired. No awesome employer wants to hire a person with no experience but you can’t get experience without someone taking a chance, right? WRONG!

What to do, what to do!?!?

Not to worry, friend, your life is not bleak and meaningless. Many employers won’t hire you without experience, so make your own! This is especially easy in the design world, seeing as how everyone and their mom seems to need something from you. That website you built for Timmy’s Aunt Nancy’s Kitten Mitten business? EXPERIENCE! That logo you drew for that awesome death metal band? GUESS WHAT?!?!?! It wasn’t only fun it was also experience!!!

To make it look and sound professional you need to specify whether is was contract or freelance. Did I hear someone whisper if there is a difference? Why yes, of course there is, silly goose! Contract is someone you do repeat business with on a non-regular basis. You have been contracted to do multiple items or have gone back for more. Freelance is that weirdo you picked up off of Craigslist that needed their hair created into vector art. You signed up for one project and probably won’t be doing more.

But, I don’t have any friends and I don’t want to venture on Craigslist as I am nervous about creepers, help me!

Not to worry there is another, completely viable option: Volunteer!

Not only does volunteering make you look super awesome on your resume, but it also gives you that ever coveted experience. You might also get a chance to make a difference in your community, even around the world! My favorite place to go for volunteering is Sparked. You don’t have to leave your couch and you get the opportunity to help the causes that you are passionate about. If you are a lucky duck you’ll even get the chance to work with some highly recognized causes and companies. Lastly, it’s super easy and walks you through every step of the way, plus you no longer have to feel like a bum for sitting on your couch not showering for weeks on end.

To recap: You need to create your own opportunities to get a kick-ass job. Volunteering is a great resource because it makes you feel good, you get some great experience, you are helping people and with Sparked, you don’t have to leave your cozy man cave.

GD Star Rating
loading...
Design

Oneupweb : The Internet’s Dark Day

Posted by Jess in Design, Fresh Meat, Opinions on January 20, 2012 - 3:10 pm

I’m part of the generation who has essentially grown up around computers. We have had an internet connection for so long that I don’t even remember not having one. But Wednesday, January 18th was a game changer for the World Wide Web. In protest of the SOPA and PIPA bills that Congress and the House of Representatives will vote on January 24th, Wikipedia turned off service for 24 hours. Google blacked out its logo. Hundreds of sites, big and small, protested the censorship these bills would bring to the internet. We even joined the blackout by adding black bars to our website.

The statistical results are pretty astounding (here’s a great infographic describing them). There also were some cool design concepts that websites employed during the blackout. Filmmaker Michael Moore blacked out his website and you could essentially use the mouse cursor as a flashlight to cast a circle of light over his message.

Wikipedia was one of my favorites; it reminds me of a post-apocalyptic area where everything has been destroyed. And while a censored internet isn’t exactly comparable to an apocalypse, I think these bills would be very devastating to the internet as we know it.

GD Star Rating
loading...
Development

Oneupweb : OOP Naming Conventions

Posted by Robert in Development, Opinions, Tutorials on January 18, 2012 - 6:10 pm

While working with different Object Oriented Programming (OOP) languages and frameworks, I’ve seen quite a few approaches on how to format various items. The line between personal preference and “best practices” has become blurry when dealing with naming conventions.

I have no idea what I'm doing: dog on a computer.Some decent advice on that subject is to adapt to the style of the current environment. However, even within languages it’s not uncommon to find inconsistencies. For example, take a look at the concatenated acronyms in XMLHttpRequest for JavaScript. XML is all uppercase, while Http is mixed upper and lowercase. There is no clear text treatment, making it unintuitive and more difficult to remember.

For this reason, it is a good idea to treat acronyms as words. While not immediately clear, it eliminates the guess work when attempting to recall a particular class, method or attribute; especially since acronyms tend to evolve. For example, the phrase “Away From Keyboard” eventually became “AFK” and is commonly typed as “afk”. By treating it as a word, you won’t have to guess which casing to use, just follow your chosen convention.

So, what if you have the chance to write your own library from the ground up? Perhaps something portable that shouldn’t be married to one particular language or uses many languages; what naming practices should you follow then? Of the examples I’ve seen and used in the past, here is what I personally prefer on a basic level.

class ClassName
{
  public static const MAX_USERS = 15;

  public var variable_name = "foo";

  private var _variable_name = "bar";

  public function methodName()
  {
    // do something
  }

  private function _methodName()
  {
    // do something
  }
}

ClassName

Classes use upper camel case, meaning each concatenated word begins with a capital letter followed by lowercase letters.

class ClassName
{
  // stuff
}

methodName

Methods use lower camel case, meaning the first word is all lowercase, while each additional word begins with a capital letter followed by lowercase.

public function methodName()
{
  // do something
}

variable_name

Variables use lowercase words, separated with underscores. They are dynamic objects that are usually defined on a per instance basis.

public var variable_name = "hello world!";

CONSTANT_NAME

Constants use uppercase words, separated with underscores. They are unchanging values and are typically also static (accessible directly from a class).

public static const CONSTANT_NAME = "foobar";

// accessible through the containing class without a need to instantiate.

var variable_name = ClassName.CONSTANT_NAME;

_private_variable and _privateMethod

Private variables and methods are prefixed with “_” (underscore). They are accessible only from within the object instance in which they are used. By placing an underscore before the name, the scope is instantly recognizable, keeping them separate from public variables and methods.

private var _variable_name= "foo";

private function _methodName()
{
  return "bar";
}

There are other considerations that play even deeper into personal preference, such as curly-bracket “{}” placement for functions vs loops vs if-statements. Spacing for within and around parentheses “()” is equally preferential. How you format your code is ultimately up to you and how you find it the most readable.

Again, what I mentioned above is very generalized and won’t necessarily stand well in some languages. Adapt to your environment and please, do leave comments below. I enjoy reading other programmers thoughts and opinions.

GD Star Rating
loading...
Design

Oneupweb : And I Need it Now

Posted by Nicole in Design, Opinions on January 12, 2012 - 2:28 pm

It’s 1:00 in the afternoon. You’ve just gotten back from your lunch and have a deadline due at 5:00 this afternoon. You have no ideas and what you’ve come up with so far just isn’t cutting it. You’re so stressed out that you can’t think of anything and everything you do come up with isn’t working. It’s almost 2:00, now. You’ve broken three pencils and already tried to flee the building. What do you do now?

All designers have been in this position; a project needs to be out the door as soon as possible and there seems to be no solution in sight. So, what do you do when your client needs that project right now and you’ve got no ideas?

Here are a few methods to make you feel Less Stressed and More Awesome (don’t worry, none of these steps involved stopping, dropping or rolling in dirt)

  1. Take a break Step away from what you’re working on and just relax. Take a walk around the building, check out some blogs, have a post-it war with  the neighboring office… It doesn’t really matter what you do, so long as you give yourself a moment away from the project.
  2. Go back to your thumbnails Sometimes we all need a quick trip back to the drawing board. Sit down and look through your thumbnails. If you need to, make a few more sketches for different directions. Stepping away from the computer helps your brain reboot.
  3. Consult with another designer Getting feedback and discussing your problem with another designer can help break the creative roadblocks caused by stress. If you don’t have another designer available, look up examples of similar projects and see how the problem was handled. It might give you the breakthrough you need. And of course…
  4. Don’t Panic!

Stressful deadlines are tough to handle, but making it work can make you feel like a superhero (Exact-o-Man?) and make for innovative solutions you probably wouldn’t have thought of without a little incentive. I wouldn’t say I want to be stressed out every day, but it’s definitely nice to feel Awesome once in a while.

Sneaking out of the building is still an option...

Of course, sneaking out of the building is still an option...

GD Star Rating
loading...
Development

Oneupweb : Cross Browser Event Binding Without jQuery

Posted by Brian in Development, Tutorials on January 10, 2012 - 6:05 pm

This past weekend I was having a conversation on JavaScript with a developer friend of mine and we got on the topic of how jQuery has drastically altered the JavaScript landscape. Don’t get me wrong, jQuery is an excellent library. It makes cross browser events and effects a snap. The problem is it has become universally depended on for even trivial tasks. There seems to be a tendency to learn jQuery and not JavaScript.

People asking JavaScript questions on a site like Stack Overflow are inundated with responses to the effect of “why not just use jQuery.” Well yes… you could accomplish it that way, but it doesn’t help the asker of the question to understand anything new about JavaScript.

an honest question

An honest JavaScript question

A not so helpful response

A not so helpful response

Do It The Right Dom Way

If all you need to accomplish is a simple hide/show function at the click of a button, then why include the whole jQuery library? Do you really need all that code mucking up your window for such a simple task? Lets go over the basics of creating a nice lean cross browser event and css tool in JavaScript.

Binding Events

The trick to binding events that work in multiple browsers is basically understanding the Internet Explorer method and the standard method defined by the W3C.

element.addEventListener

This is the standard way to setup events in a document. A great introduction to this method can be found on the Mozilla Developer Network.

The syntax is as follows:
target.addEventListener(type, listener, useCapture /* Optional */);

document.getElementById('mybutton').addEventListener('click',function(e){
    //"this" refers to the event target ie the button that was clicked
    alert(this.value);
},false);

The function you pass in to addEventListener will receive the event object as its first argument. Within the function the this keyword refers to the element that was clicked. The false passed at the end keeps the element’s parents from getting to the event first (this is ok for most basic uses);

element.attachEvent

Internet Explorer is not historically known for working with standards. Internet Explorer, before version 9 (though 9 still supports it), relied on element.attachEvent for event binding.
The syntax for this is:
target.attachEvent(ontype, listener);
Just replace type with the event you would normally use in element.addEventListener. So click becomes onclick, change becomes onchange, etc…

document.getElementById('mybutton').attachEvent('onclick',function(){
    //attachEvent relies on a global event object to get the target
    var elem = event.srcElement;
    alert(elem.value);
},false);

A Cross Browser Function

You can’t just choose one or the other. Ideally you will have one way to bind an event and you should be confident that whether your document is being viewed in IE7+, Firefox, Chrome or whatever – the events should all work the same.

Our function needs to test whether or not the browser supports element.addEventListener or element.attachEvent and react appropriately.

var bindEvent = function(elem ,evt,cb) {
    //see if the addEventListener function exists on the element
	if ( elem.addEventListener ) {
		elem.addEventListener(evt,cb,false);
    //if addEventListener is not present, see if this is an IE browser
	} else if ( elem.attachEvent ) {
        //prefix the event type with "on"
		elem.attachEvent('on' + evt, function(){
            /* use call to simulate addEventListener
             * This will make sure the callback gets the element for "this"
             * and will ensure the function's first argument is the event object
             */
             cb.call(event.srcElement,event);
		});
	}
};

Not so bad right? You now have a cross browser way to bind events without all the stuff you don’t need.

Using the Function

This function is really easy to use.

var button = document.getElementById('button');
bindEvent(button,'click',function(e){
    alert(this.value);
});

Test this in IE7+ and your favorite modern browser and see it in action.

Making Your Own Event Tool

One of jQuery’s most attractive features is the syntax. We can mimic this syntax in a simple way and still trim a ton of fat. We will make a simple tool that allows us to cash in on this syntax.

Introducing Boss.js:The Lightweight JavaScript Library

Ok…not really. This is overly simplified, but it demonstrates how easily this can be done. Create a file called boss.js. We are going to use the module pattern to create our library. Explaining all this is a bit beyond the scope of this article, but I will try to comment things for the adventurous. Put the following code in this file:

(function(){
    //the function we just made
	var bindEvent = function(elem,event,cb) {
		if ( elem.addEventListener ) {
			elem.addEventListener(event,cb,false);
		} else if ( elem.attachEvent ) {
			elem.attachEvent('on' + event, function(){
				cb.call(event.srcElement,event);
			});
		}
	},

    //we will use the popular dollar symbol
	$ = window.$ = function(id) {
        //the $ returns a new Boss object
		return new Boss(id);
	},

    //the Boss object constructor
	Boss = window.Boss =  function(id) {
        /* rather than have full selector support, Boss only supports id's
         * boss stores a reference to the elment for later use
         * we explicitly check to see if the id is the window
         * for cases where we want to bind events to the window
         * (something like a load event)
         */
         if ( id === window ) {
             this.elem = window;
         } else {
             this.elem = document.getElementById(id);
         }
    };

    //set up the methods that belong to a Boss object
	Boss.prototype = {
        //this is just a wrapper over our bindEvent function
		bind:function(etype,cb) {
            //use the elem reference
			bindEvent(this.elem,etype,cb);
            //return the Boss object for chaining
			return this;
		},
        //a simple getter setter for style values
		css:function(property,value) {
            //if the property and value are both passed, we are setting the css
			if ( property && value ){
				this.elem.style[property] = value;
            //otherwise we are returning it
			} else if ( property ) {
				return this.elem.style[property];
			}
		}
	};

})();

Save it and Boss.js is born.

Using Boss.js In a Web Page

Setup a simple web page with the following:

<!doctype html>
<html lang="en">
<head>
	<title>JavaScript events</title>
	<script src="./boss.js"></script>
</head>
<body>
	<form action="" method="get">
		<p>
			<input type="button" name="button" value="Toggle Visible" id="button" />
		</p>
		<div id="toggleMe">
			Now you see me!!
		</p>
	</form>
</body>
</html>

Then in the header we will attach to the load event of the window to make sure our document is read. Place the following code in the head section of your document, right below the script element that includes Boss.js:

<script>
$(window).bind('load',function(){
	var toggleMe = $('toggleMe');
	$('button').bind('click',function(e){
		var display = toggleMe.css('display');
		display = (display === "none") ? "block" : "none";
		toggleMe.css('display',display);
	});
});
</script>

The bindEvent function is a simple way to handle events without the whole jQuery library. It’s proof that you can use native JavaScript to accomplish a lot.

GD Star Rating
loading...