think tank forum

philosophy and religion » freshies as a worldview

lucas's avatar
15 years ago
link
lucas
i ❤ demo
DISCUSS

<?php

$freshies = new_files();

if (count($freshies) === 0) {

    echo "            <h3>there are no new photos in s3 to import.</h3>\n";

} else if (count($freshies) > 0) {

?>

[. . .]
greene's avatar
15 years ago
link
greene
cursed, but the demons i confronted with dispersed
i am interested in this

is this a coding joke of some sort
lucas's avatar
15 years ago
link
lucas
i ❤ demo
no

do you enjoy the concept of neuroplasticity?
greene's avatar
15 years ago
link
greene
cursed, but the demons i confronted with dispersed
i'm interested in the creation of new neural pathways because thats what my beloved binaural beat entrainment technology does

i'm familiar with neuroplasticity as i listened to a few audio seminars on the topic
greene's avatar
15 years ago
link
greene
cursed, but the demons i confronted with dispersed
zen changes the brain
Carpetsmoker's avatar
15 years ago
link
Carpetsmoker
Martin
I think brains are ``plastic'', but to a limit, it's not like everyone can do anything with the proper upbringing/education/mindset ... There are limits.
Fsmart's avatar
15 years ago
r2, link
Fsmart
cs: sure, theoretically... but how many people face the physical limits of their plasticity or are content with drawing artificial limits because they are afraid of failure?
bluet's avatar
14 years ago
link
bluet
What? :(
lucas's avatar
14 years ago
link
lucas
i ❤ demo
@ what, bt?
bluet's avatar
14 years ago
link
bluet
What's PHP got to do with neuroplasticity?
lucas's avatar
14 years ago
link
lucas
i ❤ demo
it's just the freshie code, that's all.
nny's avatar
14 years ago
link
nny
M̮͈̣̙̰̝̃̿̎̍ͬa͉̭̥͓ț̘ͯ̈́t̬̻͖̰̞͎ͤ̇ ̈̚J̹͎̿̾ȏ̞̫͈y̭̺ͭc̦̹̟̦̭̫͊̿ͩeͥ̌̾̓ͨ
my brain is not made of plastic.
andre's avatar
14 years ago
link
andre
Thread delivers.
Weasley's avatar
14 years ago
link
Weasley
20 x 10 living
The code sucks in the cleanness department.
lucas's avatar
14 years ago
link
lucas
i ❤ demo
do tell why!
Weasley's avatar
14 years ago
r3, link
Weasley
20 x 10 living
<?php
$freshies = new_files();

if (count($freshies) === 0)
{
    echo "<h3>there are no new photos in s3 to import.</h3>\n";
}
else if (count($freshies) > 0)
{
?>
Weasley's avatar
14 years ago
link
Weasley
20 x 10 living
Yeah ^^
asemisldkfj's avatar
14 years ago
link
asemisldkfj
the law is no protection
sometimes you gotta echo stuff that looks crappy in PHP to make pretty HTML.
andre's avatar
14 years ago
link
andre
No need to call count() twice :)
lucas's avatar
14 years ago
link
lucas
i ❤ demo
so weasley has a different bracket coding style and doesn't like indenting html.

andre: i like adding extra cases to grab any errors. that code is followed with this:

<?php

} else {

    echo "            <h3>an error was encountered.</h3>\n";

};

?>php


i suppose i could do this, though:

<?php

$freshies = new_files();

if ($count = count($freshies) === 0) {

    echo "            <h3>there are no new photos in s3 to import.</h3>\n";

} else if ($count > 0) {

?>
[. . .]
<?php

} else {

    echo "            <h3>an error was encountered.</h3>\n";

};

?>


do you prefer that?
andre's avatar
14 years ago
link
andre
$freshies = new_files();
$count = count($freshies);
if ($count === 0) {
   ...
} else if ($count > 0) {
  ...
} else {
  ...
}
andre's avatar
14 years ago
link
andre
Can the "else" condition possibly happen though? Can count() return anything other than non-negative numbers?
lucas's avatar
14 years ago
r2, link
lucas
i ❤ demo
http://php.net/manual/en/function.count.php

no, it can't. i need to make the cases better to handle the case when $freshies is not an array nor object.
bsdlite's avatar
14 years ago
link
bsdlite
thinks darkness is his ally
dude, come on guys: fuck freshies