5 Useful Multi-Monitor Setup Tools

It seems that a lot of you love working on more than one monitor. At least that’s what the comments on my dual monitor setup post imply. I was in fact surprised to find that many are using a 3 monitor setup!

So the following are five tools that can greatly enhance your multi-monitor setup.

1. UltraMon

UltraMon is a must-have tool for Windows users on a multi-monitor setup. It adds a ton of functions (smart taskbar, quick window movements etc) that make managing the monitors a cakewalk.

2. MultiMon TaskBar

MultiMon TaskBar (Windows only) adds a taskbar to the second monitor which isn’t there by default when you are extending your primary monitor onto a new one.

3. Dual Monitor Tools

Dual Monitor Tools (again, Windows only) is a free and open-source multi-monitor management software that lets you play with wallpapers, move windows and do much more.

4. Synergy

Synergy is for those who not only use more than one monitor but, also, more than one operating system on those monitors. It lets you easily share the same keyboard and mouse across different platforms.

5. Keyboard Trick

This isn’t a tool but a trick Windows 7 users would find useful. If you are using a dual monitor setup with Windows 7, Win+Shift+Left/Right arrow key can quickly move the active window between monitors.

If you’ve been tempted and just getting started with more than one monitor, check out this multi-monitor setup guide. And if you’ve been using them forever, do suggest some tricks and tools in the comments (especially for Mac and Linux).

How Do You Ease into the Work Week?

A freelance friend of mine recently commented that she has a hard time transitioning from weekend to weekday. “How do you ease into your work week?” she asked. “Monday mornings are always killer!”

I’m afraid I have the opposite problem: work days and weekends blend together thanks to my BlackBerry and MacBook addictions. This means I rarely have a huge email overload on Monday morning, but I also miss out on the chance to feel completely relaxed and rested because I’m never fully unplugged. However, I do make sure I have something fun to do Sunday night (often watching Mad Men with the aforementioned friend), so I’ll start the week on a positive note. It helps that I also try to stick to roughly the same sleep schedule so I’m not throwing my circadian rhythms out of whack.

Your turn! How do you transition into the work week? Do you keep worktime and playtime clearly delineated? Or, like me, do you sometimes find they blend together?

The Newbie’s Guide to Test-Driven Development


Testing your code is annoying, but the impact of not doing so can be orders of magnitude more annoying! In this article, we’ll use test-driven development to write and test our code more effectively.


What is Test-Driven Development?

Since the dawn of the computer era, programmers and bugs have battled for supremacy. It’s an inevitable occurrence. Even the greatest programmers fall prey to these anomalies. No code is safe. That’s why we do testing. Programmers, at least sane ones, test their code by running it on development machines to make sure it does what it’s supposed to.


Sane programmer who tests his programs.
Image courtesy of http://www.youthedesigner.com

Insane programmer who doesn’t test his programs.
Image courtesy of http://www.internetannoyanceday.com

Test-driven development is a programming technique that requires you to write actual code and automated test code simultaneously. This ensures that you test your code—and enables you to retest your code quickly and easily, since it’s automated.

How does it work?

Test-driven development, or TDD as we’ll call it from now on, revolves around a short iterative development cycle that goes something like this:

  1. Before writing any code, you must first write an automated test for your code. While writing the automated tests, you must take into account all possible inputs, errors, and outputs. This way, your mind is not clouded by any code that’s already been written.
  2. The first time you run your automated test, the test should fail—indicating that the code is not yet ready.
  3. Afterward, you can begin programming. Since there’s already an automated test, as long as the code fails it, it means that it’s still not ready. The code can be fixed until it passes all assertions.
  4. Once the code passes the test, you can then begin cleaning it up, via refactoring. As long as the code still passes the test, it means that it still works. You no longer have to worry about changes that introduce new bugs.
  5. Start the whole thing over again with some other method or program.

Great, but how is this better than regular testing?

Have you ever purposefully skipped testing a program because:

  • You felt it was a waste of time to test, since it was only a slight code change?
  • You felt lazy testing everything again?
  • You didn’t have enough time to test because the project manager wanted it moved up to production ASAP?
  • You told yourself you’d do it “tomorrow”?
  • You had to choose between manual testing, or watching the latest episode of your favorite TV show (Big Bang Theory)?

Most of the time, nothing happens, and you successfully move your code to production without any problems. But sometimes, after you’ve moved to production, everything goes wrong. You’re stuck fixing a hundred holes in a sinking ship, with more appearing every minute. You do not want to find yourself in this situation.


Screw it, just move it to production!
Image courtesy of http://phenomenaonbreak.wordpress.com

TDD was meant to eliminate our excuses. When a program has been developed using TDD, it allows us to make changes and test quickly and efficiently. All we need to do is run the automated tests, and voila! If it passes all automated tests, then we’re good to go—if not, then it just means we broke something with the changes. By knowing which exact parts of the test failed, it also allows us to easily pinpoint at which part of the changes it broke, so it makes fixing the bugs easier.


Okay, I’m sold. How do we do this?

There’s a multitude of PHP automated testing frameworks out there we can use. One of the most widely-used testing frameworks is PHPUnit.

PHPUnit is a great testing framework, which can easily be integrated into your own projects, or other projects built on top of popular PHP frameworks.

For our purposes though, we won’t need the multitude of functions that PHPUnit offers. Instead, we’ll opt to create our tests using a much easier testing framework, called SimpleTest.

In the next steps, let’s assume that we’re developing a guestbook application where any user can add and view guestbook entries. Let’s assume that the markup has been completed, and that we’re simply making a class which contains the application logic of the guestbook, which is where the application inserts and reads to the database. The reading portion of this class is what we’re going to develop and test.


Step 1. Set up SimpleTest

This is arguably the easiest step of all. Even this guy could do it:


I can do this…I can use, my, um…brain!
Image courtesy of http://longstreet.typepad.com/

Download SimpleTest here, and extract to a folder of your choice — preferably the folder where you’re going to develop your code, or your PHP include_path for easy access.

For this tutorial, I’ve set up the folder like so:

Index.php will run guestbook.php, and invoke the view method and display the entries. Inside the classes folder is where we’ll put the guestbook.php class, and the test folder is where we place the simpletest library.


Step 2. Plan Your Attack

The second step, which is actually the most important one, is to start creating your tests. For this, you really need to plan and think about what your function will do, what possible inputs it will get, and the corresponding outputs it will send. This step resembles playing a game of chess—you need to know everything about your opponent (the program), including all his weaknesses (possible errors) and strengths (what happens if it successfully runs).

So for our guestbook application, let’s lay down the schematics:

View

  • This function will not have any inputs since it will just retrieve all of the entries from the database and send back the data to be printed out.
  • It will return an array of guestbook records, stating the name of the poster and his message. If there are no records, then it should still return an empty array.
  • If there are records, the array will have 1 or more values in it.
  • At the same time, the array will have a specific structure, something like:
Array (
    [0] => Array (
        ['name'] = "Bob"
        ['message'] = "Hi, I'm Bob."
    )
    [1] => Array (
        ['name'] = "Tom"
        ['message'] = "Hi, I'm Tom."
    )
)

Step 3. Write a Test!

Now, we can write our first test. Let’s start by creating a file called guestbook_test.php inside the test folder.

<?php
require_once(dirname(__FILE__) . '/simpletest/autorun.php');
require_once('../classes/guestbook.php');

class TestGuestbook extends UnitTestCase {

}

Then, let’s convert what we’ve determined from step two,.

<?php
require_once(dirname(__FILE__) . '/simpletest/autorun.php');
require_once('../classes/guestbook.php');

class TestGuestbook extends UnitTestCase {
    function testViewGuestbookWithEntries()
	{
		$guestbook = new Guestbook();
		// Add new records first
		$guestbook->add("Bob", "Hi, I'm Bob.");
		$guestbook->add("Tom", "Hi, I'm Tom.");
		$entries = $guestbook->viewAll();

		$count_is_greater_than_zero = (count($entries) > 0);
		$this->assertTrue($count_is_greater_than_zero);
		$this->assertIsA($entries, 'array');
		foreach($entries as $entry) {
			$this->assertIsA($entry, 'array');
			$this->assertTrue(isset($entry['name']));
			$this->assertTrue(isset($entry['message']));
		}
	}

	function testViewGuestbookWithNoEntries()
	{
		$guestbook = new Guestbook();
		$guestbook->deleteAll(); // Delete all the entries first so we know it's an empty table
		$entries = $guestbook->viewAll();
		$this->assertEqual($entries, array());
	}
}

Assertions make sure that a certain thing is what it’s supposed to be—basically, it ensures that what’s returned is what you’re expecting it to return. For example, if a function is supposed to return true if it’s successful, then in our test, we should assert that the return value is equal to true.

As you can see here, we test the viewing of the guestbook with entries and without. We check if these two scenarios pass our criteria from step two. You probably also noticed that each of our test functions start with the word ‘test.’ We did this because, when SimpleTest runs this class, it will look for all the functions that start with the word ‘test’ and run it.

In our test class, we’ve also used some assertion methods, such as assertTrue, assertIsA, and assertEquals. The assertTrue function checks whether or not a value is true. AssertIsA checks if a variable is of a certain type or class. And lastly, assertEquals checks if a variable is totally equal to a certain value.

There are other assertion methods provided by SimpleTest, which are:

assertTrue($x) Fail if $x is false
assertFalse($x) Fail if $x is true
assertNull($x) Fail if $x is set
assertNotNull($x) Fail if $x not set
assertIsA($x, $t) Fail if $x is not the class or type $t
assertNotA($x, $t) Fail if $x is of the class or type $t
assertEqual($x, $y) Fail if $x == $y is false
assertNotEqual($x, $y) Fail if $x == $y is true
assertWithinMargin($x, $y, $m) Fail if abs($x – $y) < $m is false
assertOutsideMargin($x, $y, $m) Fail if abs($x – $y) < $m is true
assertIdentical($x, $y) Fail if $x == $y is false or a type mismatch
assertNotIdentical($x, $y) Fail if $x == $y is true and types match
assertReference($x, $y) Fail unless $x and $y are the same variable
assertClone($x, $y) Fail unless $x and $y are identical copies
assertPattern($p, $x) Fail unless the regex $p matches $x
assertNoPattern($p, $x) Fail if the regex $p matches $x
expectError($x) Swallows any upcoming matching error
assert($e) Fail on failed expectation object $e

Assertion method list courtesy of http://www.simpletest.org/en/unit_test_documentation.html


Step 4. Fail to Win

Once you’re finished writing the code, you should run the test. The first time you run the test, it SHOULD FAIL. If it doesn’t, then it means that your test doesn’t really test anything.

To run your test, simply run guestbook_test.php in your browser. You should see this first:

This happened because we haven’t created our guestbook class yet. To do so, create guestbook.php inside your classes folder. The class should contain the methods we’re planning to use, but shouldn’t contain anything yet at first. Remember, we’re writing the tests first before writing any code.

<?php
class Guestbook
{

	public function viewAll() {

	}

	public function add( $name, $message ) {

	}

	public function deleteAll() {

	}
}

When you run the test again, it should look something like this:

As we can see here, our test is now winning by failing. This means that our test is now ready to get “answered.”


Step 5. Answer Your Test by Writing Code


At some point, we’ve all felt like this when we’re programming.
Image courtesy of http://fermentation.typepad.com/fermentation

Now that we have a working automated test, we can start writing code. Open up your guestbook.php class and start creating the answer to your test.

<?php
class Guestbook
{
	// To save time, instead of creating and connecting to a database, we're going to
	// simulate a "database" by creating a static entries array here.
	// It will be like we have two entries in the table.

	private static $_entries = array(
		array (
			'name' => 'Kirk',
			'message' => 'Hi, I\'m Kirk.'
		),
		array (
			'name' => 'Ted',
			'message' => 'Hi, I\'m Ted.'
		)
	);

	public function viewAll() {
		// Here, we should retrieve all the records from the database.
		// This is simulated by returning the $_entries array
		return self::$_entries;
	}

	public function add( $name, $message ) {
		// Here, we simulate insertion into the database by adding a new record into the $_entries array
		// This is the correct way to do it: self::$_entries[] = array('name' => $name, 'message' => $message );
		self::$_entries[] = array('notname' => $name, 'notmessage' => $message ); //oops, there's a bug here somewhere
		return true;
	}

	public function deleteAll() {
		// We just set the $_entries array to simulate
		self::$_entries = array();
		return true;
	}
}

This guestbook.php class has some bugs in it on purpose, so we can see what it looks like if our test fails.

Once we run our test, we should see something like this:

The test output shows us in which test and in which assertion our code failed. From this, we can easily pinpoint that line 16 and 17 was the assertion that threw the error.

<?php
require_once(dirname(__FILE__) . '/simpletest/autorun.php');
require_once('../classes/guestbook.php');

class TestGuestbook extends UnitTestCase {
...
...
...
	$this->assertTrue(isset($entry['name']));
	$this->assertTrue(isset($entry['message']));
...
...
...
}

This clearly tells us that the returned entry array did not have the correct array key. Based on this, we’ll easily know which part of our code went wrong.

<?php
class Guestbook
{
...
...
...
	public function add( $name, $message ) {
		// Here, we simulate insertion into the database by adding a new record into the $_entries array
		self::$_entries[] = array('name' => $name, 'message' => $message ); //fixed!
		return true;
	}
...
...
...
}

Now, when we run our test again, it should show us:


Step 6. Refactor and Refine Your Code

Since the code we’re testing here is pretty simple, our testing and bug fixing didn’t last very long. But if this was a more complex application, you’d have to make multiple changes to your code, make it cleaner so it’s easier to maintain, and a lot of other things. The problem with this, though, is that change usually introduces additional bugs. This is where our automated test comes in—once we make changes, we can simply run the test again. If it still passes, then it means we didn’t break anything. If it fails, we know that we made a mistake. It also informs us where the problem is, and, hopefully, how we’ll be able to fix it.


Step 7. Rinse and Repeat

Eventually, when your program requires new functionality, you’ll need to write new tests. That’s easy! Rinse and repeat the procedures from step two (since your SimpleTest files should already be set up), and start the cycle all over again.


Conclusion

There are a lot more in-depth test-driven development articles out there, and even more functionality to SimpleTest than what was displayed in this article—things like mock objects, stubs, which make it easier to create tests. If you’d like to read more, Wikipedia’s test-driven development page should set you on the right path. If you’re keen on using SimpleTest as your testing framework, browse the online documentation and be sure to review its other features.

Testing is an integral part of the development cycle, however, it’s too often the first thing to be cut when deadlines are imminent. Hopefully, after reading this article, you’ll appreciate how helpful it is to invest in test-driven development.

What are your thoughts on Test-Driven Development? Is it something you’re interested in implementing, or do you think it’s a waste of time? Let me know in the comments!

Us Writer To Write Six 500-word Articles For Womens Web ( 3

LOOKING FOR US/Canada/UK/Australia NATIVE WRITERS ONLY (NO non-English-born writers or writing groups)

PLEASE BID $30 FOR SIX 500-WORD ARTICLES ($5 EACH). We will not consider paying more until after you have written 20 articles for our website, and have consistently proven that you do not need an editor to meet our technical and editorial standards.

I am looking for several fresh new female-perspective writers for one of the top women\\\\\\\’s websites in the world (millions of readers each month). Our BEST writers are not professional journalists, but often full-time moms with interesting personal stories and excellent writing skills. Poor grammar and/or technical writing problems, however, are a kiss of death for this job, so respond ONLY if your writing work in high school and college was always error-free, and ONLY if you are always correcting your friends grammar.

Initially, you will be paid $5 per 500 word article written on keyphrase-targeted topics that we assign, and your editor will be paid $3 to manage and edit your work. Over time, if you prove to be good at this, you could earn up to $8 per article if an editor consistently determines that an editor is not needed.

At first, you will be given assignments for which you will be paid $5 each if the editor feels that the articles are usable. After that, you will be able to select your own topics from a list of SEO-researched writing assignments made by our publisher, and you will submit your articles directly to our content management system (similar to a blog-type editor). You will not receive a byline on the article in the beginning, and we own 100% copyrights on the material once we pay you for it — you cannot republish it, but you can link to it as your work (since this is a LARGE site, there is a great deal of resume value for publishing on our site).

The minimum standards for an article are:
– The article must be 500 words long, and be based upon personal experience or internet research on the topic
– SEO-Optimize by using the target keyphrase and variations of the keyphrase several times within in the article (additional details later)
– The work must be 100% original (we will use copyscape.com to check it)
– Submit the initial articles via email, but later articles will be submitted on the website directly
– You must complete articles within 7 days of being assigned them

If the first six articles are acceptable, you will be given specific feedback and more detailed writing instructions.

We pay every two weeks via Paypal.

IMPORTANT:
– Please provide samples of your writing, or links articles that have NOT been edited by a third party
– Tell me how many articles you would like to write per week for us
– Describe your writing experience, and what topics you most enjoy writing on
– Do NOT respond if you outsource writing to others — you MUST be the actual writer
– Do NOT respond if you are a career professional journalist and this pay seems to low to you.

A Simple Social Site Design

I need someone to design a social site for me based on two sites swom.com and www.followerhub.com is what i want:
1. I want a site that will allow users to have a place to place their advertisement for free and also include up to 10 search words that be used to locate their advertisement or locate their profile.
2. Every member can will be given 500 default points by signing up and will be allowed to use the points to search for specific friends that they want from any location.
3. Each member will be allowed to invite friends and every friend invited will earn them 5 points.
4.The advertisements can be searched using keywords chosen.
5. Only one advertisement will be allowed to feature next to the member profile and each time, the advertisement is clicked, 0.1 point is consumed.
6. There will be a payment system for buying additional points.
7.There will be the option to send direct message to all friends or just free.Check www.socialoomph.com how they set sending Direct message to followers.I need a facility to send such direct messages.
8. There will be the option to opt-in for direct messages from all friends or just few.
9.The site menu will be like the menu here meet.usincerely.com but next to my application, you will place my adverts
10. Lastly i currently run meet.usincerely.com but i will direct all their traffic to the next site i want you to develop.This site meet.usincerely.com has a database problems.
11. I want a social site that allow free membership and paid membership
I will provide more details during interview.My budget is $60.

Greeting Cards Wanted 2

>> Bid with peace of mind. I’ve selected “hide all bids” so nobody can view your bidding price or bidding details. So LET’S BID NOW! <<

I need 20 greeting cards with English greeting words. No animation needed. Just static cards will do. Format: PNG.

Experience in card designs is important.

Budget: $30 to $40
Please send at least 5 greeting cards designed by you for consideration.

Long-term partnership is important. Winner has the highest chance to win the next two projects. And a few more after that.

Thanks.

Vector/graphic Design For Homepage Needed

Hi,

we have a website where we used a lot those little figures:
two 3d humans give their hand for handshake
to add a little fun factor to a mostly dry and boring computer/programming related service/consulting website.

But these figures are now everywhere…
And we are bored…

And we are looking for a replacement.
We look for something:
– with a funny touch
– what underlines the page content (like, start page, clients, portfolio, contact, etc)
– what fits to our page

We are talking about 28-30 pages e.g. icons/pictures/whatever

The address of the current page and the relaunched page I will provide to you via message board.

If possible please provide some samples/ideas of what would be possible!

Create A Small Simple Game

I have a auction script created vby http://www.phppennyauction.com/ and heres what i want done

go here and download and view this video http://rpandassociates.biz/the+hunt.avi

I want this tied into my auction site, the site currently has a reward platform that i would like to tweek to incorporate this game

you will need to build game should have its own admin functions as laid out in video Ill provide all graphics. Theres many scratch card scripts i have one that could be used for this. at any rate you will either build from scratch use the broken one i have or find one to work, it must be secure NO LOOPHOLES anyways will need this to tie into the auction script for the adding and dedcuction of bonus points

pretty simple project especially if you use one of the readily available scratch off scripts as a base, So bid accordingly.. I have a real simple ebet scratch off script that might do the trick then i have a better one but i cant get it to install and the company wont refund the cash so if you wanted to fix it somekind of .htaccess error and use it i will provide it.

No copy and paste portfolios
i dont care if you have 0 reviews or 10k reviews
you will need to know
php
sql
cakephp
css
js

I will not pay upfront so dont ask no downpayments pre payments escrow etc. i will pay real fast upon completion and testing only. Check out my reviews here. No exceptions dont bid if you cant work under my payment terms. Ive been burned twice on here and its simply no tgoing to happen again… dont ask Ill blacklist you…:)

other than that im really easy to work for I do alot of outsourcing so if i like your work and your price i may hire you for other stuff.

No bids over my stated budget automatic removal do it twice i blacklist you from all my projects for not listening..

read every line of this
If you dont understand what im saying in the video dont bid
I dont want to teach you how to do your job or hold your hand while we develope this its a really simple project and i say this looking at these crappy scratch off sacripts ive purchased online… not much coding to it. I may even help you with the layout of stuff im also a programmer this work is overflow and i dont have time for it but if your price is right meaning low enough i may help with stuff to expedite the process and keep cost down.Im outsourcing this part of the project because i dont have time i cant be clear enough about that.. and i expect you to do this on your own meaning dont make me chase you down and ask whats goijng on please just do the work do it right dont ask me to test you need to test and then write me and say im finished i test this many times everythings good etc. then ill check and pay you.. Real simple..

I said i dont care if you have 0 reviews or 10k reviews but that doesnt mean im looking for rookie programmers, you must know what your doing and be at the top of your game, i will be inspecting the coding and wont be happy with sloppy coding all additions to coding will be commented added by you before and after additions/changes and you will make a backup of anything you touch…

if you say you can do this i expect it to be done and be done on time as noted in your bid, I want to see stuff happen live on my server and i expect atleast 1 email daily saying this is what was done this is whats left etc.

Happy Bidding ill pick someone in the next 6hrs..

TUAW Review: PinPoint Lightning wants to keep you alive

Wherever you live, lightning can be dangerous if you spend a lot of time outdoors. In the USA alone, an average of 58 people per year are killed by proximity to lightning strikes. PinPoint Lightning (US$5.99), a new app from MyWeather, LLC, hopes to reduce that number by providing push notifications of lightning strikes within 30 miles of your present location within seconds of a strike.

This app only provides lightning strike data for the USA and Canada, with information coming from the National Lightning Detection Network in the 50 states, and from Environment Canada in the Great White North. The strike data used by PinPoint Lightning is rather expensive, which explains the rather high cost of the app. For hikers, bikers, golfers, and anyone else who spends time working or playing outside, $5.99 is a small cost to pay for advance warning of nearby lightning activity.

TUAW received a review copy of the software, and PinPoint Lightning is an extremely well-done and functional app that does precisely what it is designed for. Read on for a full review of PinPoint Lightning.

TUAWTUAW Review: PinPoint Lightning wants to keep you alive originally appeared on The Unofficial Apple Weblog (TUAW) on Mon, 16 Aug 2010 20:00:00 EST. Please see our terms for use of feeds.

Read | Permalink | Email this | Comments

News roundup: Trek artists muse Apple design, Illustrator CS5 patched, Apple urged to pay dividends, free apps and more

Each week is busy and with summer winding down and several of us on vacation, we can’t hit it all at once. So here’s a little roundup of what happened over the past few days.

  • Ars Technica has a lovely chat with some designers from Star Trek: The Next Generation, the show where you may recall seeing an iPad-like device called the PADD (for Personal Access Display Device). You may be surprised to discover all those flat control panels were designed that way, in part, because they were cheaper than a panel with a bunch of physical buttons.
  • As Apple keeps piling up cash ala Scrooge McDuck, some folks are calling for the iCompany to start doling out that cash back to stockholders in the form of a dividend. It’s a familiar refrain (Microsoft gets this one frequently as has Google), although we’re not so sure Apple won’t need that cash in case the economy tanks again or in case they need to buy Facebook or Nintendo.
  • Illustrator CS5 had a bug, and Adobe patched it. Well, it was actually a pretty significant bug for people running professional work Macs and who had more than 4GB of RAM. Apparently the app would cause all sorts of bad things to happen. But this patch makes it better, so apply it now if you haven’t already.
  • Free apps! Toodledo is usually around $3 but is currently free. If you’ve been wondering what the hubbub about Scott Pilgrim is, you can download six volumes of the comic on your iPhone or iPad. Duck Hunt is also free today for your retro arcade pleasure.
  • MacRumors reports that Apple has hired a NFC (near-field communications) expert, which could herald ticketless concert trips for iPhone users, or the ability to buy stuff by just waving your iPhone around like an idiot. The future is soon!

TUAWNews roundup: Trek artists muse Apple design, Illustrator CS5 patched, Apple urged to pay dividends, free apps and more originally appeared on The Unofficial Apple Weblog (TUAW) on Mon, 16 Aug 2010 19:00:00 EST. Please see our terms for use of feeds.

Read | Permalink | Email this | Comments