Ultra Useful Regular Expression


# urlify - turn URL's into HTML links
my $text = "Check the website, http://www.oreilly.com/catalog/repr.";
$text =~ 
	s{
		b			# start at word boundary
		(			# capture to $1
		(https?|telnet|gopher|file|wais|ftp) :
					# resource and colon
		[w/#~:.?+=&%@!-] +?	# one or more valid
					# characters
					# but take as little as
					# possible
		)
		(?=			# lookahead
			[.:?-] *	# for possible punct
			(?: [^w/#~:.?+=&%@!-]	# invalid character
			  | $ )		# or end of string
		)
	}{<a href="$1">link</a>}igox;

What is Highway Safety?

Here’s a picture of my Toyota ’95 Pickup. About two weeks after buying it, a rock quary truck dropped a rock the size of a football in front of me on highway 522 (55 MPH == 110 MPH football sized rock) outside Monroe, effectively taking my Toyota logo with it. And seizing my hood shut. Luckily it stopped before it took out my radiator. Luckily no major damage to me!

TagCMA (latest)

In the last July & August I have been rewriting TagML in C#, along with adding a ton of new features. This new version incorporates collaboritive modeling. Which means multiple users will be able to animate a scene of models at the same time. I envision a rag doll, in which several persons each have hold of a different body part. Similar to stop-watch animation, each user can place the head, arms, body, and feet into the desired position for each frame in real-time. Which should cut down in animation time, theoretically.
Tag Applied Collaborative Modeling Application (TagCMA)
(C) Timothy A. Graupmann

Convert MAKEINTRESOURCE to C#

Ran into a small issue. There’s a C++ Macro called MAKEINTRESOURCE that is used heavily in Win32 programming. I’d be very interested in knowing if anyone has ported the macro to C#. Here is an [Article] that explains the problem in detail.

Actually the problem is simplier than I thought. Anything that uses MAKEINTRESOURCE, just pass a UInt16 in the field instead of a LPSTR and it works just fine.

Marshaling Data Types With Platform Invoke in C#

This is worth studying for you game designers/programmers. With DotNet and CSharp a lot of you are going the Windows.Forms route. I just wanted to present to you an alternative. The grunt work is done, so all you need to do is include the CSharp*.cs files and you are ready to go.

For fun I ported “GameTutorials Triangle(First OpenGL Program” to C# using
Win32. It keeps the existing framework of the original tutorial without using
Windows Forms. Take a look. This will safe others time that might want to
program OpenGL with Win32 calls in C#.

Tutorial: “[Triangle – My First OpenGL Program in C#]”

Update: Full Screen Mode now Works. Default Icon is now working. Figured out the MAKEINTRESOURCE problem. Some things that don’t work perfectly yet are commented out. For example, a memory leak that happens during painting. Anyone is welcome to email bugs or fixes.

I should note that I used the OpenGL ports from Nehe, but all the Win32 ports
are mainly from me. I used Pinvoke as a reference and found several answers in forums that blurred by.

[MSDN] Great mapping table between unmanaged types to C#.
Another great resource: [Pinvoke.net]