code :: real 3D in flash

papervision3D logo

so i finally got a copy of adobe cs3 and flex builder2. flex is amazing, combining mxml and actionscript 3 together into a seamless package. now that im on the as3 tip, i decided to dive into papervision3D. pv3d is a set of actionscript classes that are used to create 3D objects within the flash environment. it's currently in beta and the source code is only available to osflash emailing list members. so if you want it signup here. thanx to carlos for creating pv3d, and to his girlfriend for convincing him to release the project open source!

wii flash integration

code :: using the wiimote with as3

as i have been checking out the new features of actionscript 3 and flex, i stumbled upon this site is run by joa ebert + thibault imbert, and their mission is full flash wiimote integration. 

currently wiiflash supports multiple wiimotes and nunchuks, the classic controller, as well as pc sensor bars. all you need is a bluetooth enabled pc (or adaptor) and a wiimote.

the newest version is available from wiiflash or googlecode or you could get on the mailing list

pure php email validation

code :: using regular expressions

$email = '';
if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
    //invalid email
} else {
    //valid email

SQL get last ID

code :: mssql and mysql

here's a simple SQL script that returns the last row created. this is great for when you add a new record that has an autogenerated id and you need that number.


CREATE PROCEDURE [dbo].[getLastLogin]
FROM dbo.login


SELECT * FROM `login` 
LIMIT 1,1;

graphic reset buttons

code :: w/o javascript

i was having some trouble at work creating form buttons with graphics for reset buttons. i just thought someone might be interested in my non-javascript solution:

<button style="background: none; border: none;">
<img src="reset.jpg" alt="" />

post and querystring vars in dotnet

code :: c#

here's a nice little snip of c# code. this is meant to be used in an web application. the following code will return either a querystring variable or a post variable, it tries both and finds the valid one.

public string RequestParam(string paramname)
    string result = string.Empty;
    if (Context.Request.Form.Count != 0)
        result = Convert.ToString(Context.Request.Form[paramname]);
    else if (Context.Request.QueryString.Count != 0)
        result = Convert.ToString(Context.Request.QueryString[paramname]);
    return (result == null) ? string.Empty : result.Trim();