NinethSense oWnZ mE!: Praveen’s drawing book

Choose a Topic:

Wed
16
Jan '08

Random quotes with PHP

I wrote a quick program for displaying random quotes in my forum signatures ;)
I share the code with you below

	// Random Quotes with PHP
	// Praveen - ninethsense
	// 16 January 2008
	
	header(“Content-type: image/png”);
	$file = file(“quotes.txt”);
	$txt = $file[rand(1, count($file)-1)];
	$txt = substr($txt,0,strlen($txt)-2);
	$im = imagecreate((strlen($txt)*8),15);
	$bgcolor = imagecolorallocate($im, 230, 230, 230);
	imagecolortransparent($im,$bgcolor);
	$col = imagecolorallocate($im, 0, 0, 0);
	imagestring($im, 2, 0, 0, $txt, $col);
	imagepng($im);
	imagedestroy($im);


Here is the demo: (try refresh)

http://www.ninethsense.com/quote/quote.php
'

BrowserResizer - a testing tool

Inspired form IE Developer toolbar, I made a simple browser resizing application in C#. Hope this tool will be a helper for testing websites.

Download from here (6.86KB)

I used SetWindowPos win32 API to achieve the goal. Also, go get the list of browzers, I used System.Diagnostics.Process.
Process[] p = Process.GetProcessesByName(browsers[b]);
SetWindowPos(p.MainWindowHandle, (IntPtr)null, 0, 0, int.Parse(size[0])-wa_width, int.Parse(size[1])-wa_height, 0u);


Appliation developed with C# under framework 2.x.
The CodeProject Microsoft Developer Network Official ASP.NET Forums Microsoft .NET Framework Community Microsoft Most Valuable Professional Kidoos forums Microsoft Visual Studio Developer Home Professional Information Technology Solutions Microsoft Research Home Kerala Microsoft Users Group Community Website