php-general Digest 29 Jul 2007 17:46:08 -0000 Issue 4931

Topics (messages 259754 through 259772):

Re: PDO_SQLite Transactions
        259754 by: Richard Lynch
        259770 by: M. Sokolewicz

Re: Rules of Engagement
        259755 by: Richard Lynch
        259756 by: Richard Lynch
        259764 by: Lester Caine

Re: Comment modes behavior in HTML and PHP
        259757 by: Richard Lynch

Re: Hide the real URL
        259758 by: Richard Lynch

Re: Profile / Debug w/o server modification?
        259759 by: Richard Lynch
        259765 by: Instruct ICC

Dealing with ImageMagick from PHP
        259760 by: Eric Holt (PHP List)
        259771 by: Al

Re: Pirate PHP books online?
        259761 by: Richard Lynch
        259762 by: Dotan Cohen

About XSL Transformation
        259763 by: Kelvin Park

Re: PHP list as a blog
        259766 by: Børge Holen

Re: Objects
        259767 by: tedd
        259772 by: Nathan Nobbe

Re: need insights on encrypting and uploading ASCII file using PHP
        259768 by: tedd
        259769 by: Satyam

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 ---
I suspect that you are trying to update the record you just inserted.

That may just not be possible in the transaction model, for whatever
internal purposes.

It also seems kind of backwards to me at least.

Why not just do the file move and error checking before you even
bother to insert, and then do a single statement, which won't even
need a transaction, since any one statement is atomic.

Perhaps I'm missing something, but it seems like you've needlessly
complicated the DB side of things.

On Sat, July 28, 2007 8:57 pm, M. Sokolewicz wrote:
> I've been having this problem for a while now,
> when I use transactions in SQLite with PDO it stalls on me with an
> error
> stating my statements are in progress.
> I've tried closing all cursors to my statements, but that does not
> seem
> to resolve this for me. This is my code,
> (obviously shortened quite a bit)
>
> I hope someone could help me figure out what's going wrong, could it
> be
> that I can't run an update yet because
> the transaction has not been commited yet?? (sounds a bit odd to me)
>
> <?php
> // setup an SQLite db connection via PDO, this is in $db
> try {
>       // $fileName, $fileDesc and $fileType are all existing, cleaned,
> checked values
>       $statement = $db->prepare('INSERT INTO Files (file_name, file_desc,
> file_type, file_filename) VALUES (?, ?, ?, ?)');
>       $statement->execute(array($fileName, $fileDesc, $fileType, ''));
>
>       $id = $db->lastInsertId();
>
>       $statement->closeCursor();
>
>       $res = move_uploaded_file($tmp_file, $new_file);
>
>       if($res === false) {
>           $db->rollBack();
>
>           echo 'error';
>           exit;
>       } else {
>           $statement = $db->prepare('UPDATE Files SET file_filename=? WHERE
> file_id=?');
>           $statement->execute(array($new_file, $id));
>
>           $statement->closeCursor();
>
>           OG::$db->commit();
>       }
> } catch(Exception $e) {
>      var_dump($e);
> }
>
> And the Exception I recieve (there is only one commit in the file, due
> to shortening for posting
> the line listed here is incorrect):
>
> object(PDOException)#7 (7) {
>    ["message:protected"]=>
>    string(88) "SQLSTATE[HY000]: General error: 1 cannot commit
> transaction - SQL statements in progress"
>    ["string:private"]=>
>    string(0) ""
>    ["code:protected"]=>
>    string(5) "HY000"
>    ["file:protected"]=>
>    string(43) "/home/tularis/public_html/t/createFile.php"
>    ["line:protected"]=>
>    int(95)
>    ["trace:private"]=>
>    array(1) {
>      [0]=>
>      array(6) {
>        ["file"]=>
>        string(43) "/home/tularis/public_html/t/createFile.php"
>        ["line"]=>
>        int(95)
>        ["function"]=>
>        string(6) "commit"
>        ["class"]=>
>        string(3) "PDO"
>        ["type"]=>
>        string(2) "->"
>        ["args"]=>
>        array(0) {
>        }
>      }
>    }
>    ["errorInfo"]=>
>    array(3) {
>      [0]=>
>      string(5) "HY000"
>      [1]=>
>      int(1)
>      [2]=>
>      string(54) "cannot commit transaction - SQL statements in
> progress"
>    }
> }
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message --- I was indeed trying to update the record I just inserted, the thing is though, if I remove all other queries and keep just
PDO->beginTransaction();
PDO->prepare();
PDOstatement->execute();
PDOstatement->closeCursor();
PDO->commit();

it still returns such an error. Which is very odd indeed...

As for what I'm trying, it's true that this wasn't the best way of doing it, but there's actually more code involved with slightly different (read: more) changes being done and retrieved from various (non-PDO SQLite db) places.

I've removed the Transactions and it works fine =/

- Tul

Richard Lynch wrote:
I suspect that you are trying to update the record you just inserted.

That may just not be possible in the transaction model, for whatever
internal purposes.

It also seems kind of backwards to me at least.

Why not just do the file move and error checking before you even
bother to insert, and then do a single statement, which won't even
need a transaction, since any one statement is atomic.

Perhaps I'm missing something, but it seems like you've needlessly
complicated the DB side of things.

On Sat, July 28, 2007 8:57 pm, M. Sokolewicz wrote:
I've been having this problem for a while now,
when I use transactions in SQLite with PDO it stalls on me with an
error
stating my statements are in progress.
I've tried closing all cursors to my statements, but that does not
seem
to resolve this for me. This is my code,
(obviously shortened quite a bit)

I hope someone could help me figure out what's going wrong, could it
be
that I can't run an update yet because
the transaction has not been commited yet?? (sounds a bit odd to me)

<?php
// setup an SQLite db connection via PDO, this is in $db
try {
        // $fileName, $fileDesc and $fileType are all existing, cleaned,
checked values
        $statement = $db->prepare('INSERT INTO Files (file_name, file_desc,
file_type, file_filename) VALUES (?, ?, ?, ?)');
        $statement->execute(array($fileName, $fileDesc, $fileType, ''));

        $id = $db->lastInsertId();

        $statement->closeCursor();

        $res = move_uploaded_file($tmp_file, $new_file);

        if($res === false) {
            $db->rollBack();

            echo 'error';
            exit;
        } else {
            $statement = $db->prepare('UPDATE Files SET file_filename=? WHERE
file_id=?');
            $statement->execute(array($new_file, $id));

            $statement->closeCursor();

            OG::$db->commit();
        }
} catch(Exception $e) {
     var_dump($e);
}

And the Exception I recieve (there is only one commit in the file, due
to shortening for posting
the line listed here is incorrect):

object(PDOException)#7 (7) {
   ["message:protected"]=>
   string(88) "SQLSTATE[HY000]: General error: 1 cannot commit
transaction - SQL statements in progress"
   ["string:private"]=>
   string(0) ""
   ["code:protected"]=>
   string(5) "HY000"
   ["file:protected"]=>
   string(43) "/home/tularis/public_html/t/createFile.php"
   ["line:protected"]=>
   int(95)
   ["trace:private"]=>
   array(1) {
     [0]=>
     array(6) {
       ["file"]=>
       string(43) "/home/tularis/public_html/t/createFile.php"
       ["line"]=>
       int(95)
       ["function"]=>
       string(6) "commit"
       ["class"]=>
       string(3) "PDO"
       ["type"]=>
       string(2) "->"
       ["args"]=>
       array(0) {
       }
     }
   }
   ["errorInfo"]=>
   array(3) {
     [0]=>
     string(5) "HY000"
     [1]=>
     int(1)
     [2]=>
     string(54) "cannot commit transaction - SQL statements in
progress"
   }
}

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





--- End Message ---
--- Begin Message ---
On Sat, July 28, 2007 7:28 pm, Daniel Brown wrote:
>     Can we update the filters on the list to have the reply-to address
> header marked to the php-general address?

This is a religious question of mailing list management, and there are
always going to be large sized contingents on each side of this fence.

Personally, I'm on the other side of the fence. :-)

> The reason I ask this is
> because, when people are on vacation (such as Juan is now), we receive
> responses to our personal addresses.  Secondly, we have to continually

Juan's vacation response would be no "better" if the list was
reply-to-all.

In a worst-case scenario, the entire list would get his vacation
message for each post...

Of course, your own email filters should be stripping out the dang
things, possibly, as I don't think I've gotten any of these lately.

And you can always contact the list owner to request they unsubscribe
anybody who has their vacation demon replying.

PS
I never have figured out why one would want to notify a zillion
strangers that you're on vacation...

I mean, duh, talk about a security risk...

"Hey, stranger, I'm on vacation!!!  Nice big house of computer geek
full of stuff sitting unwatched!!!"

I'm really not sure who thought this was a Good Idea...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
On Sat, July 28, 2007 11:37 pm, Larry Garfield wrote:
> Amen!  A public discussion list (such as this one) really should have
> Reply-To
> set correctly.  All of the arguments against Reply-To headers apply
> only to
> the 1% of the population still using mail clients written in the early
> 90s.


The mistake of accidentaly addressing ALL with a [ahem] rude or
private comment is not client-specific nor limited in time.

> I'd love to not get double copies of every bloody reply to every
> thread I'm
> involved in.  It's just a waste of electrons and of my time.

You mean all y'all that it bothers haven't hacked a PHP IMAP script to
login, detect duplicates, and delete the bothersome ones?...

:-)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
Daniel Brown wrote:
    As a relatively-new contributor to this list (read: under 2
years), I realize that I have no business requesting a change, but
I'll breech etiquette and hope for the best.

    Can we update the filters on the list to have the reply-to address
header marked to the php-general address?

At the risk of extending the religious war ....

I'm with you Daniel, but I think it has been decided that what we ACTUALLY need is a fix at the reception end. Some email clients will allow you to set a reply address for a folder ( apparently ) which is actually what *I* could do with, so all [PHP] email goes in the php-general folder, and when I hit reply I get a list reply address, just like I get a news list address on news folders. Unfortunately the other religious war erupts when you ask for that at the client end and many of the same people who INSIST that replies should be changed to be private then insist that its not appropriate to allow the client end to change them back :(

So until SeaMonkey adds the facility to set a folder reply address I'm stuck like you with remembering to hit 'reply all' on the relatively few lists that still work the old school way ;) Actually rather than doing that I TRY to be nice and replace the private reply address with the list address - so I don't get those duplicate replies that are not getting filtered out when someone 'reply alls' my posts ;)

--
Lester Caine - G8HFL
-----------------------------
Contact - http://home.lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://home.lsces.co.uk
MEDW - http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Firebird - http://www.firebirdsql.org/index.php

--- End Message ---
--- Begin Message ---

On Sat, July 28, 2007 9:40 am, C.R.Vegelin wrote:
> I have a PHP script, as follows:
> <!--
>    <?php
>        echo "should this be echoed ?";
>    ?>
> -->
>
> As expected, the browser shows nothing,
> but when I view Source in the browser, I see:
> <!-- start HTML comment
>  should this be echoed ?-->
>
> Shouldn't it be just: <!--  -->, without the echo result ?
> I don't expect PHP to be active between <!--     -->.

I can see what you mean, but that's just not how it works, and for a
very good reason:

<script language="JavaScript" type="text/js">
<!-- hide from old browsers
<?php echo "var foo = '$foo';\n";?>
-->
</script>

Actually, there are many other good reasons as well, but that's
probably the most easily understood for a beginner. :-)


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
On Fri, July 27, 2007 10:17 pm, Eric Butera wrote:
> We have our own dedicated server that we host client sites on.  If I
> were to back out into the root then I would be at the level of all the
> other sites.  It just doesn't make sense in my case.

It's pretty trivial to add one more layer of directories in your setup
script so that httpd.conf has something like:

<DocumentRoot "/home/clienta/htdocs">
</DocumentRoot>
<DocumentRoot "/home/company/htdocs">
</DocumentRoot>

and the directory structure is:

/home
  /clienta
    /private
    /htdocs
  /company
    /private
    /htdocs

This is not rocket science, which is why any decent webhost with half
a clue about any kind of dynamic scripted sites does this...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
On Fri, July 27, 2007 10:01 pm, Instruct ICC wrote:
>>From: "Richard Lynch" <[EMAIL PROTECTED]>
>> > But xdebug and apd are probably moot.
>> >
>> > BTW, I'm not using separate development and production machines.
>>
>>Right there is your first problem.
>>
>>Solve that first.
>
> If you mean get a dev box.  You don't know how long I've been asking
> for one
> to match the production box.

Your dev box should only match in software versions (okay, and any
really funky specialized hardware like a hardware random number
generator MAYBE).

Don't ask them for a Gigaplex Mu-on 16-cpu 64 Gig RAM 4 Terabyte hard
drive box.

Take an old box out of your closet and install the same versions of
the OS, Webserver, DB, and PHP and call it done.

Now, a QA box, where you do load-testing and serious "release
candidate" testing, yeah, THAT should match the production box, if at
all possible...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
From: "Richard Lynch" <[EMAIL PROTECTED]>

On Fri, July 27, 2007 10:01 pm, Instruct ICC wrote:
> If you mean get a dev box.  You don't know how long I've been asking
> for one
> to match the production box.

Your dev box should only match in software versions (okay, and any
really funky specialized hardware like a hardware random number
generator MAYBE).

Don't ask them for a Gigaplex Mu-on 16-cpu 64 Gig RAM 4 Terabyte hard
drive box.

Take an old box out of your closet and install the same versions of
the OS, Webserver, DB, and PHP and call it done.

Now, a QA box, where you do load-testing and serious "release
candidate" testing, yeah, THAT should match the production box, if at
all possible...

Do you know of any (free as in money) disk imaging software that would capture all the patches/configurations/etc. Actually, as I write this, I remember the reason the imaging tool I used had mysterious failures was probably due to bad memory, and I could use a different box now.

Thanks for the advice.

_________________________________________________________________
Local listings, incredible imagery, and driving directions - all in one place! http://maps.live.com/?wip=69&FORM=MGAC01
--- End Message ---
--- Begin Message ---
Hello everyone.  This is my first post to the list, so bare with me :)

I have written an application for a client that is used in the Event Photography business. It handles taking photographs, categorizing them, making thumbnails of them, and allows parents(customers) to view the photos and order them. It runs on LAMP, and it really works great.

For the past two years, we've used ImageMagick v4.2.9 to process the thumbnails. Image quality was decent enough, but the main reason for 4.2.9 was SPEED. In my testing, 4.2.9 was quite a bit faster than the lastest releases (in the 6.x.x series). Anyway -- the clients decided they wanted me to do some work on the image quality, so I finally decided to move up to ImageMagick v.6.3.4.

Right now, I call ImageMagick from a "exec" call in PHP. When I first wrote the application, it was the quickest and easiest way for me to get it working. Command-line ImageMagick is pretty simple.

So, with ImageMagick 6.3.4, with the sharpening and compression I'm now using, the clients are absolutely in love with the thumbnail quality -- even though the amount of time it takes to make the thumbnails is much longer. They've asked if anything can be done about that, but I think I've optimized the shell script as much as possible.

Now, after that long rambling... My question is this: Would I see a big speed improvement by using the ImageMagick extension built into PHP (MagicWand, is it called?)? I'd hate to spend all the time recoding the application to work with MagicWand, only to find out that I dont end up with any performance increase -- or worse of all, a decrease.

I wasnt convinced either way, from the Googling I had done on the subject, so I thought I would post the question to the PHP list.

A little more background here, before I go: PHP iterates through a directory of full-sized images, directly out of the camera, and "exec"'s a shell script "thumbcreation.sh" with the details of what ImageMagick needs to do, and where it needs to store the new thumbnails. The script calls convert, which creates a medium sized thumbnail (333x500), and then from that creates a small thumbnail (80x120) from the medium. Then, the script calls composite, where is adds a watermark to the medium size thumbnail, and saves it in the watermarked directory.

In my initial testing, years ago, I found that ImageMagick v4.2.9 was faster than the internal GD library... however, I havnt touched GD since my initial testing. Perhaps GD would be faster now than IM v6.3.4(?).

Okay, I've rambled on plenty now, for my first post. I greatly appreciate any advice anyone on the list could provide.


THANKS!!!
 --Eric

--- End Message ---
--- Begin Message ---
You'd be far better off asking your questions on the phpList forum.

There are a number of hints on the forum for speeding up things. Plus, look in 
the examples section.

Eric Holt (PHP List) wrote:
Hello everyone.  This is my first post to the list, so bare with me :)

I have written an application for a client that is used in the Event Photography business. It handles taking photographs, categorizing them, making thumbnails of them, and allows parents(customers) to view the photos and order them. It runs on LAMP, and it really works great.

For the past two years, we've used ImageMagick v4.2.9 to process the thumbnails. Image quality was decent enough, but the main reason for 4.2.9 was SPEED. In my testing, 4.2.9 was quite a bit faster than the lastest releases (in the 6.x.x series). Anyway -- the clients decided they wanted me to do some work on the image quality, so I finally decided to move up to ImageMagick v.6.3.4.

Right now, I call ImageMagick from a "exec" call in PHP. When I first wrote the application, it was the quickest and easiest way for me to get it working. Command-line ImageMagick is pretty simple.

So, with ImageMagick 6.3.4, with the sharpening and compression I'm now using, the clients are absolutely in love with the thumbnail quality -- even though the amount of time it takes to make the thumbnails is much longer. They've asked if anything can be done about that, but I think I've optimized the shell script as much as possible.

Now, after that long rambling... My question is this: Would I see a big speed improvement by using the ImageMagick extension built into PHP (MagicWand, is it called?)? I'd hate to spend all the time recoding the application to work with MagicWand, only to find out that I dont end up with any performance increase -- or worse of all, a decrease.

I wasnt convinced either way, from the Googling I had done on the subject, so I thought I would post the question to the PHP list.

A little more background here, before I go: PHP iterates through a directory of full-sized images, directly out of the camera, and "exec"'s a shell script "thumbcreation.sh" with the details of what ImageMagick needs to do, and where it needs to store the new thumbnails. The script calls convert, which creates a medium sized thumbnail (333x500), and then from that creates a small thumbnail (80x120) from the medium. Then, the script calls composite, where is adds a watermark to the medium size thumbnail, and saves it in the watermarked directory.

In my initial testing, years ago, I found that ImageMagick v4.2.9 was faster than the internal GD library... however, I havnt touched GD since my initial testing. Perhaps GD would be faster now than IM v6.3.4(?).

Okay, I've rambled on plenty now, for my first post. I greatly appreciate any advice anyone on the list could provide.


THANKS!!!
 --Eric

--- End Message ---
--- Begin Message ---
On Fri, July 27, 2007 6:28 pm, Larry Garfield wrote:
> On Friday 27 July 2007, Richard Lynch wrote:
> If "indirectly affecting the market so that prices change" counts as
> stealing,
> then Coke and Pepsi build their business models around stealing from
> each
> other.
>
> Apache/PHP/MySQL are then "stealing actual money" from Microsoft,
> because they
> reduces sales of Windows, IIS, Visual Studio, and MS SQL Server.
>
> Great, so that means we should shut down Pepsi to stop them from
> stealing from
> Coke, and shut down PHP to stop them from stealing from Microsoft!

This is a laughable argument.

Infringing on copyright is simply not comparable to providing a
similar product in whatever business model or under whatever terms one
likes.

If Pepsi went and STOLE the Coke formula and started trying to sell
"Koch" you can be damn sure there would be a lawsuit.

> I would say that shows just what pathetically laughable bullshit that
> argument
> is, except that Microsoft has made it publicly before, albeit phrased
> as "defending capitalism".  You see why I find it so offensive?

Microsoft stupidity and/or behaviour is not a legitimate defense for
any activity. :-)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
On 29/07/07, Larry Garfield <[EMAIL PROTECTED]> wrote:
> 1) Something can be illegal without it being theft.  The idea that "if it's
> not theft then it must be OK" is the bullshit argument that I am pointing out
> as bullshit.

That's a valid point, but you are playing lawyer's games. "It's not
theft, it's QQQ, which is different from theft in X Y and Z". Nobody
likes lawyers or their games. Call it what you will, copyright
infringement is taking something without paying for it.

> 2) No, I am not saying that copyright infringement is a good thing.  Perhaps
> you've heard of a concept called "hyperbole".  Or one called "sarcasm".  I
> was pointing out that if copyright infringement counted as "theft" from
> someone else who was paying for a licensed copy of X, then Pepsi having a
> marketing campaign counted as "theft" from Coke because of lost sales.  Both
> are equally asinine statements.  That's the point.

Not a valid analogy. Pepsi is not redistributing Coke's product. They
have their own product.

If you do take a php book, learn from it, and write your own then I
won't call that copyright infringement, theft, or even plagerism if
your book is sufficiently different. You could distribute it for free
via whatever medium that you like. I'd even support your efforts.

> 3) At no point in this conversation have I ever said that I engage in or
> support copyright infringement, and I am insulted that you would accuse me of
> such without any evidence or justification to back it up.

You are insinuating it. I was also accused of supporting copyright
infringement earlier in the thread, yet I was not insulted. Don't be
so sensitive. There are bigger jerks than me on the Internet. And I
was not targeting you specifically. I was targeting your comments.

> I am pointing out that you are saying things that are *factually inaccurate by
> the laws of the United States*.  And for that you accuse me of copyright
> infringement and being immoral?  That is without a doubt the most offensive
> comment I've seen on this list so far.  I would say I expect an apology, but
> given that you fall back on insulting someone's ethics just because they
> don't buy into the same lie that the media cartels have been spreading that
> you do I won't hold my breath.

I never said anything about the laws of the United States. I don't
even live there, what do I care about their laws? I am, however, a
moral human being, and that is my motivation.

> Really, I had expected more mature commentary from the adults on this list.

So did I. I expect adults to display morality and values.

Dotan Cohen

http://lyricslist.com/
http://what-is-what.com/

--- End Message ---
--- Begin Message --- I have an XML file with 10 products with their registered dates(dates when they were created). My XSL code is set so that it sorts the products in descending order(latest to oldest) by registered dates. I tried to declare xsl:variable to increment within xsl:for-each, however I ran in to some dead ends.
How do I print only the 5 latest products?

--- End Message ---
--- Begin Message ---
On Sunday 29 July 2007 02:18, you wrote:
>     I'll top-post for this announcement.  I think we found the winner
> of the "Revive An Old Topic" award.

hup, yes its that vacation thing you posted about later ;D I just got 2278 
more


>
>     Congrats.
>
> On 7/28/07, Børge Holen <[EMAIL PROTECTED]> wrote:
> > On Thursday 14 June 2007 00:41, Philip Thompson wrote:
> > > On Jun 13, 2007, at 1:15 PM, Richard Lynch wrote:
> > > > On Wed, June 13, 2007 12:21 am, Crayon Shin Chan wrote:
> > > >> On Wednesday 13 June 2007 12:39, Paul Scott wrote:
> > > >>> Our interns and students specifically. They are all dead scared of
> > > >>> joining mailing lists in general, and find that using a web based
> > > >>> prettier interface is much easier and friendlier.
> > > >>
> > > >> Not to mention slower, clumsier and more bandwidth hungry than a
> > > >> mailing list. It's time you did them a favour and show them that
> > > >> mailing lists
> > > >> are nothing to be afraid of.
> > > >
> > > > Do students and interns still have quotas on their email accounts?...
> > >
> > > Yes. It does depend on the university though. For our students, the
> > > default is only 50 megs - they may request more. However, these text-
> > > only emails don't really take up that much space.
> > >
> > > > Cuz I *DO* remember the days when the email quotas a University would
> > > > have prohibited subscribing to PHP mailing list...
> > >
> > > This is not currently the case.....
> > >
> > > > Surely in this day and age, the quotas aren't *that* restrictive...
> >
> > There seems to be some failure to comunicate (I believe the Prodigy said
> > that)... whatever, quotas on the universities will not keep you from
> > recieving mail... or download anything of the net.  It just defines the
> > space available to the user. The temporary space available lets you pull
> > way more, and get a delete warning from either an automated system or an
> > admin (at my university, wasn't it 10 days or so before forced deletion
> > on random objects occured?... dunno).
> > Imagine an master or phD degree getting lost because someone set up an
> > university server with some weird download quota.
> > This could hardly be _A_ reason for makin' this blog... the amount of
> > mail or numbers should not be an issue. If it is so... how about them
> > digest mails?
> >
> > > True.
> > >
> > >
> > > ~Philip
> >
> > --
> > ---
> > Børge
> > http://www.arivene.net
> > ---
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php

-- 
---
Børge
http://www.arivene.net
---

--- End Message ---
--- Begin Message ---
At 2:00 PM -0400 7/25/07, Nathan Nobbe wrote:
yes well at the beginning of the design patterns book they basically explain
the same thing.
if you dont understand the basic oo priciples, then design patterns arent
going to make any sense.
these basic concepts are (not looking in the book [testing myself]..)
encapsulation
abstraction
polymorphism
inheritence

ok now i will look in the book; lets see if ive learned anything;
nice; thats what they have there;
ya; get the basics down, but then; dont stop; learn design patterns!


I understand, and have used, the four mentioned above -- but have a difficult time with design patterns.

Sure, I get the idea that design patterns are concepts/procedures/ideas for how to identify/classify a problem and thereby infer a specific solution, but further than that I'm lost.

As I see it, every problem consist of input, calculation, and presentation. I don't see the need to classify each problem as a specific type and then proceed accordingly.

To me, every problem looks the same, only different. :-)

Cheers,

tedd


--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
tedd,

have you looked at the book we're talking about?
also, there are several other books on design patterns available, but the
Heads First book
is one ive heard mentioned a lot.
you can check out a really sweet site online phppatterns.com; in particular
follow the design
link on the right hand navigation.  if youve been working w/ objects for
more than a few months
design patterns should expose their benefit almost immediately.  it boils
down to a really simple
premise, see, i have been writing code for o, about 3 years and getting paid
for it.  i studied oop
a bit in college for about another 3 years and tinkered w/ them in high
school for probly less than
a year.  well after all that i can still write some pretty weak code.
yes, my code may be clean, but in the greater scheme of things how well will
it scale ?  does it need
to be modified when a new feature should be added ?  does it suffer from
dependency rot ?  in
many cases the answer to these questions is not the preferable one.  so
thats where the motivation for
design patterns comes from.  people who have been writing oop code for the
past 20-30 years or so decided
to start sharing their experiences with one another.  after a while they got
a big collection of dos and donts
together and put together common optimal solutions to common problems.
one of the hardest parts about using design patterns in reality is you have
to be able to recognize a certain
problem and then you can begin to understand how to apply a particular
pattern or set of patterns to your
solution.
also it is not merely about rigidly following the patterns.  there are also
design principals, that guide us in
writing code that doesnt suck.
it should be mentioned the authors of said book have a masters degree and
phd degree from yale in computer
science; thats right, they know a thing or 2.
anyway if you dont know design patterns you dont know what youre missing and
you probly dont know what
youre writing either :)

-nathan

On 7/29/07, tedd <[EMAIL PROTECTED]> wrote:
>
> At 2:00 PM -0400 7/25/07, Nathan Nobbe wrote:
> >yes well at the beginning of the design patterns book they basically
> explain
> >the same thing.
> >if you dont understand the basic oo priciples, then design patterns arent
> >going to make any sense.
> >these basic concepts are (not looking in the book [testing myself]..)
> >encapsulation
> >abstraction
> >polymorphism
> >inheritence
> >
> >ok now i will look in the book; lets see if ive learned anything;
> >nice; thats what they have there;
> >ya; get the basics down, but then; dont stop; learn design patterns!
>
>
> I understand, and have used, the four mentioned above -- but have a
> difficult time with design patterns.
>
> Sure, I get the idea that design patterns are
> concepts/procedures/ideas for how to identify/classify a problem and
> thereby infer a specific solution, but further than that I'm lost.
>
> As I see it, every problem consist of input, calculation, and
> presentation. I don't see the need to classify each problem as a
> specific type and then proceed accordingly.
>
> To me, every problem looks the same, only different. :-)
>
> Cheers,
>
> tedd
>
>
> --
> -------
> 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
>
>

--- End Message ---
--- Begin Message ---
At 2:52 PM -0700 7/27/07, John A DAVIS wrote:
Content-Language:
Content-Type: text/plain;
 charset=utf-8

Very good! Very good! Thank you. Lots of stuff to mull over.

John A. Davis
Programmer
State of Oregon DHS OIS
CNE, MCSE

"Don't think of the problem, think of the solution"

 "Satyam" <[EMAIL PROTECTED]> 7/27/2007 2:19 PM >>>


There are two different things you might want, ensure that the data is not seen by eavesdroppers while in transit or ascertain that the data comes from who says it is.

The first, you manage with SSL as with any other secure transaction, as already sugested.

For the second is what you might want to use a digital signature, that's why someone might have sugested it to you. As a sample of how this would work you read the file into memory, add a long string, the signature, that is never transmitted but that both ends know, and pass it all through an algorithm like MD5 or such. At the receiving end, you get the data and the MD5 but, as I said, the signature is never transmitted, but you know it as well. You do the same process as in the sending end and you should reach the same MD5. Since MD5 is not reversible, knowing the MD5 of this long string, the data plus the signature, cannot reveal the signature even if the data is transmitted in clear text, but no other except someone who has the signature can produce the right MD5. Notice that the data itself is transmitted in clear text, the goal is to ensure that who sends it is who is meant. A similar process has been in use in the banking industry for wire transfers when they were really sent via telex.

As mentioned PGP is a far better solution since it covers both requirements and it uses two keys, one for encoding and one for decoding so that each end knows just half of the information and won't require you to use SSL, the problem is that you have to do some processing at the client side and JavaScript alone won't allow you to access the file system. You would have to deploy ActiveX controls or Konfabulator widgets (plust the widget runtime). On the other hand, many eMail clients can send PGP protected messages.

Finally, you could get your users to ZIP the files with a password before sending them, which is not so secure but is good enough for many uses. IT all depends on what you want.

Satyam

You can also send pieces and parts at different times to be assembled afterwards and, if needed, each to have their own protection scheme. Or you could burn a CD and sent it through the mail, publish keys in the newspaper under personal ads, flash Morse code on clouds, or try smoke signals -- all work in one fashion or another to transmit data.

I think that about covers it.  :-)

Cheers,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---

----- Original Message ----- From: "tedd" <[EMAIL PROTECTED]>
To: "John A DAVIS" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, July 29, 2007 4:32 PM
Subject: Re: [PHP] need insights on encrypting and uploading ASCII file using PHP

Finally, you could get your users to ZIP the files with a password before sending them, which is not so secure but is good enough for many uses. IT all depends on what you want.

Satyam

You can also send pieces and parts at different times to be assembled afterwards and, if needed, each to have their own protection scheme. Or you could burn a CD and sent it through the mail, publish keys in the newspaper under personal ads, flash Morse code on clouds, or try smoke signals -- all work in one fashion or another to transmit data.

I think that about covers it.  :-)


Perhaps you are missing a station wagon full of 6250BPI magnetic tapes as Tanenbaum's classic "Computer Networks" mentions, with an armed guard on the passenger seat, for the sake of security.

Satyam

PS: I wonder if he took that out in later editions or replaced 'van' for 'station wagon' and 'CDs' for 'magnetic tapes'.



Cheers,

tedd
--
-------
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



--
No virus found in this incoming message.
Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.23/924 - Release Date: 28/07/2007 15:50



--- End Message ---

Reply via email to