<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.php.general">
    <title>gmane.comp.php.general</title>
    <link>http://blog.gmane.org/gmane.comp.php.general</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226031"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226030"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226029"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226028"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226027"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226026"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226025"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226024"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226023"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226022"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226021"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226020"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226019"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226018"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226017"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226016"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226015"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226014"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226013"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.php.general/226012"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226031">
    <title>Re: Re: Function size</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226031</link>
    <description>&lt;pre&gt;


With the odd exception being where code is more readable in a longer
format, as seen with my and several others examples of long functions
that rely heavily on switches. 

&lt;/pre&gt;</description>
    <dc:creator>Ashley Sheridan</dc:creator>
    <dc:date>2012-05-24T21:01:16</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226030">
    <title>Re: Function size</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226030</link>
    <description>&lt;pre&gt;up to our ability to view them in their totality. When our functions get
beyond that limit, we tend to refactor and reduce.
increased in number of lines. But, they have reached a limit that limit is
generally about the number of lines I can read in half of my monitor's
height. This of course, is dependent on monitor resolution, font-size, and
how far I am sitting from the monitor. But I think this is a natural and
physical limit that we don't normally recognize. I can cite studies that
support my theory.
and provide the average number of lines in their functions AND how many
lines of code their monitor's can display. In other words, look at your
editor; count the number of lines your monitor can display; estimate the
number of lines in your average function; and report the findings.  For
example, mine is about half -- my monitor can display 55 lines of code and
my average function is around 25 lines. YMMV.

Yes, I think that is *exactly* the criterion-- not a mystery or an emergent
thing, really, was a pretty expicit reasoning--being able to see/scan the
entire function on one page (or now in one screenful) makes it much easier
to see what happens in the function, where blocks open/close, and it forces
one to break up code into logical units.
&lt;/pre&gt;</description>
    <dc:creator>tamouse mailing lists</dc:creator>
    <dc:date>2012-05-24T20:48:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226029">
    <title>Re: w.r.t. mail() function</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226029</link>
    <description>&lt;pre&gt;
well, if he is wanting the message to be placed in the outbox or sent 
folder of his email client, and this client is on his workstation and 
the sent folder is accessed via IMAP, nor is it via a web client, then 
his only option is to have his email client filter a message to the sent 
folder.

POP3 picks up new messages from your inbox.  IMAP allows you to have 
folders on/in the mail server file structure, but the mail server would 
then need a filter (ie: procmail) to move the new message over to the 
correct folder.

So, no matter what type of solution he comes up with, something, either 
his client or the mail server will need to have a filter created to move 
the message to the correct folder.

Now, I guess you could completely sidestep all security and with proper 
setting have php write the email to the correct folder in the persons 
sent box.  And he could then access it via IMAP and/or a web based email 
client.  But, this would require that php process have file level access 
to the folder which his mail directory resides.



&lt;/pre&gt;</description>
    <dc:creator>Jim Lucas</dc:creator>
    <dc:date>2012-05-24T15:48:17</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226028">
    <title>Re: Function size</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226028</link>
    <description>&lt;pre&gt;
It starts where it starts. It doesn't make any difference how you do it, it's what you see in one view that counts.

If you are very verbose with spaces, brace styles, comments, and such, then your functions have less actual statement lines than others with more cryptic coding styles, but I would bet the line limit of total number of lines remain in place regardless. This is more a condition of physical/mental limits on humans than it is on coding style.

So, there's no "better" or "worse' point here -- it is more an observation.

Cheers,

tedd

_____________________
tedd&amp;lt; at &amp;gt;sperling.com
http://sperling.com

&lt;/pre&gt;</description>
    <dc:creator>Tedd Sperling</dc:creator>
    <dc:date>2012-05-24T15:00:08</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226027">
    <title>Re: Function size</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226027</link>
    <description>&lt;pre&gt;
On May 23, 2012, at 3:49 PM, Ashley Sheridan wrote:

I see you and I are like minds in many ways.

I had one large switch block that had 255 different cases. Oddly enough I was parsing a "Tiger" data file (USGS survey data) that contained 255 different record types. Each record type required a different function to parse the data and render it's portion of the overall map. That lead to me create a linked-list that held the memory addresses of both data and function. That way simply accessing the linked list coupled data to function and drew the map. It was neat.

I find it also neat, while I'm not an expert on the subject, eliminating the need for 'switch' and 'if' statements via extending classes in OO.

Shiplu provided a link, which I found interesting:

http://www.youtube.com/watch?v=4F72VULWFvc

It showed how one can eliminate such conditionals, but at the same time it massively increased the code to preform 1 + 2 * 3. :-)

And to others, I don't need comment on how I missed the point -- I didn't.

Cheers,

tedd

_____________________
tedd&amp;lt; at &amp;gt;sperling.com
http://sperling.com


&lt;/pre&gt;</description>
    <dc:creator>Tedd Sperling</dc:creator>
    <dc:date>2012-05-24T14:52:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226026">
    <title>Re: Function size</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226026</link>
    <description>&lt;pre&gt;

I, and I'm fairly sure many others, do not count docblocks, comment
lines, or lines containing only braces in the count for LOC in a
function.

&lt;/pre&gt;</description>
    <dc:creator>Jeremiah Dodds</dc:creator>
    <dc:date>2012-05-24T12:52:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226025">
    <title>Re: openssl_sign() &amp; openssl_verify() discrepancy</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226025</link>
    <description>&lt;pre&gt;
Well without you saying "should explain the problem further" I wouldn't 
have conducted the series of tests to verify each component being used 
within the sign/save &amp;amp; retrieve/verify processes.

I was passing the wrong argument in during my retrieve/verify flow.

Thanks again!


&lt;/pre&gt;</description>
    <dc:creator>jas</dc:creator>
    <dc:date>2012-05-24T12:53:23</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226024">
    <title>Re: Cookie use management</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226024</link>
    <description>&lt;pre&gt;( Forgot email address :) )
Jeremiah Dodds wrote:

That would probably fall under the ICO acceptance that they don't want people to 
feel that they simply have to switch site functionality off ;)

I'm doing the hosting, but many of the sites that I need to support we have not 
written the code which as a range of 'frameworks', so I'm trying to find 
something that can be added in easily - like the Piwik tracking - without having 
to rewrite the sites ...

I'm thinking I need to write my own module, but I can't believe that no-one has 
done it yet. Or perhaps they are all charging for the service :)

&lt;/pre&gt;</description>
    <dc:creator>Lester Caine</dc:creator>
    <dc:date>2012-05-24T12:51:30</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226023">
    <title>RE: Function size</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226023</link>
    <description>&lt;pre&gt;one

Tedd,

I think the length of code depends on a few different factors, what if you
have your docblocks, and comment lines, as well as your bracing style?
Where do you consider your function to start?

Personally, I use this bracing style:

# decide if we should work, or sleep
if($do == $something)
{
# do something here
$work = 'done';
}
else
{
# something isn't being done now
$work = 'sleep';
}


In this (really crude) example, there are 11 lines of code.  Granted, the
way you do your bracing you can lose a few lines, and within this example,
it could be written as:

# decide if we should work, or sleep
# default action for if something isn't being done
$work = 'sleep';
if($do == $something) {
# do something here
$work = 'done';
}

So, with that craptastic example, we've taken 11 lines, and compressed it to
7.

Anyways, I get the "rule of thumb" to be able to fit a function on a
"screen", or to make it as small as possible, but sometimes comments can get
in the way, and if you like your bracing style, you end up with a lot of
extra lines of code too (also if you like to have blank lines between
actions).


Anyways, my IDE that I use, shows 47 lines on the screen, at 145 characters
across, using Courier New 9pt, and I try to keep it to 80 characters wide,
but that doesn't always happen :P

Steve.


&lt;/pre&gt;</description>
    <dc:creator>Steven Staples</dc:creator>
    <dc:date>2012-05-24T12:37:02</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226022">
    <title>Re: problem sending email</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226022</link>
    <description>&lt;pre&gt;
Don't prefix with From: and To: here.


Also, Gmail SMTP supports only SSL connections. I don't know this PEAR
module, but I think you need to host set to something like
ssl://smtp.gmail.com, to enforce SSL connection.

- Matijn

&lt;/pre&gt;</description>
    <dc:creator>Matijn Woudt</dc:creator>
    <dc:date>2012-05-24T12:10:30</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226021">
    <title>problem sending email</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226021</link>
    <description>&lt;pre&gt;hi all,i'm having this problem in sending email using pear.
it just wont send :(
here's the code ..

&amp;lt;?php
    require_once 'Mail.php';

    $from_name = "My Self";
    $to_name = "My Friend";
    $subject = "Sending Trial";
    $mailmsg = "GOD please make it work";

    $From = "From: ".$from_name." &amp;lt;mymail&amp;lt; at &amp;gt;gmail.com&amp;gt;";
    $To = "To: ".$to_name." &amp;lt;someone&amp;lt; at &amp;gt;yahoo.com&amp;gt;";
    $recipients = "someone&amp;lt; at &amp;gt;yahoo.com";

    $headers["From"] = $From;
    $headers["To"] = $To;
    $headers["Subject"] = $subject;
    $headers["Content-Type"] = "text/plain; charset=iso-8859-1";

    $smtpinfo["host"] = "smtp.gmail.com";
    $smtpinfo["port"] = "465";
    $smtpinfo["auth"] = true;
    $smtpinfo["username"] = "mymail&amp;lt; at &amp;gt;gmail.com";
    $smtpinfo["password"] = "mypassword";

    $mail_object =&amp;amp; Mail::factory("smtp", $smtpinfo);

    $mail_object-&amp;gt;send($recipients, $headers, $mailmsg);

    if (PEAR::isError($mail_object))
      echo $mail_object-&amp;gt;getMessage();
?&amp;gt;
&lt;/pre&gt;</description>
    <dc:creator>As'ad Djamalilleil</dc:creator>
    <dc:date>2012-05-24T12:00:47</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226020">
    <title>Re: Function size</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226020</link>
    <description>&lt;pre&gt;
This is interesting. You do realize that if I would take this switch
down to OO, I would have to create 400 different classes to replace
this switch statement? Luckily in PHP we can have more classes in a
single file, thinking about Java for example would mean I have to
create 400 new files...
I like the concept, but I don't see how it works for such switch statements.

&lt;/pre&gt;</description>
    <dc:creator>Matijn Woudt</dc:creator>
    <dc:date>2012-05-24T11:54:42</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226019">
    <title>Re: w.r.t. mail() function</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226019</link>
    <description>&lt;pre&gt;
Maybe because not everyone uses mail clients that have a filter functionality?

&lt;/pre&gt;</description>
    <dc:creator>Matijn Woudt</dc:creator>
    <dc:date>2012-05-24T11:39:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226018">
    <title>Re: Cookie use management</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226018</link>
    <description>&lt;pre&gt;

I don't know about the rest of your post, but you can easily turn off
this behavior if it's present (unless you are using a rather poor host),
see http://www.php.net/manual/en/session.configuration.php

&lt;/pre&gt;</description>
    <dc:creator>Jeremiah Dodds</dc:creator>
    <dc:date>2012-05-24T10:34:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226017">
    <title>Cookie use management</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226017</link>
    <description>&lt;pre&gt;Not directly a PHP problem, but since PHP tends to automatically create a 
session cookie I thought it appropriate to ask here first.

The European rules on asking permission to use cookies have been around for a 
year now, and very few sites seem to be worrying about it until now, but press 
coverage is flagging that the ICO in the UK will start 'prosecuting' next week. 
Not exactly what the ICO are saying themselves, as they would prefer that the 
BROWSERS defaulted to cookies being blocked generally, so every cookie action 
requires approval locally anyway. Session cookies could be claimed to be exempt, 
but with the increasing hidden use of Google Analytics or in my case Piwik, WE 
become responsible or all that activity and so a few 'commercial' sites are 
appearing offering chargeable services to manage this for you.

I've been trying to dig down through the google results to find anything open 
source that provides something easily bolted on to existing PHP sites to 
intercept cookie use before it actually happens. My reading of the rules would 
suggest that simply adding a session cookie is acceptable as long as the site 
identifies they are being used, but until there is some 'case law', actually 
practice is very grey? Pop-up is obviously out of the question since that can be 
blocked, and even javascript could be blocked so what can be relied on to 
'Obtain permission before using a cookie'?

&lt;/pre&gt;</description>
    <dc:creator>Lester Caine</dc:creator>
    <dc:date>2012-05-24T10:25:40</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226016">
    <title>Re: Need help on increment date</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226016</link>
    <description>&lt;pre&gt;It works. Thanks you two. Thanks Shiplu bro for the advice.
----------------------------------------------------------
Dedicated Linux Forum in Bangladesh &amp;lt;http://goo.gl/238Ck&amp;gt;
2048R/89C932E1 &amp;lt;http://goo.gl/TkP5U&amp;gt;
Volunteer, FOSS Bangladesh &amp;lt;http://fossbd.org/&amp;gt; &amp;amp;&amp;amp; Mozilla
Reps&amp;lt;http://reps.mozilla.org&amp;gt;
01199151550

On 24 May 2012 15:08, shiplu &amp;lt;shiplu.net&amp;lt; at &amp;gt;gmail.com&amp;gt; wrote:

&lt;/pre&gt;</description>
    <dc:creator>Md Ashickur Rahman Noor</dc:creator>
    <dc:date>2012-05-24T09:14:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226015">
    <title>Re: Need help on increment date</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226015</link>
    <description>&lt;pre&gt;It works for me too.

I tell you two things,
a) make sure there is a space after +1 day. So it should look like "+1 day
". This ensures that the unix time is not concatenated with "day".
b) calling strtotime 2 times is not a great solution. You can all it once
only.  Like this,

    $date = strtotime &amp;lt;http://www.php.net/strtotime&amp;gt;("+1 day 2008-02-28");

    // better to call this, as the order is quite logical

    $date = strtotime &amp;lt;http://www.php.net/strtotime&amp;gt;("2008-02-28 +1 day");

&lt;/pre&gt;</description>
    <dc:creator>shiplu</dc:creator>
    <dc:date>2012-05-24T09:08:21</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226014">
    <title>Re: Need help on increment date</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226014</link>
    <description>&lt;pre&gt;Get this from here&amp;lt;http://stackoverflow.com/questions/660501/simplest-way-to-increment-a-date-in-php&amp;gt;
----------------------------------------------------------
Dedicated Linux Forum in Bangladesh &amp;lt;http://goo.gl/238Ck&amp;gt;
2048R/89C932E1 &amp;lt;http://goo.gl/TkP5U&amp;gt;
Volunteer, FOSS Bangladesh &amp;lt;http://fossbd.org/&amp;gt; &amp;amp;&amp;amp; Mozilla
Reps&amp;lt;http://reps.mozilla.org&amp;gt;
01199151550


&lt;/pre&gt;</description>
    <dc:creator>Md Ashickur Rahman Noor</dc:creator>
    <dc:date>2012-05-24T08:39:08</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226013">
    <title>Re: Need help on increment date</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226013</link>
    <description>&lt;pre&gt;

Works fine for me: http://dev.stut.net/php/increment_date.php

Have you extracted the above from other code, or are you seeing this behaviour with just those two lines?

-Stuart

&lt;/pre&gt;</description>
    <dc:creator>Stuart Dallas</dc:creator>
    <dc:date>2012-05-24T07:24:08</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226012">
    <title>Need help on increment date</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226012</link>
    <description>&lt;pre&gt;HI all

I need help to increment date in php. I found this code helpful

$date = strtotime("+1 day", strtotime("2007-02-28"));
But when My date is "2008-02-28" this code give output 2012-03-01. But it
should  be  2008-02-29. Where I am getting wrong.

----------------------------------------------------------
Dedicated Linux Forum in Bangladesh &amp;lt;http://goo.gl/238Ck&amp;gt;
2048R/89C932E1 &amp;lt;http://goo.gl/TkP5U&amp;gt;
Volunteer, FOSS Bangladesh &amp;lt;http://fossbd.org/&amp;gt; &amp;amp;&amp;amp; Mozilla
Reps&amp;lt;http://reps.mozilla.org&amp;gt;
01199151550
&lt;/pre&gt;</description>
    <dc:creator>Md Ashickur Rahman Noor</dc:creator>
    <dc:date>2012-05-24T07:18:16</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.php.general/226011">
    <title>Re: Function size</title>
    <link>http://permalink.gmane.org/gmane.comp.php.general/226011</link>
    <description>&lt;pre&gt;

My monitor can also display about 55 lines of code, my functions are, on
average, just a few lines of code though -- a maximum of about 20, with
an average of around 5 or so.

This is because the rule of thumb I follow is that a function should do
one thing, and should be named well. The biggest downside to the type of
style I have is that if not done "correctly", people can feel like
they're swimming in a sea of chasing down functions to find out wtf is
going on. When done "correctly", it leads to pretty clear code, IMO.

&lt;/pre&gt;</description>
    <dc:creator>Jeremiah Dodds</dc:creator>
    <dc:date>2012-05-24T02:39:23</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.php.general">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.php.general</link>
  </textinput>
</rdf:RDF>

