RE: [PHP] PHP vs JAVA

2013-08-20 Thread Steven Staples
> My recent question was simply an attempt to get documentation to support
> which server-side Web Language is the most popular. Both PHP and Java can
> be used server-side.
> 
> I also realize that Java is used for native Android because I also teach
> Mobile Application Development (MAD -- I even coined the name). So, I am
up
> to my butt in languages (and people who think different than me) -- I'm
> just trying to get documentation to back up my what I think I know.

Well, technically any language can be used server side, it is all on how you
set up your server, no?

I would tend to think that the biggest out there, is html/php/javascript...
and next to that, would be asp, and then java.   Do I have proof of this?
No, can I get proof, I doubt it, and are there stats on this? To be honest,
in my opinion, that would be like asking "how big is the internet?".  It is
virtually an immeasurable object.  There are so many websites out there,
that you can't search them all... 

PHP is simple, and yet powerful to use, and is pretty much the standard for
all hosting companies.

Now, there is this link...
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

It shows Java as #1, and php as #5, but this is also for PROGRAMMING, does
not specify web based programming vs desktop vs MAD (thanks tedd ;) ) so the
numbers do not really speak out in this application.

Does it really matter?   PHP is very huge, widely used, and I would even go
so far as to say the 'norm' for website developers, and hosting providers.

But that is my $0.02, and for me, I have been with PHP for 7 years
professionally, and in college I took VB.net, ASP.net, C++, JAVA and PHP.
Only recently have I gotten into C# for desktop applications.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP]

2013-05-08 Thread Steven Staples
> So you're just lucky I didn't acronymize it as the Pretty House of
> Princesses or something.  And yes, I just made up the word 
> acronymize.  It may be Wednesday, but it feels more like a Friday.
>

Why does this feel like a new function/feature for PHP now?

Function acronymize($acronym)
{
// do stuff here now... :S
}

Steve


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] A relative date puzzle

2013-04-01 Thread Steven Staples
> Thanks for this - I'll experiment and see if I have it.  Basically I never
> read the strtotime doc close enough to get past the word "now" in the
> syntax.  Obviously it is EXACTLY what I needed.

$var = strtotime('now');

Is the same as

$var = time();

Unless of course, I didn't understand what you're referring too :P

But strtotime() is a very useful function, unless of course you want the OO
stuff ;)


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Date weirdness

2013-03-28 Thread Steven Staples
> I think I am losing my mind. I have some time zone converting code, and I
> just don't understand what I am seeing. Also my system seems to return the
> wrong time after I do some date operations on unrelated objects.
> 
> This is from a machine that is in eastern time. I want to convert to, for
> example central time:
> 
> $ndate = new Date(date("Y-m-d H:i:s"));
> echo $ndate->format("%Y-%m-%d %H:%M:%S");
> 2013-03-28 15:35:07  <- this is the correct time
> 
> $ndate->setTZbyID("EDT");
> echo $ndate->format("%Y-%m-%d %H:%M:%S");
> 2013-03-28 15:35:07 <- still correct
> 
> $ndate->convertTZbyID("US/Central");
> echo $ndate->format("%Y-%m-%d %H:%M:%S");
> 2013-03-28 10:35:07 <- this is wrong it should be 14:35:07
> 
> $xdate = new Date(date("Y-m-d H:i:s"));
> echo $xdate->format("%Y-%m-%d %H:%M:%S");
> 2013-03-28 19:35:07 <- HUH? This is wrong - should be 15:35:07
> 
> What in the world is going on here?
> 

I found this function a while back when I was converting UTC to EST... simple 
task I know, but still...

( I am sorry to whomever wrote this, I didn't keep the source where I found it )

function convert_time_zone($date_time, $from_tz = 'UTC', $to_tz = 
'America/Toronto')
{
$time_object = new DateTime($date_time, new DateTimeZone($from_tz));
$time_object->setTimezone(new DateTimeZone($to_tz));
return $time_object->format('Y-m-d H:i:s');
}

Maybe this can help you?

Steve 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Sorry bout that...

2012-12-21 Thread Steven Staples
> You couldn't prove that by me -- I'll ask my wife. She knows everything.
> 
> Cheers,
> 
> tedd

And this will be the last we hear of Tedd... LOL


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Sorry bout that...

2012-12-21 Thread Steven Staples
I would like to let everyone know that the world didn't end this morning
like it was supposed too.

 

Sorry, carry on about your business.

 

And HAPPY FRIDAY!!!

 

Steven Staples



RE: [PHP] foreach

2012-10-16 Thread Steven Staples
> -Original Message-
> From: Matijn Woudt [mailto:tijn...@gmail.com]
> Steve,
> 
> Please watch your language on this list.
> 
> - Matijn
> 

My apologies, I guess using $foo == $bar would have been a better choice... I 
forget sometimes, I am used to chatting with my close friends, where stuff like 
that is pretty tame.

I meant no disrespect to anyone.

Steve Staples.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] foreach

2012-10-16 Thread Steven Staples
> Here's what I ended up with after you gave me the advise:
> $result = mysql_query("SELECT * FROM items");
>   $rows = array();
>   while($row = mysql_fetch_array($result))
>$rows[] = $row;
>   foreach($rows as $row){
>   $product = $row['product'];
>   $price = $row['price'];
> echo "$product ";
> echo "$price ";
> 
> 
> $justright = 0;
> $toohigh = 5; //I was going to use this to check if the price was too
> high
>   just so I could use an elseif in the
exercise, but
> I realized that
>   it would only work if the if() evaluated to
false,
> which would be
>   impossible. Ahhh pizz on it, it was fun
anyway! :-
> )
> 
> if($justright <= $price){
>  echo "Not bad. I'll buy it.";
>   } else
>  echo "Too expensive I'm going home LOL ";
> 
>   }
> 
> It's a dumb script that makes no sense but I had a blast doing this. When
> things start coming together like this, it gets so gratifying. :-)
> 
>  --
> David M.


David, 

Just putting this out there, but the use of a foreach() loop here, is
redundant...
You are putting your query results into an array, and then looping through
them after with the foreach(), instead of just using the while loop to loop
through them initially... so you're doing the same thing, twice, just using
the foreach() after the while.

One thing I was always told when I was learning c++ (my teacher was anal,
and always forced us to try and be more efficient), using >= uses more cpu
cycles, than > or <, so when you're checking 0 <= 0.1 true, false, you could
exchange your check to be 0 > 0.1 false, else true...

Also, setting the variable $product and $price, with the value from the
database $row['product'], would be less cycles than to just echo the
$row['product']...

That is just some $0.02...  I wouldn't personally create more code, just to
"try" something out... use the right function for the job, write less code
than needed (sometimes, a little more code for readability is better
though), and most importantly... have fun.

One thing I do, is my coding and bracing style is something that Tedd
Sperling doesn't like (there have been many discussions about bracing
styles),  I keep my braces all in line, and always use them in my if()s...
ie:
If($yourmom == $hot)
{
Echo "MILF!";
}
Else
{
Echo "Pass.";
}

And I do this for readability, so I can see if I forgot a brace somewhere,
and also, I always know that there are braces (with a 4space indentation, or
tab stops set at 4 space)

1 more point, doing multiline comments, use /*  insert comment here */  and
not just //, and with that, I use inline comments with #,  but that is just
me.

Overall though, I am glad to see you're learning, and having fun doing so...


Steve Staples.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Friday - Return of Brain Teasers

2012-10-05 Thread Steven Staples
> Subject: [PHP] Friday - Return of Brain Teasers
> 
> About five-and-a-half years ago, we had a brainteasers thread going
> on[1].  Last year it was briefly resurrected[2], and both times got some
> good content and dialogue going.  So I'd like to reprise the thread in
> 2012, as well.  Those of you connected to me on Facebook
> (parasane) or Twitter (@oidk) might already have seen it, but a simple one
> to get things rolling:
> 
> 
> 

Is this supposed to execute to anything?

I got this:

Warning: require(1) [function.require]: failed to open stream: No such file
or directory in C:\xampp\htdocs\cowbell.php on line 1

Fatal error: require() [function.require]: Failed opening required '1'
(include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\cowbell.php on line
1


--  I do know what it means, just thought maybe there was something more
significant to it than this...  
"Guess what? I got a fever. And the only prescription...is more cow bell"


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Programmers and developers needed

2012-09-13 Thread Steven Staples
> From: Tim Dunphy [mailto:bluethu...@gmail.com]
> Sent: September 13, 2012 7:26 AM
>
> > We are looking for programmers and developers to create a world wide
> system.
> 
> Is it bigger than a bread box?

Will it blend?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] What's happened to our newsgroup?

2012-06-26 Thread Steven Staples

> -Original Message-
> From: Govinda [mailto:govinda.webdnat...@gmail.com]
> Sent: June 26, 2012 3:25 PM
> To: PHP-General List
> Subject: Re: [PHP] What's happened to our newsgroup?
> 
> 
> > No postings for days.
> 
> everyone RTFM?
> :-)
> 
> 

Maybe they joined the British mailing list?


Steven Staples


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: Function size

2012-05-30 Thread Steven Staples
> Paul,
> 
> Are you stating here that compression is a bad thing?
> 
> That means you consider this nice:
> 
> if ( action == A )
> {
> doA();
> }
> else if (action == B )
> {
> doB();
> }
> else
> {
> doC();
> }
> 
> Or perhaps flooded with comments that merely say the same as the code does?
> 
> I'd go for
> if(action == A)
> doA();
> else if(action == B)
> doB();
> else
> doC();
> 
> or , if it's really that clean, i'd probably go for if(action == A)  doA();
> else if(action == B)  doB(); else doC();
> 
> - Matijn

How about this:

($action == 1? doA():($action == 2? doB(): doC()));



Steve.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Function size

2012-05-24 Thread Steven Staples
> 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.
> 
> --

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.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] SqLite INSERT want not write

2012-04-19 Thread Steven Staples
> -Original Message-
> From: siefke_lis...@web.de [mailto:siefke_lis...@web.de]
> Sent: April 19, 2012 3:40 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] SqLite INSERT want not write
> 
>   Hello,
> 
> On Thu, 19 Apr 2012 15:17:06 -0400
> "Steven Staples"  wrote:
> 
> > Ok, so I was wrong... ;)   it does happen
> >
> > Try this:
> > $sql = "INSERT INTO bloggen (date, autor, title, teaser, content)
> >VALUES ('" . date('Y-m-d H:i:s') . "', :autor, :title,
> > :teaser, :content);";
> 
> No errors, but no entry in the database.
> 
> 
> > Or
> > $sql = "INSERT INTO bloggen (date, autor, title, teaser, content)
> >VALUES (NOW(), :autor, :title, :teaser, :content);";
> 
> 
> PDOException: SQLSTATE[HY000]: General error: 1 no such function: NOW
> 
> Now is not availible in Sqlite, can use date,
> 
> Which rights must have the database?
> 
> siefke@gentoo-desk db $ ls -l
> insgesamt 4
> -rw-rw-rw- 1 siefke siefke 4096 19. Apr 21:25 silviosiefke.db
> 
> 
> Regards
> Silvio
> 


Ok, shot in the dark here   are you closing your connection to the
sqlite db?   From what I see, you're not... when I was writing an app in
Python, I remember having this issue, and because I didn't close the
connection, it didn't commit the writes to the database...   just a
thought...

Steve.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] SqLite INSERT want not write

2012-04-19 Thread Steven Staples
> -Original Message-
> From: Silvio Siefke [mailto:siefke_lis...@web.de]
> Sent: April 19, 2012 3:11 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] SqLite INSERT want not write
> 
> On Thu, 19 Apr 2012 14:57:04 -0400
> "Steven Staples"  wrote:
> 
> > I think all you had to do was change this line: (line 27 in the
> > original
> > paste)
> > $sql = 'INSERT INTO bloggen (date, autor, title, teaser, content)
> >   VALUES ('' . date( 'Y-m-s H:i:s', time() ) . '', :autor, :title,
> > :teaser, :content);';
> >
> > To this:
> > $sql = "INSERT INTO bloggen (date, autor, title, teaser, content)
> >   VALUES ('' . date( 'Y-m-s H:i:s', time() ) . '', :autor, :title,
> > :teaser, :content);";
> 
> Thats end with:
> PDOException: SQLSTATE[HY000]: General error: 1 near "(": syntax error
> 
> I has changed what say Stuart, no Sytax errors but in the database nothing
> will write.
> 
> Regards
> Silvio
> 

Ok, so I was wrong... ;)   it does happen

Try this:
$sql = "INSERT INTO bloggen (date, autor, title, teaser, content)
   VALUES ('" . date('Y-m-d H:i:s') . "', :autor, :title, 
 :teaser, :content);";

Or
$sql = "INSERT INTO bloggen (date, autor, title, teaser, content)
   VALUES (NOW(), :autor, :title, :teaser, :content);";


The first example, you don't need the time(), and you had the date format
wrong...
The second example, uses the NOW() time, which is the timestamp for sql

Maybe this time I will get it right ;) -- its been a long day, and it is
only 1/2 done

Steve


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] SqLite INSERT want not write

2012-04-19 Thread Steven Staples
> -Original Message-
> From: Silvio Siefke [mailto:siefke_lis...@web.de]
> Sent: April 19, 2012 2:53 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] SqLite INSERT want not write
> 
> Hello,
> 
> On Thu, 19 Apr 2012 13:21:46 -0500
> tamouse mailing lists  wrote:
> 
> > Maybe this will make the syntax errors stand out more:
> >
> > http://dl.dropbox.com/u/571329/Screenshots/Picture%209.png
> 
> 
> ok i have change it to the function date, but now i has the error
> message:
> 
> PDOException: SQLSTATE[HY000]: General error: 1 SQL logic error or missing
> database
> 
> The database is present, and the tables too.
> 
> gentoo-desk db # ls
> silviosiefke.db
> gentoo-desk db # pwd
> /var/www/silviosiefke_de/inc/db
> 
> gentoo-desk ~ # php -l test.php
> No syntax errors detected in test.php
> 
> The script now -> http://nopaste.info/63fe0a9148.html
> 
> Regards
> Silvio


I think all you had to do was change this line: (line 27 in the original
paste)
$sql = 'INSERT INTO bloggen (date, autor, title, teaser, content)
  VALUES ('' . date( 'Y-m-s H:i:s', time() ) . '', :autor, :title,
:teaser, :content);';

To this:
$sql = "INSERT INTO bloggen (date, autor, title, teaser, content)
  VALUES ('' . date( 'Y-m-s H:i:s', time() ) . '', :autor, :title,
:teaser, :content);";


The issue was (without looking any deeper) the quotes...

Try that, and let us know.

Steve


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: Email Antispam

2012-04-17 Thread Steven Staples
> -Original Message-
> From: Jim Giner [mailto:jim.gi...@albanyhandball.com]
> Sent: April 17, 2012 4:33 PM
> To: php-general@lists.php.net
> Subject: [PHP] Re: Email Antispam
> 
> 
> "David Mehler"  wrote in message
> news:CAPORhP5Cuzd0Hb9gBFLESNe5LofDODN64S2UOAuMWCb=zoh...@mail.gmail.com...
> > Hello,
> >
> > I'm working on a site that has email addresses on it. I am not wanting
> > to use mailto links so as to avoid spam harvesters, I'd like another
> > solution so that mailto links would work but would not work with
> > spammers. I've tried several javascript-based solutions, but am not
> > able to get them to be consistent. It seems like once they're used
> > they revert to coded links. If anyone has any solutions I'd appreciate
> > it. I'm not sure I can do this in php, generate email addresses
> > dynamically then pass them to the client, it would be the same as the
> > spammer hitting the page. I'd prefer something self-hosted and
> > preferably light on the resources.
> >
> > Thanks.
> > Dave.
> 
> Why not just put the contact's name/info on screen and then use the
> database behind it all to go get the email address and build the mail?
> Assuming that the site is using a db to hold these addresses already.
> 

What about using an AJAX call onclick to pull the email address?  Or nesting
ajax calls to hide it more gooder :P

Just thoughts, as I never (almost never) use mailto: tags, and build my own
contact form.

Steve


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: php in windows

2012-04-16 Thread Steven Staples
> -Original Message-
> From: Kirk Bailey [mailto:kbai...@howlermonkey.net]
> Sent: April 11, 2012 10:11 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Re: php in windows
> 
> Steve, THERE IS NO SUCH FILE in tinyweb. It turns to the operating system
> asspciations to determine what to use to process the cgi, then captures
the
> returned stdio output and feeds THAT back as part of the data stream back
> down the stack. Therefore, it is not interfacing with the windows
operating
> system properly, and as I do not speak delphi, I am not sure how to go
> through the sourcecode and rectify this.
> If you like, I cna provide a link to the installer that adds it to a
> windows computer so you can take a look- if you or anyone else is
> interested. Oddly enough, it appears to handle python fine, and is
reported
> by others to also handle perl.
> > Kirk,
> >
> > You have to tell your "tinyweb" what to do with the .php extensions...
> > in the config of the webserver, you will have to add a line saying
> > where the php binary is, or uncomment it (as it probably already
> > exists) and restart the webserver.
> >
> >
> > As it appears to me, since you can have some "code" on the screen,
> > your server does not know how to deal with it, so it will treat it like
a
> text
> > file, and just spew the code out.   Once you have it pointing to the php
> > binary, it will work.
> >
> > Good luck!
> >
> > Steve Staples.
> >
> >

Sorry, I have been out of the office for the last few days... have you
gotten this to work?

As a suggestion, is PHP in the windows path?   If not, then this may be the
issue... Python may have been installed, and put the exe in the PATH
variable, where PHP may not have done it (not sure, I personally use XAMPP
on my windows box for quick development)

Check the PATH from the dos prompt, and if it is not in there, then you will
have to add it (I am just guessing here)

Just in case you're not sure where it is, on my XP machine, I just right
click on "My Computer", click "Properties" and then on the "Advanced" tab,
there is a button labelled "Environment Variables" and then add the path to
the PHP exe...

Hope that this helps!

 
Steven Staples


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: php in windows

2012-04-11 Thread Steven Staples
> -Original Message-
> From: Kirk Bailey [mailto:kbai...@howlermonkey.net]
> Sent: April 11, 2012 1:02 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Re: php in windows
> 
> ok, there is a copy of index.php ion the cgibin, and this got WAY
different
> results.
> It puked an error.
> 
> 
>   "CGI script /cgi-bin/index.php returned nothing"
> 
> NOW W.T.F., over?
> I think that it's time for some rack time. 'Night all.
> 
> 
> On 4/11/2012 12:50 AM, Kirk Bailey wrote:
> > ok, I just installed 5.2.17 VC6X86. I have a simple test page,
> > index.php; it spews the content code at me.
> >
> > On 4/10/2012 11:13 AM, Bogdan Ribic wrote:
> >> On 4/10/2012 04:05, Kirk Bailey wrote:
> >>> The edition of php for windows I instaklled does not work. Which
> >>> flavor
> >>> of windows php DOES work properly in windows?
> >>
> >> Trust me, it does work :)
> >>
> >> I'm running PHP 5.3.10 thread-safe, as apache module on apache
> >> 2.4.1 from apache lounge (not official apache builds, as
> >> instructed on PHP's download site), all of that on Win XP. Read
> >> the instruction in php bundle on setting it up with apache 2.2
> >> branch.
> >>
> >

Kirk,

You have to tell your "tinyweb" what to do with the .php extensions... in
the config of the webserver, you will have to add a line saying where the
php binary is, or uncomment it (as it probably already exists) and restart
the webserver.


As it appears to me, since you can have some "code" on the screen, your
server does not know how to deal with it, so it will treat it like a text
file, and just spew the code out.   Once you have it pointing to the php
binary, it will work.

Good luck!

Steve Staples.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: Got HTML5 History API + caching LICKED, I think,

2012-03-23 Thread Steven Staples
> -Original Message-
> From: rene7705 [mailto:rene7...@gmail.com]
> Sent: March 23, 2012 7:40 AM
> To: php-general
> Subject: Re: [PHP] Re: Got HTML5 History API + caching LICKED, I think,
> 
> 
> On Fri, Mar 23, 2012 at 12:39 PM, rene7705  wrote:
> 
> >
> >
> > On Fri, Mar 23, 2012 at 12:38 PM, rene7705  wrote:
> >
> >>
> >>
> >> On Fri, Mar 23, 2012 at 10:02 AM, rene7705  wrote:
> >>
> >>> Because some of you complained about the byte size of my homepage
> >>> http://mediabeez.ws (was 2.5mb due to artwork), I've invested some
time
> >>> in shaving off quite a few bytes;
> >>>
> >>> I've discovered that by using photoshop to reduce the animation image
> >>> color depth to "indexed color, 217 color", I can get the animation
> image
> >>> file size down to less than 50% of the original that was output by my
> >>> spriteGenerator-1.0.0
> >>>
> >>> And you hardly notice the difference at all :)
> >>>
> >>> I'm going to update http://mediabeez.ws later today, hopefully after I
> >>> find a way to do this with imagemagick, which my spriteGenerator uses.
> >>>
> >>> And since I also use half the frames for my site logo of
> >>> http://mediabeez.ws, that animation file is now 297kb, down from 2mb.
> >>>
> >>>
> >>> Ok, http://mediabeez.ws and the download zip there are now updated.
> >> On devices with less than 400 pixels wide screen, the total size for
the
> >> homepage is now 61kb.
> >> On devices with more than 400 pixels wide screen, it's 910kb, due to
> more
> >> artwork being loaded.
> >>
> >> I take it that takes care of the "it's too friggin' large!" critiques
;)
> >>
> >
> > I'd REALLY appreciate if you can load up http://mediabeez.ws on your
> > mobile phone and tell me
> > - if it works (if it doesn't, you'll keep staring at a white screen)
> > - your phone model and type
> >
> >
> > As a last note, do NOT load up the buttons demo page if you have to pay
> for bandwidth, as that page loads up 10mb of artwork still.
> 

My pet peeve with this, is that it takes at least 5 seconds before anything
displays on the page.  It almost makes me think the site is down.  If you
had a "loading content" or something (even though that bugs a lot of
people), then it would at least make me think that there is nothing wrong
with your site... (or maybe speed up your code somehow).

Also, the menu dropdowns, I find awkward.   Visually, they don't look
pleasing to me.  There is too much space between them, and the way they
overlap when you have more than 1 level in them, (personally) bugs me.

I also loaded this on my cell phone, LG Optimus One, running Android 2.3,
and it loaded up ok (same slowness), but the menus are VERY slow, and VERY
hard to use unless I zoom right in.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Printing

2012-01-05 Thread Steven Staples
If I am not mistaken, that is only for printing ON the SERVER... not on the
client.   If you're printing, then you're trying to print to a locally
connected printer on your server.

PHP runs server side, and therefore doesn't know anything about your locally
attached printers.


I did notice that you started a new thread about printing from PDF's, and if
you're trying to create a document to print on your client machine, then
creating a PDF is much easier.

http://fpdf.org


Steven Staples


> -Original Message-
> From: Jim Giner [mailto:jim.gi...@albanyhandball.com]
> Sent: January 5, 2012 10:55 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Printing
> 
> >
> 
> I can't tell you much on this, because I don't use windows. You have
> to get the source at http://pecl.php.net/printer and compile it. I
> don't know the procedure, etc.
> 
> --
> Nilesh Govindarajan
> http://nileshgr.com
> 
> That was a short trip.  Clicked on the link for documentation and it takes
> me right back to the php manual pages that I'd already read.  Clicked on
> the
> link to download the latest and it's a dead link.
> 
> Does anyone print from their php websites??
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2012.0.1901 / Virus Database: 2109/4724 - Release Date: 01/05/12


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Sniping on the List

2011-11-18 Thread Steven Staples
> -Original Message-
> From: Fredric L. Rice [mailto:fr...@sonic.net]
> Sent: November 17, 2011 6:25 PM
> To: Stuart Dallas
> Cc: Tedd Sperling; PHP List
> Subject: Re: [PHP] Sniping on the List
> 
> >> Consider this -- do you think the second before
> >> the "Big Bang" was negative or null?
> > I don't know. There's no point concerning ourselves
> > with unanswerable questions.
> 
> The question itself is a logical absurdity since there was no time prior
> to the Big Bang. The advent of time began when the dimention we perceive
> as the passage of time froze out of folded reality during the expansion
> phases's symmertry breaking period, there is not only no answer to what
> happened before, even suggesting there *was* a before is not possible.
> 
> It's another nail in the coffin of deity constructors.

And here I thought that "The Big Bang Theory" was a funny sitcom?  Damn...
where have I been all this time?   Maybe since I wasn't around to witness it
happening, it didn't really happen, and this is just my own reality, that
you guys happen to be a part of, in my subconscious?

Besides, are we not just all part of "The Matrix" ?   (what's even more
funny, is that I drive a Toyota Matrix... WEIRD)

Steven Staples
Web Application Programmer


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Sniping on the List

2011-11-15 Thread Steven Staples
> -Original Message-
> From: Tamara Temple [mailto:tamouse.li...@tamaratemple.com]
> Sent: November 15, 2011 1:33 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Sniping on the List
> 
> On Tue, 15 Nov 2011 12:24:17 -0600, tamouse mailing lists
>  sent:
> > On Tue, Nov 15, 2011 at 12:12 PM, Tedd Sperling
> >  wrote:
> >> PS: I know it's not Friday, but this question came up in class
> >> yesterday and I thought maybe all of you might like to guess why
> >> null is Wednesday?
> >
> > Wait.. What??
> >
> > $ php -r 'echo date("l",NULL),"\n";'
> > Wednesday
> >
> > Cos:
> >
> > $ php -r 'echo date("r",NULL),"\n";'
> > Wed, 31 Dec 1969 18:00:00 -0600
> >
> > (Personally, I would have thought Thursday should be NULL, but that's
> > just me. And Thursday.)
> 
> Actually, It *is* Thursday if you use UTC:
> 
> $ TZ=UTC php -r 'echo date("r",NULL),"\n";'
> Thu, 01 Jan 1970 00:00:00 +
> 
> :P

Perfect example of Tedd's last comment about being proven wrong (even though 
TECHNICALLY it isn't)

Good job :)


Steven Staples
Web Application Programmer




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Web application architecture (subdomain vs. sub directory)

2010-08-25 Thread Steven Staples
I started out not using a framework... then I started at a company who used a 
"zend" like framework, worked there for a bit, then moved on, and started using 
cake... 

I found that they were great for what they are... but really simplified things 
too much, so I created my own framework, incorporating the classes that I use 
all the time (smarty/fpdf/jquery/tinymce), and with that, I learned a LOT about 
how things really worked.

I would suggest looking at the core of the frameworks to see how things are put 
together, and how they really work... but maybe make one that is more custom to 
your application?

As for subdomain vs subdirectory, if your using SSL, then you would need a 
wildcard SSL which is usually more money.  Eitherway you choose, you will have 
to program around it.  The app that I created uses subdomains, because we were 
using CA SSL Certs, and the clients preferred to have their own IP's... long 
story, not my call, I just program it :P


Steven Staples


> -Original Message-
> From: Peter Lind [mailto:peter.e.l...@gmail.com]
> Sent: August 25, 2010 3:01 PM
> To: a...@ashleysheridan.co.uk
> Cc: Tim Martens; php-general@lists.php.net
> Subject: Re: [PHP] Web application architecture (subdomain vs. sub
> directory)
> 
> On 25 August 2010 20:54, Ashley Sheridan  wrote:
> > On Wed, 2010-08-25 at 13:45 -0500, Tim Martens wrote:
> >
> > If you're new to PHP, I would recommend not using a framework for the
> > experience you will gain with the language, as a framework will tend to
> > hide away certain caveats and peculiarities of PHP which could lead to
> > issues further down the line. Most people I know who are great PHP
> > programmers have tended to start without frameworks at first.
> >
> > Having said that, if you're looking for a rapid deployment with a
> > shorter learning curve, then a framework might be better in this
> > situation.
> >
> 
> You could also argue that using a framework is more likely to promote
> good habits, as there's a bigger chance you'll be forced down good
> paths.
> 
> Regards
> Peter
> 
> --
> 
> WWW: http://plphp.dk / http://plind.dk
> LinkedIn: http://www.linkedin.com/in/plind
> BeWelcome/Couchsurfing: Fake51
> Twitter: http://twitter.com/kafe15
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.851 / Virus Database: 271.1.1/3089 - Release Date: 08/25/10
> 02:34:00


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Unstoppable Script Execution

2010-08-25 Thread Steven Staples
Ok, this is my first post here.  I have been writing in PHP for about 7
years or so now, I am not an expert, but I do pretend to be one :P

ANYWAY, my client and I have been working on a strange issue that I cannot
seem to pin point, or replicate, not to mention, it has no rhyme or reason
for it to happen except if maybe the user submits a form, and their internet
connection "hiccups" or the script terminates.

Some times, the submitted form can have probably more information than it
should, and the script is doing more than it should, so the execution time
may take upwards of a few seconds to a minute or so.

My question is, is the function/setting:
Ignore_user_abort(true);
Going to possibly fix my issue?

Could I combine that with:
Ignore_user_abort(true);
Set_time_limit(900); # 15 minutes, JUST INCASE of a problem!

So that if after 15 minutes, if the script has gone CRAZY, it will at least
not run forever?

Any help?  Ideas?  Is this a good idea?

Steven Staples




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php