php-general Digest 8 Oct 2009 09:39:54 -0000 Issue 6380
Topics (messages 298752 through 298767):
Re: FILTER_VALIDATE_INT - newbie question
298752 by: Ben Dunlap
298753 by: MEM
298755 by: Martin Scotta
298759 by: MEM
Re: Apache Rewrite Issues
298754 by: Paul M Foster
298764 by: Gaurav Kumar
Re: Insult my code!
298756 by: Paul M Foster
298758 by: David Otton
298761 by: Paul M Foster
298765 by: Mert Oztekin
foreach insert error
298757 by: Haig Davis
298760 by: Jim Lucas
298762 by: Paul M Foster
Downflow Booths for Sampling & Dispensing Applications
298763 by: Esco Biotech Pvt. Ltd.
what is php4 popularity?
298766 by: Paul M.
Re: Whacky increment/assignment logic with $foo++ vs ++$foo
298767 by: Ashley Sheridan
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 ---
> Also, I think you're getting confused over the zero with exactly what
> you are asking PHP to do. filter_var() returns true if the filter
> matches. If the 0 match is returned as a false, then filter_var() will
filter_var() actually returns the filtered data if the filter matches,
and FALSE if it doesn't. That's the whole point of the filter_XXX
functions; to pass a tainted value through a filter and get a clean,
"safe" value out the other end:
$tainted = get_user_input();
$clean = filter_var($tainted, [FILTER_CONSTANT]);
// now use $clean and never touch $tainted again
>From the original code above, it looks like the OP was
misunderstanding the use of filter_var() and expecting it to return a
boolean.
Ben
--- End Message ---
--- Begin Message ---
> Well, at a guess, if a number is 0, PHP see's that as equivalent to a
> false.
In this case, shouldn't php ignore the 0 as false?
> Also, numbers over 10 digits may be going over the limit for
> your
> PHP install, assuming PHP actually attempts to convert the string to a
> real integer for the purpose of the filter.
This happens with two different php configurations... Is it common to have this
kind of limit on php configuration?
Is this something that I need to be aware of?
>
> For things this simple,
THIS IS NOT SIMPLE !!! :) Newbie blood is in there! :p
Kidding. ;)
> I've always tended to go with something like
> this:
>
> if(!preg_match('^[0-9 \+]$', $telefone))
> {
> $erros['telefone'] = 'Invalid Teléfono - Only Numbers Allowed.';
> }
>
> Which will check for all common types of phone numbers, including those
> where the user has put spaces in to separate groups of digits, and
> those
> that contain the + for country codes.
I will absolutely considerer the use of your regex. Thanks a lot.
Before your e-mail, I've considering the use of this:
if (!is_numeric($telefone))
{
$erros['numberofsomething'] = 'Error - only numbers please.';
}
In the case we need to validate other ints, that are not phones for example,
only an unlimited range of ints,
and we want to store that values on a database, should we have special
considerations regarding the use of is_numeric ?
Thanks a lot,
Márcio
--- End Message ---
--- Begin Message ---
Are you using the == operator or === ?
maybe that's the problem
the function could return false or 0. You need to use the === operator
if( false !== ( $value = filter_var($value, FILTER_VALIDATE_INT)))
{
echo 'I need an Integer';
exit;
}
echo 'Thanks for the Int';
On Wed, Oct 7, 2009 at 2:13 PM, Ben Dunlap <[email protected]>wrote:
> > Also, I think you're getting confused over the zero with exactly what
> > you are asking PHP to do. filter_var() returns true if the filter
> > matches. If the 0 match is returned as a false, then filter_var() will
>
> filter_var() actually returns the filtered data if the filter matches,
> and FALSE if it doesn't. That's the whole point of the filter_XXX
> functions; to pass a tainted value through a filter and get a clean,
> "safe" value out the other end:
>
> $tainted = get_user_input();
> $clean = filter_var($tainted, [FILTER_CONSTANT]);
> // now use $clean and never touch $tainted again
>
> From the original code above, it looks like the OP was
> misunderstanding the use of filter_var() and expecting it to return a
> boolean.
>
> Ben
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Martin Scotta
--- End Message ---
--- Begin Message ---
Thank you all for your replies.
The issue was "solved" for a better fitting solution on this case, that was
by using a regex expression.
I've not tested the difference between using == or ===. I was using !
But, the main question that is not clear on my newbie head is, "why how why"
couldn't this 0 be interpreted, neither as octal, or false, or whatever it
may be, but as just a humble numeric value of 0. At least on the cases where
FILTER_VALIDADE_INT is there.
Anyway, I cannot dig in into this because I'm actually unable to offer some
solutions.
So, as stated, the issue was solved, by using a regex, so all good here. ;)
Thanks once again,
Márcio
--- End Message ---
--- Begin Message ---
On Wed, Oct 07, 2009 at 11:52:00AM +0100, Russell Seymour wrote:
> Morning,
>
> I am trying to make my URLs more search engine friendly and I have come
> up against a problem.
>
> I want the following URL:
>
> mysite.example.com/articles/Test Story
>
> to be proxied to
>
> mysite.example.com/index.php?m=articles&t=Test%20Story
>
Aside from the solution to your problem (which I don't have), you might
want to double-check on the "search engine friendliness" of URLs which
contain query strings. I know at one time this was the case, but the
latest I've heard is that URLs like your second one above are completely
okay with search engines. If someone else knows different, please speak
up.
And oh by the way, don't *ever* store a filename with a space in it on
your computer. It's Evil(tm). I curse the idiot who first came up with
allowing this in filenames. I have a special voodoo doll just for that
person, when I find them. As you can see, it causes all manner of odd
problems, no matter what OS it's on. (My local LUG list is periodically
hit with messages from people trying to overcome the problems attendant
to this habit.)
Paul
--
Paul M. Foster
--- End Message ---
--- Begin Message ---
Hey Russell,
After Going through all the threads in this post, it is correct to say, GET
Rid of the space. Use "-" hyphen for SEO friendly URL's. Its completely
OK.
Other thing which is very handy is urlencode and urldecode functions. When
you are sending a query string use urlencode function. This will preserve
the query string variable as "Test Story" and not as just "Test"; even if
there are spaces in the variable.
Gaurav Kumar
Tech Lead Open Source Solutions
On Wed, Oct 7, 2009 at 4:22 PM, Russell Seymour <
[email protected]> wrote:
> Morning,
>
> I am trying to make my URLs more search engine friendly and I have come up
> against a problem.
>
> I want the following URL:
>
> mysite.example.com/articles/Test Story
>
> to be proxied to
>
> mysite.example.com/index.php?m=articles&t=Test%20Story
>
> I have the following rule in my Apache conf
>
> RewriteRule ^/articles/(.*) index.php?m=articles&t=$1 [P,L]
>
> Now if I run with this configuration, PHP strips the query string back at
> the space, so my query string ends up looking like
>
> [QUERY_STRING] => m=articles&t=Test
>
> even though the log file for the rewrite shows that the full query is being
> passed.
>
> But if I change the RewriteRule to be a Rewrite instead of a Proxy I get
>
> [QUERY_STRING] => m=articles&t=Test%20Story
>
> So something is happening when the system is proxying the request.
> Adding %20 into the URL does not fix the problem when proxy is enabled
> either.
>
> I have search around on the Internet, and people talk about using urlencode
> etc, this is fine when
> PHP is creating the URL but not when Apache is doing the rewrite.
>
> I apologise if people feel this is on the wrong list, but as far as I can
> tell from the rewrite logs the data is coming all
> the way through to PHP which is truncating it. This is purely my
> observation.
>
> Apache version: 2.2.11
> PHP Version: 5.3.0
>
> Any help is gratefully recieved.
>
> Thanks, Russell
>
>
>
--- End Message ---
--- Begin Message ---
On Wed, Oct 07, 2009 at 09:09:29PM +0100, David Otton wrote:
> 2009/10/7 Eric Bauman <[email protected]>:
> >
> > On 7/10/2009 7:25 PM, David Otton wrote:
> >>
> >> 2009/10/7 Eric Bauman<[email protected]>:
> >>
> >>> Any thoughts would be much appreciated!
> >>
> >> One observation. "Model" isn't a synonym for "Database Table" - models
> >> can be anything that encapsulates business logic. Requiring all your
> >> models to inherit from Model is probably a bad idea.
> >
> > Thank-you for responding.
> >
> > Out of curiosity, why is this a bad idea? Is it also bad for views &
> > controllers?
>
> Well, the way MVC has traditionally been approached is that the VC bit
> is a thin interface skin, concerned with I/O, while the M is the bulk
> of the program - the bit that does the heavy lifting. (You'll often
> hear this called "Fat Model, Skinny Controller"). So you could have a
> lot of models, that do a lot of disparate stuff - not just database
> tables.
>
> To give you an example, imagine an application that texts people when
> a new book by their favourite author is coming out.
>
> It's going to have models to represent database tables, the Amazon API
> and an SMS API.
>
> If all your controllers assume that all your models inherit from
> Model, then your code is monolithic and none of it can be reused.
>
> http://c2.com/cgi/wiki?InheritanceBreaksEncapsulation
I think this is a bit extreme. It really depends on what's in your
parent model class. It could be something really simple, but something
you don't want to have to rewrite in every model you code. Thinking that
a model must stand on its own without inheriting from a parent model
class because of some ideal notion of encapsulation is silly.
Actually, in all deference to the eggheads of OOP, I believe there are
really only four reasons to use classes:
1. It keeps me from having to rewrite the same code over and over
(inheritance).
2. It keeps the namespace cleaner, since methods are unknown outside the
context of their containing class.
3. It allows me to change details of function implementation without
breaking things. This is a weak claim, though, because I can do the same
thing with straight functions; just change the guts of the function,
while still providing the same inputs and outputs.
4. It keeps the stack cleaner. I don't have to pass the same crap to
every related function. I can keep the data inside my class and have all
the methods share it.
The notion that OOP was going to save the world billions of hours of
programming time because of re-use is bunk. It hasn't, doesn't and
won't.
</rant>
Paul
--
Paul M. Foster
--- End Message ---
--- Begin Message ---
2009/10/7 Paul M Foster <[email protected]>:
> I think this is a bit extreme. It really depends on what's in your
> parent model class. It could be something really simple, but something
> you don't want to have to rewrite in every model you code. Thinking that
Have you got an example of something that is needed by every model
that interacts with a general-purpose framework?
> 1. It keeps me from having to rewrite the same code over and over
> (inheritance).
Inheritance isn't the only mechanism for code-reuse, but it is the
most tightly bound. In some situations it may be the appropriate
solution, but it does force you into a taxonomy straightjacket. You
just need to be aware of that, and pick the appropriate tool for the
job.
--- End Message ---
--- Begin Message ---
On Wed, Oct 07, 2009 at 11:31:58PM +0100, David Otton wrote:
> 2009/10/7 Paul M Foster <[email protected]>:
>
> > I think this is a bit extreme. It really depends on what's in your
> > parent model class. It could be something really simple, but something
> > you don't want to have to rewrite in every model you code. Thinking that
>
> Have you got an example of something that is needed by every model
> that interacts with a general-purpose framework?
Probably not a great example, but how about this: *Assuming* that the
models need variables held in the config (which database, if any, for
example), we put code in the constructor of the parent model which picks
up these variables and stores references to them, for use in inherited
models. The config could be a singleton class which holds a single
instance of all the config variables. I *could* include a call like
$this->config =& get_config();
in each model's constructor. Or I could just do it once in the parent
model. Of course, if this is all the parent model provides, then
$this->config =& get_config();
in each model would be roughly equivalent to
parent::Model();
in each model. But if the parent provided more than that, then I would
be writing less code to simply build it into the parent. And of course,
if I ever wanted to *add* more to all the models, then having a parent
model would allow me to do so without having to rejigger the code in
each model.
Paul
--
Paul M. Foster
--- End Message ---
--- Begin Message ---
Hi Paul,
As I agree some of your thoughts, I want to add my opinion also.
Yes the code should work. That is why we earn Money. If it doesnt work, then we
are on fire. But things like OOP or MVC weren't invented for a better running
code. They are invented so the codes will going to be much more clean,
readable, reusable, maintainable. "Running codes" is not enough.
Eric asked about how his MVC structure looks. And we are trying to help what we
know about MVC. He didn't asked if the code is fine for running. So giving an
answer "The real key is, does it work, and can it be maintained" is not enough
and not really helpful to him on MVC concept. If you need just a running and
maintainable project, you don't need to use MVC (MVC is not all about that). We
are not criticizing his code(the code is really fine(except injection problem
:-) ) and very readable)
Eric,
As Martin said, All the business logic should be in Model. Controller should
not tell a model "Save it to this database, select it from this table, use this
db_adapter" etc. A controller is like a maestro of the system. It askes the
model to play piano loud. But it wont say which key of piano, the model should
touch.
I suggest you to read this online book about Zend Framework and MVC. Its really
really very helpful to understand the concept. Also example codes are very
clean and good.
http://www.survivethedeepend.com/zendframeworkbook/en/1.0
Take Care,
Mert
(sorry for my english)
-----Original Message-----
From: Paul M Foster [mailto:[email protected]]
Sent: Wednesday, October 07, 2009 7:54 PM
To: [email protected]
Subject: Re: [PHP] Insult my code!
On Wed, Oct 07, 2009 at 05:34:35PM +1100, Eric Bauman wrote:
> Hi there,
>
> I'm in the process of trying to wrap my head around MVC, and as part of
> that, I'm attempting to implement a super-tiny MVC framework.
>
> I've created some mockups of how the framework might be used based
> around a very simple 'bank', but I'm trying to get some feedback before
> I go and implement it, to make sure I'm actually on the right track.
>
> Any thoughts would be much appreciated!
>
> Model - http://www.pastebin.cz/23595
> Controller - http://www.pastebin.cz/23597
> View - http://www.pastebin.cz/23598
> Template - http://www.pastebin.cz/23599
Your code (what there is of it) is fine. Beware of people who criticize
your code on purely academic criteria. There are a lot of differing
opinions about MVC, much of it driven by people making academic points
versus people who actually code for a living. Even some people who
actually code for a living fall under the spell of academic rules about
this or that.
The real key is, does it work, and can it be maintained. If so, don't
worry about people who argue esoteric points about what should or
shouldn't be in models and controllers, etc.
Paul
--
Paul M. Foster
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Bu mesaj ve ekleri, mesajda g?nderildi?i belirtilen ki?i/ki?ilere ?zeldir ve
gizlidir. Size yanl??l?kla ula?m??sa l?tfen g?nderen kisiyi bilgilendiriniz ve
mesaj? sisteminizden siliniz. Mesaj ve eklerinin i?eri?i ile ilgili olarak
?irketimizin herhangi bir hukuki sorumlulu?u bulunmamaktad?r. ?irketimiz
mesaj?n ve bilgilerinin size de?i?ikli?e u?rayarak veya ge? ula?mas?ndan,
b?t?nl???n?n ve gizlili?inin korunamamas?ndan, vir?s i?ermesinden ve bilgisayar
sisteminize verebilece?i herhangi bir zarardan sorumlu tutulamaz.
This message and attachments are confidential and intended for the
individual(s) stated in this message. If you received this message in error,
please immediately notify the sender and delete it from your system. Our
company has no legal responsibility for the contents of the message and its
attachments. Our company shall have no liability for any changes or late
receiving, loss of integrity and confidentiality, viruses and any damages
caused in anyway to your computer system.
--- End Message ---
--- Begin Message ---
Hello All,
I have spent the entire day trying to get my calendar app to function
correctly --- I have no problem with the actual functioning of the
calendar. What is giving me trouble is for each calendar day the user has
the option to check a checkbox requesting the day off and additionally the
user must select a weighting for the request i.e. 1-31 with 1 being 1st
choice and 31 being their least desirable request. The request is then
insered into a mysql database.
I am relativly new to PHP so I may well be on the complete wrong track here.
so far I have tried imploding the array & posting an associative array.
Form Script:
<div class="workspace">
<?php
if(isset($_POST['submit'])){
$userID = mysql_real_escape_string(trim($userID));
$year = mysql_real_escape_string(trim($_GET['year']));
$month = mysql_real_escape_string(trim($_GET['mon']));
$dayoff = $_POST['dayoff'];
$weighting = mysql_real_escape_string(trim($_POST['weight']));
var_dump($dayoff);
foreach ($dayoff as
$day){ //come back
to this when figured out that inserting day works to inser wieghting
$sql = "INSERT INTO dayoff (userID, month, year, day) VALUES
('$userID', '$year', '$month', '$day')";
$q = mysql_query($sql)
or die ('error making request');
}
}
?>
<div class="form">
<form name="form" method="post" action="<?php $_SERVER['PHP_SELF'] ; ?>">
<h2>Request Day Off</h2><br /><br />
<?php include '../includes/dayoffcalendar.php' ; ?>
<br /><br /><br />
<button type="submit" name="submit" value="Submit"
class="button">Submit</button>
<button type="reset" class="button">Reset</button>
</form>
Calendar Script:
for($i = 1; $i <= $last['mday']; $i++){
if($i == $today['mday'] && $first['mon'] == $today['mon'] &&
$first['year'] == $today['year']){
$style = 'today';
}
else{
$style = 'day';
}
$filename="$1.['month'].['year']";
echo ' <div class="' . $style . '">' . $i . '<br /><br />' ; // creates
comment box for points and check box for request day off
echo ' <label><small>Point Weighting: </small></label><input type="text"
name="weight$i[]" size ="3" maxlength="3" /><Br /><br /> ';
echo ' <label><small>Check Day Off: </small></label><input type
="checkbox" name="dayoff[]" value="\". $i . \"" /><br /> ';
echo ' </div>' . "\n";
}
I appreciate any advice that you may have. Thank you very much in advance,
my head hurts and I've googled for a few hours with no joy.
Thanks
Haig
--- End Message ---
--- Begin Message ---
Haig Davis wrote:
> Hello All,
>
> I have spent the entire day trying to get my calendar app to function
> correctly --- I have no problem with the actual functioning of the
> calendar. What is giving me trouble is for each calendar day the user has
> the option to check a checkbox requesting the day off and additionally the
> user must select a weighting for the request i.e. 1-31 with 1 being 1st
> choice and 31 being their least desirable request. The request is then
> insered into a mysql database.
>
> I am relativly new to PHP so I may well be on the complete wrong track here.
> so far I have tried imploding the array & posting an associative array.
>
> Form Script:
>
> <div class="workspace">
> <?php
> if(isset($_POST['submit'])){
>
> $userID = mysql_real_escape_string(trim($userID));
> $year = mysql_real_escape_string(trim($_GET['year']));
> $month = mysql_real_escape_string(trim($_GET['mon']));
> $dayoff = $_POST['dayoff'];
> $weighting = mysql_real_escape_string(trim($_POST['weight']));
> var_dump($dayoff);
>
> foreach ($dayoff as
> $day){ //come back
> to this when figured out that inserting day works to inser wieghting
>
> $sql = "INSERT INTO dayoff (userID, month, year, day) VALUES
> ('$userID', '$year', '$month', '$day')";
>
> $q = mysql_query($sql)
> or die ('error making request');
> }
>
>
> }
> ?>
> <div class="form">
> <form name="form" method="post" action="<?php $_SERVER['PHP_SELF'] ; ?>">
> <h2>Request Day Off</h2><br /><br />
> <?php include '../includes/dayoffcalendar.php' ; ?>
>
> <br /><br /><br />
> <button type="submit" name="submit" value="Submit"
> class="button">Submit</button>
> <button type="reset" class="button">Reset</button>
> </form>
>
> Calendar Script:
>
>
I see a number of typo's in the following code.
> for($i = 1; $i <= $last['mday']; $i++){
> if($i == $today['mday'] && $first['mon'] == $today['mon'] &&
> $first['year'] == $today['year']){
> $style = 'today';
> }
> else{
> $style = 'day';
> }
What are you trying to do here?
Should this...
> $filename="$1.['month'].['year']";
Be this...
$filename=$i."['month'].['year']";
Plus, where are you actually using the previous line at?
> echo ' <div class="' . $style . '">' . $i . '<br /><br />' ; // creates
> comment box for points and check box for request day off
> echo ' <label><small>Point Weighting: </small></label><input type="text"
> name="weight$i[]" size ="3" maxlength="3" /><Br /><br /> ';
Should you have "weight$i[]" in the previous line? This will break a few things
I think.
> echo ' <label><small>Check Day Off: </small></label><input type
> ="checkbox" name="dayoff[]" value="\". $i . \"" /><br /> ';
> echo ' </div>' . "\n";
>
> }
Over all, simply put, if you do not number the indexes of your array, you will
not be able to have a 1 to 1 association in your submitted array(s)
BTW: I would try and use the heredoc syntax in your example... Makes things way
cleaner!
echo <<<DAY
<div class="{$style}">{$i}<br /><br />
<label><small>Point Weighting: </small></label>
<input type="text" name="days[{$i}][weight]" size ="3" maxlength="3" /><Br
/><br />
<label><small>Check Day Off: </small></label>
<input type="checkbox" name="days[{$i}][dayoff]" value="{$i}" /><br />
</div>
DAY;
Now, on your input side. Try it a few times to see what you get and I think you
will be able to figure out how to eliminate the days that were not selected /
checked.
>
> I appreciate any advice that you may have. Thank you very much in advance,
> my head hurts and I've googled for a few hours with no joy.
>
> Thanks
>
> Haig
>
--- End Message ---
--- Begin Message ---
On Wed, Oct 07, 2009 at 03:31:14PM -0700, Haig Davis wrote:
> Hello All,
>
> I have spent the entire day trying to get my calendar app to function
> correctly --- I have no problem with the actual functioning of the
> calendar. What is giving me trouble is for each calendar day the user has
> the option to check a checkbox requesting the day off and additionally the
> user must select a weighting for the request i.e. 1-31 with 1 being 1st
> choice and 31 being their least desirable request. The request is then
> insered into a mysql database.
>
> I am relativly new to PHP so I may well be on the complete wrong track here.
> so far I have tried imploding the array & posting an associative array.
You don't actually saw what your real problem is, and I'm too lazy (and
tired) to try to figure it out from your code. Can you elaborate?
Paul
--
Paul M. Foster
--- End Message ---
--- Begin Message ---
Dear Sir,
Esco announces the launch of its NEW range of Pharmacon Downflow Booths for
Sampling and Dispensing applications.
Downflow Booths provide containment by utilizing high velocity air to capture
airborne dust particles. Downflow Booths are versatile devices that can
· Be used to control exposure risk to hazardous materials
for a wide variety of equipment and processes.
· When used correctly, provide Operator Exposure Levels
(OEL's) ≤100 micrograms/m3 over an 8 hour Time Weighted Average (TWA).
· Enhance cGMP practices.
Downflow booths are used in the pharmaceutical, fine chemical and food
industries, for operations such as sampling, grinding, dispensing and filling,
which generate airborne particles; when processes involve hazardous, toxic or
sensitising materials and when operators, adjoining areas require protection
from exposure to aerosols of the process materials.
Pharmacon Downflow Booths are premium containment products, designed/built by
Esco. Pharmaceutical dispensing, sampling and charging operations are now safer
and more efficient with the Esco range of Pharmacon™ Downflow Booths.
Harnessing Esco's experience of close to 30 years in clean air and containment
equipment design for the pharmaceutical industry, these booths offer dependable
performance in compliance with the latest environmental and operator safety
standards. These products expand Esco's market reach into the cosmetics, fine
chemicals, pharmaceuticals and other industries, where safety is paramount.
The main features of Esco® Pharmacon Downflow Booths are the following.
· Modular Designs : Standard booth width starts at 1.2 m,
and can be increased in 0.3 m / 0.5 m increments.
· Single, Two Stage or Three Stage HEPA or ULPA Filtration.
· Re-Circulatory Airflow or Single Pass Airflow if solvent
or hazardous fumes are present in the process (may also require explosion proof
electrics).
· Optional Cooling Coils to offset heat gains in
re-circulatory airflow systems. (Typical heat gains ~10-15°C, dependent on
process).
· Proven Containment Performance : Verified according to
the ISPE Good Practice Guide, Assessing the Particulate Containment Performance
of Pharmaceutical Equipment.
We request you to visit the following links for relevant information on our
Downflow Booths.
·
http://escoglobal.com/products/containment-pharma/detail.php?id=DFB
· Esco Downflow Booth Literature
· Downflow Booth Performance Evaluation
· Downflow Booth Questionnaire
· Downflow Booth Surrogate Testing
· Engineering Controls
We will be pleased to provide further information as and when desired.
Assuring you of our best attention at all times, we remain.
Yours truly,
For ESCO BIOTECH PVT. LTD.,
S. MAHESHWARI
Chief – Customer Support
==============================================================================================
Esco Biotech Pvt. Ltd.,
101 – 102, Sita Niwas,
Plot No. 94, Road No.1,
Liberty Garden, Malad (W),
Mumbai – 400 064
INDIA
Tel : + 91 22 4073 0202 / 2880 3636 / 3293 3535 / 2889 3535 / 2889 1439 / 2889
1375
Fax : + 91 22 2880 3738 / 2889 3636
E mail : [email protected]
Web : www.escoindia.co.in
Worldwide Headquarters
Esco Micro Pte Ltd, Singapore
Web: www.escoglobal.com
Global Offices: Philadelphia, USA ~ Santiago, Chile ~ Shanghai, China ~ Kuala
Lumpur, Malaysia ~ Mumbai, India ~ Dubai, U.A.E.
===============================================================================================
Esco ® is recognized as a global player in containment, clean air and
laboratory equipment technology. We are highly oriented towards the
international marketplace, with distribution in more than 100 countries – and a
direct presence in 10 of the key global markets. Esco represents innovation,
forward-thinking design, coupled with the tradition of quality since 1978.
Esco 1978 - 2009: Celebrating 31 years of quality, service and tradition.
I Biological Safety Cabinets I Laminar Flow Cabinets I Laboratory Fume Hoods I
Ductless Fume Hoods I Cleanroom Equipments I Air Showers I Sampling &
Dispensing Booth I Hospital Pharmacy Products I Cytoculture™ Cytotoxic Safety
Cabinets I Isoclean Hospital Pharmacy Isolators I IVF Workstations I Lab Animal
Research Products I Laboratory Incubators I Laboratory Ovens I PCR Cabinets I
PCR Thermal Cyclers I Real Time Thermal Cyclers I Ultralow Freezers I
I Esco on Twitter I Esco on You Tube I Esco Bio Safety Cabinet Micro-Site I
===============================================================================================
If you would prefer not to receive further messages from us, please send an
e-mail : [email protected]
--- End Message ---
--- Begin Message ---
Hey guys, does anyone have a good link for an article where php4
popularity trends are examined? The best way for me to know php4 % and
php5 %. I appreciate any good suggestions.
--- End Message ---
--- Begin Message ---
On Wed, 2009-10-07 at 13:24 -0700, Tommy Pham wrote:
>
>
> ________________________________
> From: tedd <[email protected]>
> To: [email protected]; [email protected]; Daevid Vincent
> <[email protected]>
> Sent: Wed, October 7, 2009 12:42:41 PM
> Subject: RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo
>
> At 1:59 PM +0100 10/7/09, Ashley Sheridan wrote:
> >>On Wed, 2009-10-07 at 08:54 -0400, tedd wrote:
> >>At 6:15 PM -0700 10/6/09, Daevid Vincent wrote:
> >>>Except that:
> >>>
> >>>$a = 123;
> >>>$b = $a++;
> >>>echo $b; //gives 123, not 124
> >>>
> >>>as you logically expect it to and common sense would dictate, regardless of
> >>>what K&R or anyone else says.
> >>
> >>That's not the way I look at it.
> >>
> >> $b = $a++;
> >>
> >>means to me "take the value of $a and assign to $b and then increment $a."
> >>
> >>Whereas:
> >>
> >> $b = ++$a;
> >>
> >>means to me "increment $a and take the value of $a and assign to $b."
> >>
> >>Cheers,
> >>
> >>tedd
> >>
> >>
> >
> >Which is exactly the reason for the two operators in C.
> >
> >Thanks,
> >Ash
>
> Ash:
>
> The reason was simply to provide a different way of doing something.
> For example, take the statements of:
>
> $a = 10;
> $b = a$++; // $b = 10 and $a = 11
>
> This post-increment operator was a way to assign 10 to $b and
> increment $a in one statement.
>
> Whereas:
>
> $a = 10;
> $b = ++a$; // $b = 11 and $a = 11
>
> This pre-increment operator was a way to increment $a and also assign
> that value to $b.
>
> Both are perfectly valid ways of using the operator. Also realize
> that the pre-decrement and post-decrement operators worked in similar
> fashion.
>
> Now why would someone want to do that? There could be many reasons,
> but that was left to the programmer to use as he/she needed.
>
> However, what I find wacky about all of this is:
>
> for($i=1; $i<=10; $i++)
> {
> echo($i);
> }
>
> and
>
> for($i=1; $i<=10; ++$i)
> {
> echo($i);
> }
>
>
> Do exactly the same thing. I would have expected the first to print
> 1-10, while the second to print 2-10, but they both print 1-10.
>
> Cheers,
>
> tedd
>
>
> Tommy>> Why would expect to print 2-10? The way I read the for loop is:
> start $i with 1, do loop body until $i <= 10, increment $i before next loop.
> So whether post/pre-increment doesn't matter logically. Moreover, your
> loop can also be written as:
>
> for ($i=1; $i <= 10;)
> {
> echo ($i++);
> }
>
> PS: I hate to send reply in 'rich text' but Yahoo's plain text screw up the
> quote... I think it's time to switch over to gmail...
>
>
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
That what I thought I said when I said "Which is exactly the reason for
the two operators in C."
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---