Thursday, April 13, 2006

 

Gotta Remember these!


x + y // AND
x · y // OR
x' // NOT

Tuesday, March 28, 2006

 

This could be something big in PHP!

I have read articles about FORM issues in PHP, and making
something that will be easy for:

  1. JS Validation
  2. PHP Validation
  3. FORM creation
  4. ----
  5. I want the previous values of the form to still be there
  6. I want error msgs
  7. I want form themes
  8. I want reusable components
  9. I want scrollbars!
  10. I want cookies (real cookies, and milk plz lol)
  11. I want it to be simple (KISS)
  12. I want it to be OO


<?
require "FormObjectTemplates.inc.php"
$formObj = new FormAll();
// The templates would have their own JavaScript validation
$formObj->addTextFromTemplate('name', txtName);
$formObj->addTextFromTemplate('howYouFeel', txtOneLineDescription);
$formObj->addCombo('cbBlah', 'Blah');

// This is PHP for submitting the form
if(isset($_POST['name']))
if($formObj->validatePOSTData())
$goodMessage = $formObj->getValidationMessage();
else
$error = $formObj->getValidationMessage();
// What we could do is instead of having validation problem MESSAGES
// We could send back objects so we can show an ERROR image right next
// To the form input that was invalid with a brief message of what went wrong.
?>
<script type="text/javascript">
<?
$formObj->printJavaScriptValidation();
?>
</script>
<?
$formObj->printHTMLForm();

Monday, March 27, 2006

 

CFLAGS

I have finally discovered what I shall use for GCC CFLAGS:

CFLAGS=-O3 -march=pentium4 -ffast-math -msse2


 

wine compile errors (X_SENTINEL)

Remember I'm using Debian SID (unstable), apt-get.

The GCC error when compiling wine [0.9.10] using libx11-dev [6.9.0.dfsg.1-4]:
#: gcc -c -I. -I. -I../../include -I../../include -I/usr/X11R6/include -D__WINESRC__   -D_REENTRANT -fPIC -Wall -pipe -mpreferred-stack-boundary=2 -fno-strict-aliasing -gstabs+ -Wdeclaration-after-statement -Wpointer-arith  -g -O2  -o bitblt.o bitblt.c
In file included from x11drv.h:30,
from bitblt.c:33:
/usr/X11R6/include/X11/Xlib.h:3583: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3583: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3583: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3596: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3596: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3596: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3609: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3609: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3609: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3614: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3614: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3614: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3846: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3846: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3846: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3850: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3850: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3850: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3862: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3862: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3862: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3890: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3890: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3890: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3894: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3894: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3894: warning: data definition has no type or storage class
/usr/X11R6/include/X11/Xlib.h:3934: error: syntax error before '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3934: warning: type defaults to 'int' in declaration of '_X_SENTINEL'
/usr/X11R6/include/X11/Xlib.h:3934: warning: data definition has no type or storage class


The problem is the x11-dev package doesn't say ANYTHING about _X_SENTINEL. I think before GCC 4.0, GCC supplied the _X_SENTINEL variable. But since we're using 4.0 that doesn't include it, we have to add it ourselves.
The solution: (add this to the beginning of /usr/X11R6/include/X11/Xlib.h):
/* _X_SENTINEL BS */
#if defined(__GNUC__) && (__GNUC__ >= 4)
# define _X_SENTINEL(x) __attribute__ ((__sentinel__(x)))
# define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y)))
#else
# define _X_SENTINEL(x)
# define _X_ATTRIBUTE_PRINTF(x,y)
#endif /* GNUC >= 4 */

Archives

March 2006   April 2006  

This page is powered by Blogger. Isn't yours?