php-general Digest 30 Aug 2011 10:01:15 -0000 Issue 7461
Topics (messages 314639 through 314648):
Re: Dreaded Premature end of script headers
314639 by: Steve Staples
Code should be selv-maintaining!
314640 by: Rico Secada
314641 by: Robert Cummings
314642 by: admin.buskirkgraphics.com
314643 by: Richard Riley
314644 by: Robert Cummings
314645 by: George Langley
314646 by: Geoff Shang
314647 by: Tim Streater
utf8_decode() not working, conflicts with urlencode()
314648 by: Merlin Morgenstern
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
On Sat, 2011-08-27 at 17:55 -0400, Daniel P. Brown wrote:
> On Sat, Aug 27, 2011 at 01:01, Jim Lucas <[email protected]> wrote:
> >
> > Well, you might have to go about this the long way. I suggest you cut larger
> > sections of code out until you get a working script. Then start putting it
> > back together.
>
> If possible, I'd also try running it from the production box CLI.
> It may give you some insight, such as a missing symlink or different
> path structure in a file include.
>
> --
> </Daniel P. Brown>
> Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
> (866-) 725-4321
> http://www.parasane.net/
>
What about looking at the memory_limit and _max_execution_time
variables? could they be different in the dev/prod conf files?
I remember a while back, I ran into a max execute time, and it wasn't
throwing errors (still never figured it out, but I've moved on since
then).
Just a thought, check your conf files for differences.
Steve.
--- End Message ---
--- Begin Message ---
Dont get me wrong, I love programming! But what an absolute pain in the
ass it is when you re-use old code only to discover something "less well
made".
You all know about this right?
You go into your homemade library of code to re-use some piece that you
already are using 12 other places in production. Now, last time you
worked on the code you thought it was almost perfect. While working on
the code this time you find an undiscovered bug or some part of the
code that looks like you where on drugs when you made it.
Of course we develop experience and more skills all the time, and as a
good programmer we never stop doing that, but what a pain it is when
the above happens and you have to patch the code being used those 12
other places too, and each place maybe has a slightly different usage,
so minor changes affect other stuff. And this goes on while your head
is spinning around trying to stay focused on the very task at hand that
originated the need for a quick re-usage of old code in the first place.
Why the hell can't code be self-maintaining!? :))
--- End Message ---
--- Begin Message ---
On 11-08-29 03:42 PM, Rico Secada wrote:
You go into your homemade library of code to re-use some piece that you
already are using 12 other places in production. Now, last time you
worked on the code you thought it was almost perfect. While working on
the code this time you find an undiscovered bug or some part of the
code that looks like you where on drugs when you made it.
*lol* Yes, I think we've all seen it from time to time. Have you ever
gone back and looked at your school assignments in coding? *shudder*.
The horror is compounded by the fact I was using K&R style indentation
back then ;)
Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Rico Secada [mailto:[email protected]]
> Sent: Monday, August 29, 2011 3:42 PM
> To: [email protected]
> Subject: [PHP] Code should be selv-maintaining!
>
> Dont get me wrong, I love programming! But what an absolute pain in the
> ass it is when you re-use old code only to discover something "less
> well
> made".
>
> You all know about this right?
>
> You go into your homemade library of code to re-use some piece that you
> already are using 12 other places in production. Now, last time you
> worked on the code you thought it was almost perfect. While working on
> the code this time you find an undiscovered bug or some part of the
> code that looks like you where on drugs when you made it.
>
> Of course we develop experience and more skills all the time, and as a
> good programmer we never stop doing that, but what a pain it is when
> the above happens and you have to patch the code being used those 12
> other places too, and each place maybe has a slightly different usage,
> so minor changes affect other stuff. And this goes on while your head
> is spinning around trying to stay focused on the very task at hand that
> originated the need for a quick re-usage of old code in the first
> place.
>
> Why the hell can't code be self-maintaining!? :))
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
In a framework this is not a problem, and easy to update. Development as a
whole, is a living document ever growing and expanding it abilities.
If taking advantage of the new ability is a long upgrade process then the
design is stagnate . This is called the longevity of a design and is why
many developers No longer use what is called as flat text programming.
Thinking object oriented programming in frameworks is the only way I do
business.
--- End Message ---
--- Begin Message ---
Robert Cummings <[email protected]> writes:
> On 11-08-29 03:42 PM, Rico Secada wrote:
>> You go into your homemade library of code to re-use some piece that you
>> already are using 12 other places in production. Now, last time you
>> worked on the code you thought it was almost perfect. While working on
>> the code this time you find an undiscovered bug or some part of the
>> code that looks like you where on drugs when you made it.
More an issue with library management :) "git checkout releaseV1.1" ;))))
>
> *lol* Yes, I think we've all seen it from time to time. Have you ever gone
> back
> and looked at your school assignments in coding? *shudder*. The horror is
> compounded by the fact I was using K&R style indentation back then ;)
small point of order : K&R indentation is still considered by many as
the cleanest and is used on many many large code bases. Personally I
much prefer
f(){
a;
}
to
f()
{
}
as the first one is two boundary balanced. But like emacs vs vi it's a
religious issue....
--- End Message ---
--- Begin Message ---
On 11-08-29 04:05 PM, Richard Riley wrote:
Robert Cummings<[email protected]> writes:
On 11-08-29 03:42 PM, Rico Secada wrote:
You go into your homemade library of code to re-use some piece that you
already are using 12 other places in production. Now, last time you
worked on the code you thought it was almost perfect. While working on
the code this time you find an undiscovered bug or some part of the
code that looks like you where on drugs when you made it.
More an issue with library management :) "git checkout releaseV1.1" ;))))
*lol* Yes, I think we've all seen it from time to time. Have you ever gone back
and looked at your school assignments in coding? *shudder*. The horror is
compounded by the fact I was using K&R style indentation back then ;)
small point of order : K&R indentation is still considered by many as
the cleanest and is used on many many large code bases. Personally I
much prefer
I was stating opinion as I used the word *I* in "I was using K&R". To
beat the horse a bit though... "many" people still consider hitting
their kids a good method of discipline. Popularity isn't always correct :/
f(){
a;
}
to
f()
{
}
as the first one is two boundary balanced. But like emacs vs vi it's a
religious issue....
I'm not sure what you mean by two boundary balanced. The second form
creates an obvious vertical visual alignment that obviates the beginning
and end of the block. If I recall correctly, K&R was promoted to save on
paper... but who really prints code these days on paper (except maybe
students) and authors of books.
Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
--- End Message ---
--- Begin Message ---
"The One True Brace Style":
<http://en.wikipedia.org/wiki/Indent_style>
Didn't know there was a name for the way I learned to indent! Make sense to me
- looks so much cleaner and less scrolling/printing.
And, I already add a comment to confirm the end brace:
} // end if($myVar)
to clarify any long nests.
George
On 2011-08-29, at 2:05 PM, Richard Riley wrote:
> Robert Cummings <[email protected]> writes:
>
>> On 11-08-29 03:42 PM, Rico Secada wrote:
>>> You go into your homemade library of code to re-use some piece that you
>>> already are using 12 other places in production. Now, last time you
>>> worked on the code you thought it was almost perfect. While working on
>>> the code this time you find an undiscovered bug or some part of the
>>> code that looks like you where on drugs when you made it.
>
> More an issue with library management :) "git checkout releaseV1.1" ;))))
>
>>
>> *lol* Yes, I think we've all seen it from time to time. Have you ever gone
>> back
>> and looked at your school assignments in coding? *shudder*. The horror is
>> compounded by the fact I was using K&R style indentation back then ;)
>
> small point of order : K&R indentation is still considered by many as
> the cleanest and is used on many many large code bases. Personally I
> much prefer
>
> f(){
> a;
> }
>
> to
>
> f()
> {
> }
>
> as the first one is two boundary balanced. But like emacs vs vi it's a
> religious issue....
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
On Mon, 29 Aug 2011, Rico Secada wrote:
You go into your homemade library of code to re-use some piece that you
already are using 12 other places in production. Now, last time you
worked on the code you thought it was almost perfect. While working on
the code this time you find an undiscovered bug or some part of the
code that looks like you where on drugs when you made it.
This is why it's good to write this kind of thing as functions. Then if
you find some great problem with it later, you can drop in the replacement
functions and the code that calls it (hopefully) won't need modification.
Of course, it's easier to be cleverer after the event.
Geoff.
--- End Message ---
--- Begin Message ---
On 29 Aug 2011 at 21:32, George Langley <[email protected]> wrote:
> "The One True Brace Style":
>
> <http://en.wikipedia.org/wiki/Indent_style>
>
> Didn't know there was a name for the way I learned to indent! Make sense to me
> - looks so much cleaner and less scrolling/printing.
> And, I already add a comment to confirm the end brace:
>
> } // end if($myVar)
>
> to clarify any long nests.
The fact that you feel the need to do that is a giveaway.
--
Cheers -- Tim
--- End Message ---
--- Begin Message ---
Hi there,
I am having some trouble with utf8_decode(). Somehow the function
returns output=input
e.g.:
$input = '%20%C3%9Cbersetzung%20franz';
$output = utf8_decode($input);
echo $input.'<br>'.$output;
My goal is to decode the utf8, trim the input and encode with urlencode();
This is the string which I would like to get: %C3%9Cbersetzung+franz
Trim does not work and if I place urlencode() directly on the input it
will encode the % sign to %25 and produce therfore a mixture of encodings.
Thank you for any help on that!
Merlin
--- End Message ---