Hak5
Save 10% at GoDaddy.com with coupon code HAK

Episode 1x06

From Hak5

Jump to: navigation, search

Synopsis

In this episode of HAK.5 Jon brings us a coding challenge, Wess builds a laser audio transmitter for his iPod, Harrison shows us why we should get to know our network neighbors better and Darren remotely installs VNC with a command line gem. Plus the conclusion to last month’s chilling cliff-hanger and guest appearances by Leo Laporte, Amber MacArthur, Mike Lazazzera and Frank Linhares.

Coding Challenge

Challenge:

Input: N, K
Output: Number of possibilities, you can add K-numbers so they give the result of N

(NOTE: This C code is fragmented, I got all I could from the episode, but there is still some missing where I have "Missing lines" in bold letters. Please help fill in the blanks to complete this document.)

Missing lines

// that they give result of N

// Get our data from the user
int n = 0;
cout << "Enter the value for n: ";
cin >> n;

int k = 0;
cout << "Enter the value for k: ";
cin >> k;

// Make sure they entered something
if( k == 0 || n == 0 )
{
	cout << "You didn't enter a value for
	system( "PAUSE" );

Possibly Missing lines

	// Call the find matches function
	vector< vector< int > > vMatches;
 	vector< int > vCurrent;

	findMatches( vCurrent, vPossible, k, VMatch ):

	// Print out the number of matches and each
	cout << "N = " << n << " K= " << k << " r " 

	for( int b = 0; b < vMatches.size();   b )
	{
		printMatch( vMatches[b] );
		cout << endl;
	}// End for b

Most Likely missing lines

Laser Audio Transmitter

Streaming audio from one side of your room from a computer/ portable music device to a stereo via a pen laser pointer

Parts List