On 21 October 2010 04:59, David McGlone da...@dmcentral.net wrote:
On Thu, 2010-10-21 at 04:05 +0200, Rico Secada wrote:
Hi.
I am working on a small system where I am both trying to avoid code
duplication and at the same time I am trying to keep the presentation
logic separated from the
Bit late to this one, but what about an mvc framework like codeigniter? It's
perfectly acceptable to use if statements and loops in the view, which would
solve your problem. You can set a trigger variable in the controller, and in
the header view, check to see if its set and output your
preg_match(/false/i, $string) ? false : true;
On Thu, Oct 21, 2010 at 7:39 PM, Gary php-gene...@garydjones.name wrote:
Is there any nice way to convert a string containing either TRUE or
FALSE to a bool with the appropriate value? I know I can just if
(strcmp... but, as the song goes on to
That's as bad as an if!
What about using settype() on the string? I've not tested it, but it looks like
it should do the trick.
Thanks,
Ash
http://www.ashleysheridan.co.uk
- Reply message -
From: Russell Dias rus...@gmail.com
Date: Thu, Oct 21, 2010 10:51
Subject: [PHP] My truth comes
I'm curious to know why 'thats as bad as an if' ?
It's simple, concise, understandble and does the job. So, I'm curious
to know why exactly its bad?
On Thu, Oct 21, 2010 at 8:01 PM, a...@ashleysheridan.co.uk
a...@ashleysheridan.co.uk wrote:
That's as bad as an if!
What about using settype()
Because it is an if statement, just in a different form, and preg_match is more
computational expensive than a direct string comparison.
Thanks,
Ash
http://www.ashleysheridan.co.uk
- Reply message -
From: Russell Dias rus...@gmail.com
Date: Thu, Oct 21, 2010 11:03
Subject: [PHP] My
Whats wrong with an if *construct* ? I understand that the ternary
operator is another way of doing it. Using it in such a small scenario
is perfectly justifiable. Its ridiculous to use in more complicated
scenarious because of readability issues.
Direct string comparison? You suggested yet
On Wed, Oct 20, 2010 at 07:02:49PM -0400, ad...@buskirkgraphics.com wrote:
Hm
I guess the little person inside, just hates the long way of doing
something.
My suggestion
$CD = 1287583899;
$q1s = 1283313600;
$q1e = 1291093200;
$q2s = 1291179600;
$q2e = 1298869200;
$q3s =
-Original Message-
From: Gary [mailto:php-gene...@garydjones.name]
Sent: 21 October 2010 11:39
To: php-general@lists.php.net
Subject: [PHP] Re: My truth comes out [1]
Russell Dias wrote:
preg_match(/false/i, $string) ? false : true;
,
| $foo = (strcmp('true', $string) == 0);
`
I would stay clear of the ternary operator in nested coditions, for
obvious reasons. If it can fit in a single line and is essentially
clear in its message I dont see why not to use it.
On Thu, Oct 21, 2010 at 8:39 PM, Gary php-gene...@garydjones.name wrote:
Russell Dias wrote:
On Thu, Oct 21, 2010 at 08:15:40PM +1000, Russell Dias wrote:
Whats wrong with an if *construct* ? I understand that the ternary
operator is another way of doing it. Using it in such a small scenario
is perfectly justifiable. Its ridiculous to use in more complicated
scenarious because of
[snip]
preg_match(/false/i, $string) ? false : true;
,
| $foo = (strcmp('true', $string) == 0);
`
works as well :) I don't like those kinds of things for this purpose
because it takes longer for people new to the code to read and
understand it than, say
,
| (boolean) $string;
`
On 21 October 2010 10:39, Gary php-gene...@garydjones.name wrote:
Is there any nice way to convert a string containing either TRUE or
FALSE to a bool with the appropriate value? I know I can just if
(strcmp... but, as the song goes on to say ...ugly, so ugly, it's ugly[1]
Footnotes:
[1]
On 21 October 2010 10:39, Gary php-gene...@garydjones.name wrote:
Is there any nice way to convert a string containing either TRUE or
FALSE to a bool with the appropriate value? I know I can just if
(strcmp... but, as the song goes on to say ...ugly, so ugly, it's ugly[1]
What is the response
On 21 October 2010 12:42, Richard Quadling rquadl...@gmail.com wrote:
On 21 October 2010 10:39, Gary php-gene...@garydjones.name wrote:
Is there any nice way to convert a string containing either TRUE or
FALSE to a bool with the appropriate value? I know I can just if
(strcmp... but, as the
Really interesting thread :D . Why go for other methods when you can
do it easily using if Is this an exercise or something?
Midhun Girish
Development Lead
MobAlive Technologies
Trivandrum
On 10-10-21 06:39 AM, Gary wrote:
Russell Dias wrote:
preg_match(/false/i, $string) ? false : true;
,
| $foo = (strcmp('true', $string) == 0);
`
works as well :) I don't like those kinds of things for this purpose
because it takes longer for people new to the code to read and
hai all,
I have two tables a and b as follows to implement a simple block list where
users can block other users.
Table A
++--+--+
| Name | phone |userid|
++--+--+
| Mr Sasi | 01225 708225 | 1 |
| Miss Brown | 01225 899360 | 2 |
|
On 21 October 2010 14:13, Midhun Girish midhungir...@gmail.com wrote:
| Name | phone |userid|
++--+--+
| Mr Sasi | 01225 708225 | 1 |
| Miss Brown | 01225 899360 | 2 |
| Mr Black | 01380 724040 | 3 |
++--+--+
Table B
settype looks like a no-go for this; per the php docs...
http://php.net/manual/en/function.settype.php
--
$bar = true; // boolean
settype($bar, string); // $bar is now 1 (string)
--
I think using a conditional here is the best (only?) way.
$bool = (strtolower($string)=='true')? true:
[snip]
You removed the text in my post that you replied to which said I was
just wondering whether I had missed some construct in the language.
[/snip]
Yes, I read that and snipped it. I was just referring to the
readability statement.
--
PHP General Mailing List (http://www.php.net/)
To
On 10-10-21 09:24 AM, Gary wrote:
Jay Blanchard wrote:
You could even create a function that is more readable than the 'if'
alone;
Of course I can. I could also record an explanation, convert it to mp3,
host it on a website, and include the URL in a comment.
You removed the text in my post
On Wed, Oct 20, 2010 at 08:08:21PM -0400, music...@gmail.com wrote:
Hi List,
I'm currently working on a medium sized project as an independent
contractor. The project is reaching the 2000 hour range and the
client has asked for a project cost. The problem I have in providing
the client
Hey, Folks;
Just a gentle reminder after watching things get worse by the day:
it is one of the rules of this and all official php.net mailing lists
that you must not top-post.
For anyone wondering just one of the reasons why we have this rule
in effect, tab through this thread in
On Thu, 2010-10-21 at 10:25 -0400, Daniel Brown wrote:
Hey, Folks;
Just a gentle reminder after watching things get worse by the day:
it is one of the rules of this and all official php.net mailing lists
that you must not top-post.
For anyone wondering just one of the reasons why
On Thu, Oct 21, 2010 at 11:30 AM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:
On Thu, 2010-10-21 at 10:25 -0400, Daniel Brown wrote:
Hey, Folks;
Just a gentle reminder after watching things get worse by the day:
it is one of the rules of this and all official php.net mailing lists
On Wed, Oct 20, 2010 at 05:47:12PM -0700, Kris Craig wrote:
Hi musicdev,
There are a couple issues I think need to be addressed with what youd
described. First and foremost, $20/hr is considerably below the going
rate for PHP work, especially for projects as large as the one you're
On Thu, Oct 21, 2010 at 11:30, Ashley Sheridan a...@ashleysheridan.co.uk
wrote:
I always bottom post when I'm replying from my computer, but when on the move
or at work, I'm only left with my Android, and the default email client
doesn't allow reply positioning of any sort, so it's always
On Thu, 2010-10-21 at 10:37 -0400, Daniel Brown wrote:
On Thu, Oct 21, 2010 at 11:30, Ashley Sheridan a...@ashleysheridan.co.uk
wrote:
I always bottom post when I'm replying from my computer, but when on the
move or at work, I'm only left with my Android, and the default email
client
On Thu, Oct 21, 2010 at 10:34, Bastien Koert phps...@gmail.com wrote:
iphone has the same problem. Cutting and pasting is the only way that
i have of dealing with it...and I do try to accommodate that when i
can
I wonder if we have any lurking iPhone and/or Android app
developers here who
On 10-10-21 10:25 AM, Daniel Brown wrote:
P.S. - Those of you who have been around for years will likely
recall with some fondness the level of respect, participation, and
quality of discussions this list once had; the degree of mutual
respect and camaraderie was palpable. If you're
On Thu, Oct 21, 2010 at 10:41, Robert Cummings rob...@interjinn.com wrote:
I can't speak for everyone here (or who is no longer here)... but my posts
have dwindled significantly due to work and family time constraints :|
Same here, but isn't it a bit eerie that many of us hit that same
On Thu, Oct 21, 2010 at 04:05:50AM +0200, Rico Secada wrote:
Hi.
I am working on a small system where I am both trying to avoid code
duplication and at the same time I am trying to keep the presentation
logic separated from the application logic.
I am using sessions and are avoiding
On Thu, Oct 21, 2010 at 10:47 AM, Daniel Brown danbr...@php.net wrote:
On Thu, Oct 21, 2010 at 10:41, Robert Cummings rob...@interjinn.com wrote:
I can't speak for everyone here (or who is no longer here)... but my posts
have dwindled significantly due to work and family time constraints :|
On 21 October 2010 15:53, Bastien Koert phps...@gmail.com wrote:
Parenting ruins everything ;-)
Ideally, yes.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
On Thu, 2010-10-21 at 08:01 +0200, Peter Lind wrote:
On 21 October 2010 04:59, David McGlone da...@dmcentral.net wrote:
On Thu, 2010-10-21 at 04:05 +0200, Rico Secada wrote:
Hi.
I am working on a small system where I am both trying to avoid code
duplication and at the same time I am
[snip]
.
[/snip]
Fondly remembers mailing list guidelines that used to go out about once
a week when someone would send them, including the section that said
something to the effect of;
Why?
Top posting is bad!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
On Thu, Oct 21, 2010 at 04:30:03PM +0100, Ashley Sheridan wrote:
[snip]
I always bottom post when I'm replying from my computer, but when on the
move or at work, I'm only left with my Android, and the default email
client doesn't allow reply positioning of any sort, so it's always
On Oct 21, 2010, at 10:47 AM, Daniel Brown danbr...@php.net wrote:
On Thu, Oct 21, 2010 at 10:41, Robert Cummings rob...@interjinn.com wrote:
I can't speak for everyone here (or who is no longer here)... but my posts
have dwindled significantly due to work and family time constraints :|
On Thu, Oct 21, 2010 at 8:47 AM, Daniel Brown danbr...@php.net wrote:
On Thu, Oct 21, 2010 at 10:41, Robert Cummings rob...@interjinn.com
wrote:
I can't speak for everyone here (or who is no longer here)... but my
posts
have dwindled significantly due to work and family time constraints
On Thu, Oct 21, 2010 at 10:47:53AM -0400, Daniel Brown wrote:
On Thu, Oct 21, 2010 at 10:41, Robert Cummings rob...@interjinn.com wrote:
I can't speak for everyone here (or who is no longer here)... but my posts
have dwindled significantly due to work and family time constraints :|
[snip]
I still hop on threads from time to time, just a lot more picky about
which
ones any more. ducks
[/snip]
I seem to go through phases, but I always read. I had gotten away from
everyday coding due to work needs (leading a team of PHP'ers) but have
always tried to keep learning. I may have
On Thu, Oct 21, 2010 at 09:37:16AM -0600, Nathan Nobbe wrote:
On Thu, Oct 21, 2010 at 8:47 AM, Daniel Brown danbr...@php.net wrote:
On Thu, Oct 21, 2010 at 10:41, Robert Cummings rob...@interjinn.com
wrote:
I can't speak for everyone here (or who is no longer here)... but my
posts
On Thu, 2010-10-21 at 11:58 -0400, Paul M Foster wrote:
On Thu, Oct 21, 2010 at 04:30:03PM +0100, Ashley Sheridan wrote:
[snip]
I always bottom post when I'm replying from my computer, but when on the
move or at work, I'm only left with my Android, and the default email
client
On Thu, 2010-10-21 at 12:14 -0400, Paul M Foster wrote:
On Thu, Oct 21, 2010 at 10:47:53AM -0400, Daniel Brown wrote:
On Thu, Oct 21, 2010 at 10:41, Robert Cummings rob...@interjinn.com wrote:
I can't speak for everyone here (or who is no longer here)... but my posts
have dwindled
Daniel P. Brown wrote:
On Wed, Oct 20, 2010 at 21:04, Bastien phps...@gmail.com wrote:
Yeah, it's got a few downsides!
The next app for the iPhone should be a modification to the
spell-check to verify PHP functions in emails.
+1
--
PHP General Mailing List (http://www.php.net/)
To
On Thu, Oct 21, 2010 at 5:39 AM, Gary php-gene...@garydjones.name wrote:
Is there any nice way to convert a string containing either TRUE or
FALSE to a bool with the appropriate value? I know I can just if
(strcmp... but, as the song goes on to say ...ugly, so ugly, it's
ugly[1]
Footnotes:
I found this terrific tool for creating dynamic zip files:
http://pablotron.org/software/zipstream-php/
--
Dotan Cohen
http://gibberish.co.il
http://what-is-what.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- Original Message -
From: Daniel Brown danbr...@php.net
To: PHP General php-general@lists.php.net
Sent: Thursday, October 21, 2010 3:25 PM
Subject: [PHP] Reminder On Mailing List Rules
Hey, Folks;
Just a gentle reminder after watching things get worse by the day:
it is one
On Thu, Oct 21, 2010 at 1:37 PM, sueandant hollandsath...@tiscali.co.uk wrote:
Hi
I'm not familiatr with the term top-post; could you please explain?
http://idallen.com/topposting.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 21 October 2010 16:25, Daniel Brown danbr...@php.net wrote:
* snip *
The ultimate goal here isn't to start a flame war (or even any
further discussion on the subject for that matter), but to point out
that this is a RULE of the official community here, not a PREFERENCE.
If only the
This is top-posting.
On Thu, Oct 21, 2010 at 15:37, sueandant hollandsath...@tiscali.co.uk wrote:
I'm not familiatr with the term top-post; could you please explain?
What you did, posting your message at the end of the email, is in
adherence with the rules.
--
/Daniel P. Brown
sueandant wrote:
Hi
I'm not familiatr with the term top-post; could you please explain?
http://lmgtfy.com/?q=top-post
--
Per Jessen, Zürich (3.7°C)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Let's adhere to the rules.
--Shreyas
On Fri, Oct 22, 2010 at 1:15 AM, Per Jessen p...@computer.org wrote:
sueandant wrote:
Hi
I'm not familiatr with the term top-post; could you please explain?
http://lmgtfy.com/?q=top-post
--
Per Jessen, Zürich (3.7°C)
--
PHP General Mailing
On Thu, Oct 21, 2010 at 12:42 PM, Larry Martell
la...@software-horizons.com wrote:
http://idallen.com/topposting.html
top posting is no big IMHO.
in fact, it's easier to read on mobile devices such as an iphone. it's
also easier to reply.
email clients like google will hide the common lines
On Thu, Oct 21, 2010 at 1:51 PM, Michael Shadle mike...@gmail.com wrote:
in fact, it's easier to read on mobile devices such as an iphone. it's
also easier to reply.
email clients like google will hide the common lines anyway.
to me this comes on the heels of a presentation i just read
Ok, I agree with most of those points, but why should I, or anyone, have
to trim down someone else's 'signature', and I'm talking about these
silly ones which are 10 or 20 lines long stating 'If you have received
this email in error.blah, blah, blah'..surely, the banning of that,
along
[snip]
Orwellian!
[/snip]
Nazi's did it!
Why?
Top posting is bad!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 21 October 2010 21:01, Jay Blanchard jblanch...@pocket.com wrote:
[snip]
Orwellian!
[/snip]
Nazi's did it!
!Godwin!
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
On Thu, Oct 21, 2010 at 12:56 PM, Nathan Nobbe quickshif...@gmail.com wrote:
um, right, the whole point is that the conversations are not being viewed
through mail clients when people are finding them via search engines on the
web.
and some mail clients are dumber than others, lol.
a lot of
On Thu, Oct 21, 2010 at 2:15 PM, Michael Shadle mike...@gmail.com wrote:
On Thu, Oct 21, 2010 at 12:56 PM, Nathan Nobbe quickshif...@gmail.com
wrote:
um, right, the whole point is that the conversations are not being viewed
through mail clients when people are finding them via search
On Thu, Oct 21, 2010 at 1:21 PM, Nathan Nobbe quickshif...@gmail.com wrote:
what does syntax highlighting have to do w/ a mess of text that could be
sorted out by folks willing to take the extra 2 seconds to put their
thoughts at the bottom of a mail?
i doubt there are any web-based lists
On Thu, Oct 21, 2010 at 4:33 PM, Michael Shadle mike...@gmail.com wrote:
On Thu, Oct 21, 2010 at 1:21 PM, Nathan Nobbe quickshif...@gmail.com wrote:
what does syntax highlighting have to do w/ a mess of text that could be
sorted out by folks willing to take the extra 2 seconds to put their
I've had a few emails from people making the same request, so what I'm
gonna do is stick them up someplace public like SourceForge or
whatever in the public domain for anyone who wants them.
Legal disclaimer: Please note that, though these have been reviewed
by the legal departments of my past
Toilet seat. Up or down. Same thing? Sort of.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
hello dear List
i have a Problem with the Parsing of a html-document:
I tried to run the following perl parser script on the HTML further below...
but i was not lucky - so now i want to try it with PHP - i head about
DomDocument - this should save my backside
i have to get involved with
On Thu, Oct 21, 2010 at 2:33 PM, Michael Shadle mike...@gmail.com wrote:
On Thu, Oct 21, 2010 at 1:21 PM, Nathan Nobbe quickshif...@gmail.com
wrote:
what does syntax highlighting have to do w/ a mess of text that could be
sorted out by folks willing to take the extra 2 seconds to put their
On Thu, Oct 21, 2010 at 3:12 PM, Nathan Nobbe quickshif...@gmail.com wrote:
i've found top-posting to be useful in the corporate environment where the
people i'm working with are too ignorant to understand the rationale.
however, when you're working with programmers, i think the expectation
On Thu, Oct 21, 2010 at 4:24 PM, Michael Shadle mike...@gmail.com wrote:
On Thu, Oct 21, 2010 at 3:12 PM, Nathan Nobbe quickshif...@gmail.com
wrote:
i've found top-posting to be useful in the corporate environment where
the
people i'm working with are too ignorant to understand the
On Thu, Oct 21, 2010 at 18:24, Michael Shadle mike...@gmail.com wrote:
note, that i take the time to bottom-post and clean up emails when i
have time, but if i don't, i don't. people discuss things for
discussion, they don't discuss things because they care how it is
placed. that's like
On 2010-10-21, at 6:24 PM, Michael Shadle mike...@gmail.com wrote:
On Thu, Oct 21, 2010 at 3:12 PM, Nathan Nobbe quickshif...@gmail.com wrote:
i've found top-posting to be useful in the corporate environment where the
people i'm working with are too ignorant to understand the rationale.
On Thu, Oct 21, 2010 at 3:40 PM, Daniel Brown danbr...@php.net wrote:
Unfortunately, Michael, while I appreciate your analogy (rarely is
something well-balanced between wit, truth, and vivid imagery enough
to make me laugh at the mental picture), I must point out that, in
this case, you're
On Thu, Oct 21, 2010 at 19:18, Michael Shadle mike...@gmail.com wrote:
Don't let it die like Perl has! (ha, ha)
?php
$perl ='PERL'
#!/usr/bin/perl
my $pun = $?;
die Great pun! unless $pun = 0;
PERL;
$filename = dirname(__FILE__).'/tmp-'.sha1(time()).'.pl';
file_put_contents($filename,$perl);
Hi,
I must be tired because I can't figure this out... I am sure it is
something obvious.
I need to pass a hex value to a method, but I can't figure out how to
convert a hex string to a hex value.
For exmaple:
$base = '96989b'
my_method('0x' . $base)
The above does not work with my_method().
74 matches
Mail list logo