[PHP] Sad PHP Poem

2006-06-25 Thread Martin Alterisio
offtopic type=slightly offtopic class=poetic literary A sad poem of an algorithm where solitude brought excessive use of cpu cycles and memory allocation for redundant data (it copied over and over again the same image till all memory was filled with it) --

Re: [PHP] Sad PHP Poem

2006-06-26 Thread Martin Alterisio
2006/6/26, Ligaya Turmelle [EMAIL PROTECTED]: Martin Alterisio wrote: offtopic type=slightly offtopic class=poetic literary A sad poem of an algorithm where solitude brought excessive use of cpu cycles and memory allocation for redundant data (it copied over and over again the same image

Re: [PHP] working on a template system...

2006-06-28 Thread Martin Alterisio
2006/6/28, Robert Cummings [EMAIL PROTECTED]: On Wed, 2006-06-28 at 07:32, Martin Marques wrote: On Wed, 28 Jun 2006, Ligaya Turmelle wrote: Martin Marques wrote: Why not try to use one of the template systems that already exist? HTML_Template_IT, Smarty, etc. Or just use PHP...

Re: [PHP] working on a template system...

2006-06-28 Thread Martin Alterisio
($display_variable) */ ? /dl Is it really *that* bad? jon Martin Alterisio wrote: 2006/6/28, Robert Cummings [EMAIL PROTECTED]: On Wed, 2006-06-28 at 07:32, Martin Marques wrote: On Wed, 28 Jun 2006, Ligaya Turmelle wrote: Martin Marques wrote: Why not try to use one of the template

[PHP] Re: Sad PHP Poem

2006-06-30 Thread Martin Alterisio
2006/6/26, Martin Alterisio [EMAIL PROTECTED]: offtopic type=slightly offtopic class=poetic literary A sad poem of an algorithm where solitude brought excessive use of cpu cycles and memory allocation for redundant data (it copied over and over again the same image till all memory was filled

Re: [PHP] preg_match problem

2007-01-21 Thread Martin Alterisio
2007/1/20, Arpad Ray [EMAIL PROTECTED]: Martin Alterisio wrote: Double slash to prevent PHP interpreting the slashes. Also using single quotes would be a good idea: if (preg_match('/[\\w\\x2F]{6,}/',$a)) Just switching to single quotes would do the trick - you don't need to escape

Re: [PHP] preg_match problem

2007-01-23 Thread Martin Alterisio
2007/1/22, Beauford [EMAIL PROTECTED]: ... much blah blah blah ... I've probably read 100 pages on this, and no matter what I try it doesn't work. Including all of what you suggested above - is my PHP possessed? if(preg_match(/[EMAIL PROTECTED]()*;:_.'/\\ ]+$/, $string)) { gives me this

Re: [PHP] nested, referenced foreach implicit current array pointer issues

2007-01-30 Thread Martin Alterisio
2007/1/30, speedy [EMAIL PROTECTED]: Hello PHP crew, As a followup to: http://bugs.php.net/bug.php?id=22879 That's not a bug, just an user doing things the wrong way and blaming the language. I've stumbled upon this problem in a way: function f() { global $arr; foreach($arr as

Re: Re[2]: [PHP] nested, referenced foreach implicit current array pointer issues

2007-01-31 Thread Martin Alterisio
2007/1/30, speedy [EMAIL PROTECTED]: Hello Martin, Tuesday, January 30, 2007, 8:45:50 PM, you wrote: function f() { global $arr; foreach($arr as $k=$v) { $v-do_something(); } } I don't see your point anywhere... foreach iterates over a copy of the array so where

Re: [PHP] OT - Regular Expression

2007-02-09 Thread Martin Alterisio
If you want to do it in one regular expression, without listing each case, you can use a lookahead assertion: /^(?=.*8.*)[0-9]{4}$/ The assertion (?=.*8.*) checks that the following matches the expression contained (.*8.*) which fails if there is not an 8. 2007/2/9, Peter Lauri [EMAIL

Re: [PHP] OT - Regular Expression

2007-02-09 Thread Martin Alterisio
, Martin Alterisio [EMAIL PROTECTED]: If you want to do it in one regular expression, without listing each case, you can use a lookahead assertion: /^(?=.*8.*)[0-9]{4}$/ The assertion (?=.*8.*) checks that the following matches the expression contained (.*8.*) which fails if there is not an 8

Re: [PHP] Variable variables and references

2007-03-11 Thread Martin Alterisio
2007/3/10, Dave Goodchild [EMAIL PROTECTED]: Hi guys, I have just read 'Programming PHP' (O'Reilly) and although I think it's a great book, I am confused about variable variables and references - not the mechanics, just where you would use them. The subject of variable variables is explained

Re: [PHP] References challenge with PHP4

2007-03-21 Thread Martin Alterisio
2007/3/20, Jochem Maas [EMAIL PROTECTED]: Robert Cummings wrote: On Tue, 2007-03-20 at 11:52 +0100, Jochem Maas wrote: ok, I tried it in a whole number of variations - no joy. you should use php5 if you want this kind of reference stuff - in php5 it just works, php 4 will give you big

Re: [PHP] References challenge with PHP4

2007-03-25 Thread Martin Alterisio
2007/3/23, Jochem Maas [EMAIL PROTECTED]: Martin Alterisio wrote: 2007/3/20, Jochem Maas [EMAIL PROTECTED] mailto: [EMAIL PROTECTED]: Robert Cummings wrote: On Tue, 2007-03-20 at 11:52 +0100, Jochem Maas wrote: ok, I tried it in a whole number of variations - no joy

Re: [PHP] finding a particular record within a MySQL result set

2007-04-04 Thread Martin Alterisio
2007/4/4, James Tu [EMAIL PROTECTED]: I've cross posted this to the MySQL list... Here's my original post. Is there some quick way to do the following in MySQL? (I know I can use PHP to search through the result set, but I wanted to see if there's a quick way using some sort of query)

[PHP] Design Dilemma - Database Data Abstraction

2007-04-07 Thread Martin Alterisio
I have a dilemma on a design where I humbly ask your help. I'm working on the model part of a web application (not to be understood in the web2.0 way, but in a more general way, where anything mounted on HTTP is a web application) done in PHP5 following the MVC design pattern. But the strong

Re: [PHP] Design Dilemma - Database Data Abstraction

2007-04-08 Thread Martin Alterisio
2007/4/8, Paul Novitski [EMAIL PROTECTED]: At 4/7/2007 09:49 AM, Martin Alterisio wrote: The solution I presented is to access, and act upon, a database as if they were PHP arrays, meaning that a table is presented as an array of records. This implies to me that you'll read a series of tables

Re: [PHP] Design Dilemma - Database Data Abstraction

2007-04-09 Thread Martin Alterisio
2007/4/9, Lester Caine [EMAIL PROTECTED]: Martin Alterisio wrote: I have a dilemma on a design where I humbly ask your help. I'm working on the model part of a web application (not to be understood in the web2.0 way, but in a more general way, where anything mounted on HTTP is a web

Re: [PHP] Re: Design Dilemma - Database Data Abstraction

2007-04-09 Thread Martin Alterisio
2007/4/9, Tony Marston [EMAIL PROTECTED]: Martin Alterisio [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have a dilemma on a design where I humbly ask your help. I'm working on the model part of a web application (not to be understood in the web2.0 way, but in a more general

Re: [PHP] Design Dilemma - Database Data Abstraction

2007-04-11 Thread Martin Alterisio
2007/4/10, Richard Lynch [EMAIL PROTECTED]: On Sat, April 7, 2007 11:49 am, Martin Alterisio wrote: The solution I presented is to access, and act upon, a database as if they were PHP arrays, meaning that a table is presented as an array of records. I don't quite get why you think

Re: [PHP] Re: Design Dilemma - Database Data Abstraction

2007-04-11 Thread Martin Alterisio
2007/4/11, Roman Neuhauser [EMAIL PROTECTED]: # [EMAIL PROTECTED] / 2007-04-09 19:45:41 -0300: Thanks but that's not what I'm looking for. As I said before, my problem isn't to find an implementation of an ORM, but that the concept I'm working on will use a very restricted API (array

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-10 Thread Martin Alterisio \El Hombre Gris\
Maybe it's too late to say this, but if your real problem is that you don't want the function reading the rss feed to block the rest of your page, you can always put the output of the reading of the feed on a separate page, and include this through an iframe. darren kirby wrote: Hello all,

Re: [PHP] function by reference

2006-04-11 Thread Martin Alterisio \El Hombre Gris\
Well, it was a bad example to begin with, first of all max() is already defined in php, I should at least checked that before posting. Second, I forgot PHP (the Zend engine) has an interesting way of handling variables, when you copy assign a var or pass it as an argument of a function, a real

Re: [PHP] internationalization of web site

2006-04-12 Thread Martin Alterisio \El Hombre Gris\
Ussually, the browsers send a header with information about the language preferences of the user. This header is HTTP_ACCEPT_LANGUAGE. You can retrieve its value in PHP through the array $_SERVER: $_SERVER['HTTP_ACCEPT_LANGUAGE'] Here you can find about the format of this header:

Re: [PHP] How can I see where my script wasting time?

2006-04-17 Thread Martin Alterisio \El Hombre Gris\
Use the EXPLAIN sql command to check what your queries are really doing, you'll have to read the manual for the database you're using to figure out the information returned by this command. [EMAIL PROTECTED] wrote: Hi to all! I was developing one site with fake records in DB. Now, I put it

Re: [PHP] Pushing PHP Into The Web 2.0 Generation

2006-04-18 Thread Martin Alterisio \El Hombre Gris\
Just what I needed today, another guy trying to find solutions when he doesn't even comprehend what the real problem is. A complete waste of my time. James Crane wrote: I've written a short paper on the future of PHP and I'd appreciate it if you folks would take a look at it and exchange your

Re: [PHP] session_destroy

2006-04-18 Thread Martin Alterisio \El Hombre Gris\
That's exactly what the manual says. session_destroy() doesñ't clean the session cookie (if one is used), that's probably why your session persists. Peter Hoskin wrote: I've also had this issue from time to time. Used the following to destroy it under all circumstances. if

Re: [PHP] session_destroy

2006-04-19 Thread Martin Alterisio \El Hombre Gris\
- From: Martin Alterisio El Hombre Gris [mailto:[EMAIL PROTECTED] Sent: Wednesday, 19 April 2006 12:36 PM To: Peter Hoskin Cc: Shannon Doyle; php-general@lists.php.net Subject: Re: [PHP] session_destroy That's exactly what the manual says. session_destroy() doesñ't clean the session cookie (if one

Re: [PHP] programming contests as a way of finding/evaluating offshore talent...

2006-04-19 Thread Martin Alterisio \El Hombre Gris\
This is just my personal opinion on the subject. I don't believe nowadays programming contests are of any worth when judging a developer's talent, at least not what I expect from a coder. These contests usually prove that an a coder can pull out an development as an individual, but from

Re: [PHP] Re: no offense to Rasmus... are you kidding me

2006-04-20 Thread Martin Alterisio \El Hombre Gris\
Matt Todd wrote: There's nothing wrong with staying true to the philosophy at all, I just think that it may well be detrimental in the end. And that is what I said in the (toilet)paper, that there will be (emphasis on the eventuality, not on the present actuality) a time that PHP will become

Re: [PHP] session

2006-04-20 Thread Martin Alterisio \El Hombre Gris\
It's really that hard to read the whole manual page about session_destroy()? Quoting the php manual: In order to kill the session altogether, like to log the user out, the session id must also be unset. If a cookie is used to propagate the session id (default behavior), then the session cookie

Re: [PHP] PHP error log

2006-04-20 Thread Martin Alterisio \El Hombre Gris\
Please, explain how are you logging the errors. Weber Sites LTD wrote: Hi I'm using PHP 4.4.0 (cli) and all of the errors / warnings are written to file. I can see all of the direct errors but when I have an error inside an include file the script fails and the error is not shown in the log.

Re: [PHP] Sanity checker?

2006-05-03 Thread Martin Alterisio \El Hombre Gris\
Ezra Nugroho escribió: Well, Since my original post failed to generate reasonable feedback, not even a successful kick at people's funny bone or a flame, let me restate my question with a story. Php reduces the barrier to web development quite a bit, such that less technical people can jump in

Re: [PHP] Problem with usort

2006-05-04 Thread Martin Alterisio \El Hombre Gris\
Rabin Vincent escribió: On 5/4/06, Jon Earle [EMAIL PROTECTED] wrote: $ret_val = 0; if ($aday == $bday) {$ret_val = 0;} else {$ret_val = ($aday $bday) ? -1 : 1;} return ret_val; You're missing the $ for ret_val on the return line. PHP thus understands the return value as a string,

Re: [PHP] set_error_handler() fails

2006-05-05 Thread Martin Alterisio \El Hombre Gris\
icy escribió: chris smith wrote: What does your code look like? I just realized that when called a second time, set_error_handler() returns my custom error handler but it is never triggered. Code looks like this: ?php if (set_error_handler('core_error_handler', E_ALL) === NULL)

<    1   2