Wednesday, November 19, 2008

User Authentication


/*
user.authenticate
Determine if the user blackbeard with a password of avast888 is valid.
*/

include('xmlrpc-2_1/lib/xmlrpc.inc');
include('class.RevverAPI.php');

$api = new RevverAPI('https://api.staging.revver.com/xml/1.0?login=revtester&passwd=testacct');

$username = 'blackbeard';
$password = 'avast888';

$results = $api->callRemote('user.authenticate', $username, $password);

echo '
';
var_dump($results);
echo '
';

?>

Create Video


/*
video.create
Create the metadata for video 65535.
*/

include('xmlrpc-2_1/lib/xmlrpc.inc');
include('class.RevverAPI.php');

$api = new RevverAPI('https://api.staging.revver.com/xml/1.0?login=revtester&passwd=testacct');

$id = 65535;
$title = 'My New Parrot';
$keywords = array('parrot', 'pet');
$ageRestriction = 1;
$options = array('url' => 'arrvideos.example.com', 'author' => 'Billy Doyle');

$results = $api->callRemote('video.create', $id, $title, $keywords, $ageRestriction, $options);

echo '
';
var_dump($results);
echo '
';

?>

Sunday, November 9, 2008

Heap Demo project

Heap Demo is a project designed to show the relationship between virtual and committed
memory during heap use. Using a contrived scenario, a stair-step growth of virtual
memory can be observed in perfmon.

Open a new cpp file in Visual Studio. copy and paste code from this post. compile the file it will create project for u. then u can proceed further

1. Start the HeapDemo application.
2. Open perfmon.
3. Add counters for Virtual Bytes and Private Bytes for the HeapDemo Process.
4. Change the scale for each counter to 0.0000001 (lowest value).
5. Press ENTER on the console for HeapDemo to start the allocations.
6. Watch the perfmon window as memory is allocated.

Note the stair step behavior of virtual memory. Each time the private bytes nears the amount
of virtual bytes reserved, the memory manager extends the heap by reserving more virtual
memory. Each time the heap is extended, it reserves twice as much as the previous reservation.

// Tthe entry point for the console application.
//

#include
#include

void Test();

int main(int argc, char* argv[])
{
Test();

return 0;
}

void Test()
{
int nCount = 0;
int nTotal = 0;
char c;

// scanf in here only to hold process in initial loaded state to set up PerfMon.
printf("Set up Process Object's Private and Virtual Bytes for Heapdemo.exe, then hit ENTER to start the test\n");
scanf(&c);

Sleep(1000);
while(nTotal < 200000)
{
nCount++;
int (*i)[1024] = new int[100][1024];
nTotal += 100;
printf("Allocated: %d KB\n", nTotal);
Sleep(50);
}

printf("Hit any key to end the test and release all memory\n");
scanf(&c);
}

Your Title