Re: [PHP] Software to read/write Excel to CD?

2009-05-14 Thread Matt Graham
Ashley Sheridan wrote:
> Paul M Foster wrote:
>> On Thu, May 14, 2009 at 03:22:12PM -0500, Skip Evans wrote:
>>> One of the things the other company said was possible, and I'm
>>> not familiar with... if I understand correctly, is to create a
>>> CD with not just an Excel spreadsheet, but software on that CD
>>> that when placed in another computer will open the
>>> spreadsheet, allow it to be modified and rewritten back to the CD.

It has to be a CD-RW, the CD-RW has to be in UDF format, and the host
machine has to be able to read and rewrite CD-RWs in UDF.  This is
actually not that tough to arrange--it just has nothing to do with
PHP.  'DozeXP should be able to do this, and Linux will do this if the
right kernel options are on.  Don't know about OS X.

>> Second, include some other program which
>> would do the same thing. Good luck with that.

OOO Calc, which should be just fine for basic tasks and is Free.

>> And now the kicker-- write the spreadsheet back to CD. Okay, maybe, if
>> it's a CD-RW. But who's going to pay attention to that little detail?
>> And as far as I know, writing to a CD is far more complicated than
>> writing to a hard drive. You can't overwrite data on a CD-RW.

UDF, which has been a standard for quite some time, allows this.  The
main thing you lose is some space on the CD-RW.

>I've never heard of anything like that, there are so many unknown
>variables that I would really feel for the poor team who had to take
>that project on!

It sounds like whoever defined the requirements was trying to solve a
problem in the wrong way.  Why drag physical media into this when you
have the Net available?  And if the clients don't have the Net
available, *why not*?

-- 
Matt G / Dances With Crows
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see



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



RE: [PHP] Pros/Cons of using mysqli prepared statments

2010-11-04 Thread Matt Graham
"Jay Blanchard"  didst scribe:
> using stored procedures has a lot of advantages. If you need to
> change your SQL you can do it in one spot. It reinforces MVS or
> modular coding behavior, the SP becomes very re-usable. Security
> is improved. Performance can be improved. You can put the bulk of
> the data handling on the database where it really belongs because
> SP's can perform complex operations complete with control
> structures. Lastly it simplifies your PHP code.

Just don't go too far.  Years and years ago, I worked on a project where there
were about 100 stored procedures, many of which were 200-300 lines long, many
of which called other stored procedures which called other stored procedures. 
These procedures were frequently modified.  Attempting to debug this can of
worms full of Pandora's boxes was like pulling hen's teeth.  The initial idea
was for the app to do almost nothing but call stored procedures and display
results; this caused a number of problems which were ignored or solved badly.

(I'd almost forgotten that horrible mess where I had no input on anything
design-related, thank you for reminding me)

-- 
Matt G / Dances With Crows
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see


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



Re: [PHP] code quest

2010-12-04 Thread Matt Graham
From: Kirk Bailey 
> OK, now here's a giggle; I like ssi includes. If I put the script
> in as an ssi include, will it still work?

If you're using Apache, and you do



...the PHP in something.php will execute and produce output, but
something.php will not have any access to $_GET or $_POST or $_SESSION or any
of those things.  This is generally not what you want.  If you do



...then something.php will be able to see and work with the superglobals that
have been set up further up the page, which is *usually* what you want.  You
could try both approaches in a test env and see what you get.  I'll use SSI
for "dumb" blocks of text and php include for "smart" blocks of code, because
IME that tends to produce fewer instances of gross stupidity.

Note that YMMV on all this and ICBW.

-- 
Matt G / Dances With Crows
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see


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



Re: [PHP] File moving hell on Windows

2012-07-31 Thread Matt Graham
Mike Mackintosh wrote:
>> What protocol are you targeting? FTP, SFTP, SSH, SMB, etc? 
From: Brian Dunning 
> Regular Windows networking.

If you're using a 'Doze box, and you want to use PHP functions like rename(),
then IIRC the only real option that you have is to do something like:

system("net use m: \\BORG\SHARE PASSWORD /user:DOMAIN\USER");
system("net use n: \\MACHINE\SHARE2 PASSWORD2 /user:DOMAIN2\USER2");
rename("n:/path/to/file","m:/path/to/otherfile");
/* more stuff */
system("net use n: \\MACHINE\SHARE2 /delete");
// equivalent of "umount //machine/share2"

However, there may be a better/easier/more elegant way to do these things. 
Not sure; our PHP-running machines are all running Linux.

-- 
Matt G / Dances With Crows
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see


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



[PHP] Re: Creating an Advanced Form

2012-11-02 Thread Matt Graham
Jonathan Davies  wrote:
> I am attempting to create an advanced form with 9 different search
> fields.  I am [concatenating a bunch of bits together] so I don't
> have to [create] over 300,000 IF statements.
> mysql_fetch_assoc(): supplied argument is not a valid MySQL
> result resource on line 261
> I cannot seem to hit the nail on the [head] to why it [doesn't] work. 
[snip code]

When you see that particular error message, you should print the query you're
executing, or log it, or something.  If you have more than 1 field set, it
looks like you'd be doing something like:

$q =  "select stuff1 ... order by blah1";
$q += "select stuff2 ... order by blah2";

...which gives you "select stuff1 ... order by blah1select stuff2" , which is
bad SQL syntax, which explains the error you're getting.  I am not sure
whether putting another space at the end of each substring would help, but
that's the first thing I'd try.

(I'm sure other people will say "OMGPANIC procedural code!  OH NOES, using
mysql_* functions!  Unclean!  Unclean!  AH!", so be prepared for that
too)

-- 
Matt G / Dances With Crows
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see


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



[PHP] Re: mcrypt_create_iv - why so slow?

2013-05-31 Thread Matt Graham
From: Nathan Nobbe
> Interesting, using MCRYPT_DEV_URANDOM instead of MCRYPT_DEV_RANDOM
> seems practically instantaneous. Still [raises] the question though,
> any idea what's holding up the show w/ MCRYPT_DEV_RANDOM?

/dev/random is a high quality entropy source and requires more time to
generate output, as it has to retrieve random stuff from keyboard interrupts,
mouse interrupts, and other sources, and make sure it's got *really* random
bits.  /dev/urandom will just throw out a pile of pseudo-random bits of
potentially lower quality immediately.  You can see that by doing "time dd
if=/dev/random of=/dev/null bs=16k count=5" and repeating the same command
with /dev/urandom.  1.312 seconds vs. 0.019 seconds here.

Not much to do with PHP, though, just the way the Linux kernel people did
things.  /dev/urandom is probably the way to go for most normal random data
needs.

-- 
Matt G / Dances With Crows
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see


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



[PHP] Re: postgresql database access failure

2011-05-02 Thread Matt Graham
Florin Jurcovici wrote:
> My personal recommendation, however, is to drop old-style procedural
> drivers and switch to PDO - it's much more convenient to use, IMO.

Just be careful.  PDO's implementation of MySQL doesn't implement the
mysql_set_charset() function, or at least it didn't a while back according to
my reading the PDO source.  Setting a charset in the DSN was possible, but PDO
didn't *do* anything with that setting.  There are probably other minor holes
out there.  ("Everything in these tables is UTF-8!"  "Are you *sure* about
that?  It looks a lot like CP-1252 here, and here, and here")

> you use PDO, you don't need to study the API of various different DB
> drivers, and your code can easily switch from one database to another.

This is true to some extent.  There are probably a few odd cases where the
native functions do more, or do it better than whatever the latest and
greatest layer of abstraction does.

-- 
Matt G / Dances With Crows
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see


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



Re: [PHP] Code should be selv-maintaining!

2011-08-30 Thread Matt Graham
From:  David Harkness 
> I don't always use braces, but when I do I use Compact Control Readability
> style. Stay coding, my friends.

...and when you use CCR style, you can sing, "I see a bad brace a-risin'"?

-- 
Matt G / Dances With Crows
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see


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



[PHP] re: More Error Reporting Problems

2011-12-30 Thread Matt Graham
From: Floyd Resler 
> I'm still  having problems with error reporting and I'm not sure why.
> php.ini section:
> error_reporting = E_ALL & ~E_DEPRECATED
> display_errors = On
> log_errors = On
> error_log = /var/log/php_errors.log

> Errors are neither getting displayed nor recorded in my error log. 

Check that /var/log/php_errors.log exists and that the user that your
webserver is running as has permission to write to that file.  "touch
/var/log/php_errors.log && chown apache:apache /var/log/php_errors.log" as
root may work; modify user/group if necessary.  /var/log is always owned by
root and is 755, meaning that the webserver user doesn't have permission to
create that file if it doesn't exist.

-- 
Matt G / Dances With Crows
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see


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



[PHP] rfc822_write_address() / CVE-2008-2829 problem

2008-07-07 Thread Matt Graham
Hello, list.  A few days ago, a security scan said that our machines 
that were running PHP had potential vulnerability CVE-2008-2829 , a
buffer overflow in rfc822_write_address().  Discussions about this 
are relatively easy to find with Google, but check out
http://bugs.php.net/bug.php?id=42862 for a reasonable discussion and
an (unofficial) patch.

I'm just curious as to what other PHP users are doing about the problem,
since Redhat says "meh" even though the company doing the security
scan says "OMG PANIC!!1!"  Let me know what you guys think.  Thanks,

-- 
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see



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



[PHP] Re: rfc822_write_address() / CVE-2008-2829 problem

2008-07-07 Thread Matt Graham

From: "M. Sokolewicz" <[EMAIL PROTECTED]>
> Matt Graham wrote:
>> PHP had potential vulnerability CVE-2008-2829
>> http://bugs.php.net/bug.php?id=42862 for a reasonable discussion and
>> an (unofficial) patch.
>> 
>> I'm just curious as to what other PHP users are doing about the problem,
>> since Redhat says "meh" even though the company doing the security
>> scan says "OMG PANIC!!1!"
> it's doesn't look that dangerous to me, I'd personally rather side with 
> Redhat in their "meh" than with the security-scan-company's "OMG 
> PANIC!!1!".

This is what I thought.  However, they would rather believe the security 
scan company for some reason.

> If you want the patch to appear in the next version of PHP 
> (5.2.3), make some noise about it on the internals list.

?  I thought they were up to 5.2.6

> it hasn't been applied until one of the devs gets so annoyed with you 
> spamming him with it that he'll either apply it (thus getting it into 
> the next release) or tell you what's wrong with it so you'll finally 
> leave him alone. A simple solution :)

Yep.  I prefer to avoid annoying and spamming developers, though :-]

> P.S. note: the potential vulnerability only occurs if you actually use 
> the imap functions. If you don't: don't worry, you're still "safe".

Aye.  However, I mangled the source and compiled a version of PHP 5.2.6
such that the IMAP stuff wasn't even compiled, then installed that
mangled version on a test box.  The security scan company then scanned
that test box, and said, "Problem CVE-2008-2829 still exists." I do
wonder what they're doing when they're scanning

-- 
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see


> 




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



[PHP] PHP job available, Phoenix, AZ, USA

2008-10-02 Thread Matt Graham
I just saw this.  If someone is in the Phoenix, AZ, USA area and wants a job 
writing/maintaining PHP code, this may be right for you.  Contact details 
below:

---
azcentral.com, Arizona's leading online source for up to date news and
information, is seeking a Senior Online Developer to join our highly
successful team!

On a day to day basis, this individual will be responsible for providing
Web-based technology solutions that support the objectives and mission of
azcentral.com, a Gannett property.  Participates in the creation and ongoing
support of software applications, tools and technologies to enhance the
development and growth of Digital Media services running in a Linux, Apache,
MySQL, and PHP environment.  Participates in cross-functional and/or
cross-unit IT projects. Works in a team environment to ensure customer's needs 
are met. Works as the customer's primary contact for specific applications.

Specific Requirements:

To be qualified for this position the ideal candidate will have two years
experience in online development or publishing, with an emphasis on coding,
troubleshooting, and supporting a Linux & Apache environment. Advanced or
expert level Linux/Apache/MySQL/PHP. Must have experience in the development
and support of a heavily trafficked, load balanced web environment, and basic
HTML/CSS and web/interface design experience.  Familiarity with commercial
online services. Basic understanding of networking and systems infrastructure
concepts. Strong communications and teamwork skills will be critical.

Contact:  jim.lindsey[AT]azcentral[DOT]com with a resume.
-

...I don't really know any more than what's posted above, but will try to
answer any questions if you send me an e-mail *off-list*.  Hope this helps,

-- 
   For every complex problem, there is a solution that is simple, 
   neat, and wrong.
  My blog: http://crow202.org/wordpress/
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see

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