Wednesday, October 28, 2009

Re: [BLUG] Any PHP devs on this list?

On Wed, 28 Oct 2009 21:10:50 -0400, Mark Krenz <mark@slugbug.org> wrote:

> On Thu, Oct 29, 2009 at 01:01:30AM GMT, Aaron W. Hsu
> [arcfide@sacrideo.us] said the following:
>> On Wed, 28 Oct 2009 20:41:33 -0400, Mark Krenz <mark@slugbug.org> wrote:
>>
>> > Aaron, what language do you usually code in?
>>
>> Scheme, for web and otherwise.
>>
>
> Whoa, really? That's cool. Can you show us some small sample web program
> written in scheme?

Well, For the simplest sites, I just write them in SXML and generate
static content. There's a script for doing that attached (make sure to set
your editor to two-space tab widths). For dynamic sites, I use mod_lisp +
SXML + Apache. You can see two current sites in development (they're not
fully complete) at:

http://www.usa1911.com
http://descot.sacrideo.us

The code for Descot is available publicly. Here's how an example one page
website might be made:

(let ()
(import (chezscheme)
(arcfide modlisp)
(oleg sxml-to-html))

(define (index-handler req)
(make-html-response
(with-output-to-string
(lambda ()
(write-html-doctype)
(sxml->html (compose-page))))))

(define (compose-page) ---)

(register-request-hanlder! (modlisp-subtree-matcher "/scm/index")
index-handler)
(start-modlisp-server 3000)

)

Where 'compose-page' would return some SXML. That's where you could say,
read in your header, footer, and other content in dynamically, or do
whatever other processing you wanted to do. You could also use the 'req'
to get information about the URL and other request information.

This is all based on the modlisp library that I have written. It's part of
the Arctic Repository, which is a collection of software libraries. For
now they work on Chez Scheme (one or two libraries need to be compiled
before they can be used in Petite Chez Scheme, but otherwise they all work
in Petite as well as in fully Chez, and I provide compiled versions for
some platforms).

You can check out more at <http://www.sacrideo.us>, where you can find the
archive (via Gopher [written in Scheme]), or the latest and greatest via
Monotone VCS.

I've also written some old blogging software that hasn't been moved from
MIT Scheme to the new mod-lisp library, which is called Slogger, and is
also available through the same places. Even older, there is a Magic v2
based calendaring software in Scheme48, but I don't know how much that
still works now or not.

Aaron W. Hsu

--
Of all tyrannies, a tyranny sincerely exercised for the good of its
victims may be the most oppressive. -- C. S. Lewis

Re: [BLUG] Any PHP devs on this list?

On Thu, Oct 29, 2009 at 01:01:30AM GMT, Aaron W. Hsu [arcfide@sacrideo.us] said the following:
> On Wed, 28 Oct 2009 20:41:33 -0400, Mark Krenz <mark@slugbug.org> wrote:
>
> > Aaron, what language do you usually code in?
>
> Scheme, for web and otherwise.
>

Whoa, really? That's cool. Can you show us some small sample web program
written in scheme?


--
Mark Krenz
Bloomington Linux Users Group
http://www.bloomingtonlinux.org/
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] Any PHP devs on this list?

On Wed, 28 Oct 2009 20:41:33 -0400, Mark Krenz <mark@slugbug.org> wrote:

> Aaron, what language do you usually code in?

Scheme, for web and otherwise.

Aaron W. Hsu

--
Of all tyrannies, a tyranny sincerely exercised for the good of its
victims may be the most oppressive. -- C. S. Lewis
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] Any PHP devs on this list?

Aaron, what language do you usually code in?

On Thu, Oct 29, 2009 at 12:07:28AM GMT, Aaron W. Hsu [arcfide@sacrideo.us] said the following:
> On Wed, 28 Oct 2009 20:02:48 -0400, Mark Krenz <mark@slugbug.org> wrote:
>
> > Or general web
> > code development?
>
> I develop web sites that require programming backends.
>
> Aaron W. Hsu
>
> --
> Of all tyrannies, a tyranny sincerely exercised for the good of its
> victims may be the most oppressive. -- C. S. Lewis
> _______________________________________________
> BLUG mailing list
> BLUG@linuxfan.com
> http://mailman.cs.indiana.edu/mailman/listinfo/blug
>

--
Mark Krenz
Bloomington Linux Users Group
http://www.bloomingtonlinux.org/
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] Any PHP devs on this list?

yup. I'm not a big fan of php, but use it sometimes. Lots of perl
(yes, still!) and Rails.

David


On Wed, Oct 28, 2009 at 08:14:03PM -0400, Poland, Andrew J wrote:
>Yes I've worked on projects in PHP and Java.
>
>Andrew
>
>Sent from my iPhone
>
>On Oct 28, 2009, at 8:02 PM, "Mark Krenz" <mark@slugbug.org> wrote:
>
>>
>> Anyone else on this list do a lot of PHP development? Or general web
>> code development?
>>
>> --
>> Mark Krenz
>> Bloomington Linux Users Group
>> http://www.bloomingtonlinux.org/
>> _______________________________________________
>> BLUG mailing list
>> BLUG@linuxfan.com
>> http://mailman.cs.indiana.edu/mailman/listinfo/blug
>
>_______________________________________________
>BLUG mailing list
>BLUG@linuxfan.com
>http://mailman.cs.indiana.edu/mailman/listinfo/blug
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] Any PHP devs on this list?

Yes I've worked on projects in PHP and Java.

Andrew

Sent from my iPhone

On Oct 28, 2009, at 8:02 PM, "Mark Krenz" <mark@slugbug.org> wrote:

>
> Anyone else on this list do a lot of PHP development? Or general web
> code development?
>
> --
> Mark Krenz
> Bloomington Linux Users Group
> http://www.bloomingtonlinux.org/
> _______________________________________________
> BLUG mailing list
> BLUG@linuxfan.com
> http://mailman.cs.indiana.edu/mailman/listinfo/blug

_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] Any PHP devs on this list?

Mark Krenz wrote:
> Anyone else on this list do a lot of PHP development? Or general web
> code development?
>


*raises hand*

--
Joe Auty
NetMusician: web publishing software for musicians
http://www.netmusician.org
joe@netmusician.org
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] Any PHP devs on this list?

On Wed, 28 Oct 2009 20:02:48 -0400, Mark Krenz <mark@slugbug.org> wrote:

> Or general web
> code development?

I develop web sites that require programming backends.

Aaron W. Hsu

--
Of all tyrannies, a tyranny sincerely exercised for the good of its
victims may be the most oppressive. -- C. S. Lewis
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

[BLUG] Any PHP devs on this list?

Anyone else on this list do a lot of PHP development? Or general web
code development?

--
Mark Krenz
Bloomington Linux Users Group
http://www.bloomingtonlinux.org/
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] hiding an .html link as an .mp3

On Wed, Oct 28, 2009 at 11:35:37PM GMT, Mark Krenz [mark@slugbug.org] said the following:
>
> extension matches the mime type of the document, but its not required
> too. In the case of your nice site here, they have made mp3 a file that
> generates the mime type of text/html. You can see this by using the
> option in wget or curl that will show you the headers generated by the

Sorry, I should have worded this better. What I meant was that they
made it so that files with the extension of .mp3 will cause the
webserver to send out a Content-Type: header of text/html.

--
Mark Krenz
Bloomington Linux Users Group
http://www.bloomingtonlinux.org/
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] hiding an .html link as an .mp3

Welcome to the internal workings of the web. You seem to be fairly
interested in this so I thought I'd delve into it more for you.

Its not done in the HTML, its a trick (not really though) done with
webservers themselves. There is generally a seperation between the
filename extension and the document mime type. Most of the time the
extension matches the mime type of the document, but its not required
too. In the case of your nice site here, they have made mp3 a file that
generates the mime type of text/html. You can see this by using the
option in wget or curl that will show you the headers generated by the
server:

# curl -i http://downloads.khinsider.com/game-soundtracks/album/monkey-island-2-lechucks-revenge-pc-rip-/01-theme.mp3 | head -10

Date: Wed, 28 Oct 2009 22:14:00 GMT
Server: Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5
mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
PHP/5.2.6
X-Powered-By: PHP/5.2.6
Transfer-Encoding: chunked
Content-Type: text/html <=================================


<!DOCTYPE html PUBLIC "-//W3C//DTD Xhtml 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>


Now try the same thing with the actual mp3 file and you'll see the
difference in the webserver response headers, note that you should pass
the output through the string program to remove binary data:


# curl -i http://208.53.138.111/soundtracks/monkey-island-2-lechucks-revenge-pc-rip-/fjfnybaydu/01-theme.mp3 | strings | head -20


Date: Wed, 28 Oct 2009 23:33:27 GMT
Server: Apache/1.3.37 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2
mod_bwlimited/1.4 PHP/4.4.7 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28
OpenSSL/0.9.8b
Last-Modified: Thu, 23 Nov 2006 09:49:18 GMT
ETag: "2cfc62c-228c0b-45656e9e"
Accept-Ranges: bytes
Content-Length: 2264075
Content-Type: audio/mpeg <=================================
TPE1
Michael LandTALB
LeChuck's Revenge (game rip)TCON
GameTIT2
ThemeTRCK
01PRIV
PeakValue
PRIV
AverageLevel
COMM
engiTunNORM
000008D7 00000799 00002AD2 00002799 0000C37E 00013897 0000640C 000069FD 0001D4C0 000186A0


You even see some of the id3 tag there in the output too.

You can configure Apache to change the mime type for a document like
this:

AddType text/html .mp3

Either put that in your server config or if its supported, put it in
an .htaccess file.

Despite the deception that this site has probably in order to get
better search engine placement, there are many good reasons to do this
too. Let's say you want to be able to generate dynamic images on your
website like a graph that pulls data from an online database and
displays it in real time. This is done by making a program such as a
PHP program or even a CGI written in Perl or C that sends a different
Content-Type header than normal to the browser. Most dynamic web
applications send text/html to the browser, but if you have them send
something like image/jpeg instead, you can send image data out and it
will be displayed accordingly. I wrote a quick program that demonstrates
this:

http://suso.suso.org/box.php

By default it just creates a blue box that is of the png image type,
but if you pass it query strings in the URL you can change its size and
color like so:

http://suso.suso.org/box.php?xsize=900&ysize=5&redshade=255


Here is all the code that's needed to do this in PHP, provided PHP has
the GD library loaded:

<?php
header ("Content-type: image/png");

# defaults
$xsize = 100;
$ysize = 100;
$redshade = 0;
$blueshade = 255;
$greenshade = 0;


# Take overrides from the browser and sanity check them.
if (isset($_GET['xsize']) && (1 <= $_GET['xsize'] && $_GET['xsize'] <= 1000)) {
$xsize = intval($_GET['xsize']);
}
if (isset($_GET['ysize']) && (1 <= $_GET['ysize'] && $_GET['ysize'] <= 1000)) {
$ysize = intval($_GET['ysize']);
}

if (isset($_GET['redshade']) && (0 <= $_GET['redshade'] && $_GET['redshade'] <= 255)) {
$redshade = intval($_GET['redshade']);
}
if (isset($_GET['blueshade']) && (0 <= $_GET['blueshade'] && $_GET['redshade'] <= 255)) {
$blueshade = intval($_GET['blueshade']);
}
if (isset($_GET['greenshade']) && (0 <= $_GET['greenshade'] && $_GET['redshade'] <= 255)) {
$greenshade = intval($_GET['greenshade']);
}

unset($im);
unset($fore_color);

$im = @ImageCreate($xsize, $ysize) or die;
$fore_color = ImageColorAllocate ($im, $redshade, $greenshade, $blueshade);

ImageFilledRectangle ($im, 0, 0, $xsize, $ysize, $fore_color);
ImagePng($im);
?>

There are many other examples of this on the net, one common one are the
CAPTCHA images that are used to verify that someone is human and not a
bot. Another one are all those polls with graphs to them. All this is
done using this same technique.

Images aren't all that is done like this, its also possible to
generate flash video that is dynamic and even stuff like pdf files. Just
for fun one time, I wrote a PHP program that streamed an mp3 file
through the PHP program itself just by reading the file in, then sending
an audio/mpeg Content-Type header and then the file. I suppose if you
knew what you were doing you could do some kind of PHP tone generator or
dynamic music generator.

This is an exercise left to the reader. ;-)

Mark

On Wed, Oct 28, 2009 at 10:04:08PM GMT, Ben Shewmaker [ben@shewbox.org] said the following:
> So I was googling around looking for some music from old PC games I used to
> play and found the music from Monkey Island 2 here:
>
> (i would NOT view this site w/out some sort of adblock installed, it is
> seriously annoying)
>
> http://downloads.khinsider.com/game-soundtracks/album/monkey-island-2-lechucks-revenge-pc-rip-
>
> My first thought was to open up a terminal and grab them with wget like so:
>
> wget -r -np -A.mp3 url
>
> But it seems that although the links are listed as .mp3, they are in fact
> links to new pages. For example:
>
> http://downloads.khinsider.com/game-soundtracks/album/monkey-island-2-lechucks-revenge-pc-rip-/01-theme.mp3
>
> is actually a new page which then has a link to the actual mp3:
>
> http://208.53.138.111/soundtracks/monkey-island-2-lechucks-revenge-pc-rip-/fjfnybaydu/01-theme.mp3
>
> Which is a legit file this time. I hate these kinds of sleazy sites and
> usually avoid them but I'm curious as to how this is actually working.
> Looking through the html for the site, it looks like your standard link.
> So when I tell wget to recursively scan for .mp3s it thinks it finds a
> match and downloads the "mp3" (I also tried the Firefox plugin dowmthemall
> but it has the same effect) Does anybody have any idea how this sort of
> thing works?
>
> Ben
>
> (as a side note, it's nice when I run into these types of sites when I'm
> booted into Ubuntu. They may be annoying but I'm not worried about getting
> all sorts of nasty malware)

> _______________________________________________
> BLUG mailing list
> BLUG@linuxfan.com
> http://mailman.cs.indiana.edu/mailman/listinfo/blug


--
Mark Krenz
Bloomington Linux Users Group
http://www.bloomingtonlinux.org/
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] hiding an .html link as an .mp3

On Wed, 28 Oct 2009 18:04:08 -0400, Ben Shewmaker <ben@shewbox.org> wrote:

> Looking through the html for the site, it looks like your standard
> link. So when I tell wget to recursively scan for .mp3s it thinks it
> finds a match and downloads the "mp3" (I also tried the Firefox plugin
> dowmthemall but it has the same effect) Does anybody have any idea how
> this sort of thing works?

I am not sure exactly where you are asking here, but if you are asking why
a URL ending in .mp3 in the path isn't an mp3, that's pretty simple. A URL
is just a locator, and doesn't actually say anything about the file type.
The file type is sent in the response header as a mime-type. So, you could
serve all your html pages as .mp3 urls if you wanted to do so. All it
takes is a resolution of the URL that provides the right content.

Aaron W. Hsu

--
Of all tyrannies, a tyranny sincerely exercised for the good of its
victims may be the most oppressive. -- C. S. Lewis
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] hiding an .html link as an .mp3

On Wed, Oct 28, 2009 at 06:04:08PM -0400, Ben Shewmaker wrote:
> *So when I tell wget to recursively scan for .mp3s it thinks it finds a
> match and downloads the "mp3" *(I also tried the Firefox plugin
> dowmthemall but it has the same effect) Does anybody have any idea how
> this sort of thing works? *

Do you know how files are mapped from extensions to meaning? There's a
mime-type mapping file. Generally, for Linux, this is /etc/mime.types.

Now, with Apache, these things are configurable:

http://httpd.apache.org/docs/2.2/mod/core.html#forcetype

The context is listed as "directory, .htaccess", so you can have a
directory which you *know* only contains HTML files, and with a simple
"ForceType text/html" in your .htaccess file, everything is sent as
HTML.

Plus, there are always CGI scripts. You can have what looks like a
directory actually map to a CGI script. When the conditions are right
perhaps things ending with .mp3 actually are sent as audio/mpeg, but
other times the extension doesn't matter, and the script is sending
"Content-Type: text/html". With that one line, it doesn't matter what
the extension is, it is advertising itself as an HTML page.

Is it annoying? You know it is. Is it straight-forward? Yeah, that too.
When it comes down to it, you just don't know what sort of content is
there without checking the headers.

Cheers,

--
Steven Black <blacks@indiana.edu> / KeyID: 8596FA8E
Fingerprint: 108C 089C EFA4 832C BF07 78C2 DE71 5433 8596 FA8E

[BLUG] hiding an .html link as an .mp3

So I was googling around looking for some music from old PC games I used to play and found the music from Monkey Island 2 here:

(i would NOT view this site w/out some sort of adblock installed, it is seriously annoying)


My first thought was to open up a terminal and grab them with wget like so:

wget -r -np -A.mp3 url

But it seems that although the links are listed as .mp3, they are in fact links to new pages.  For example:


is actually a new page which then has a link to the actual mp3: 


Which is a legit file this time.  I hate these kinds of sleazy sites and usually avoid them but I'm curious as to how this is actually working.  Looking through the html for the site, it looks like your standard link.  So when I tell wget to recursively scan for .mp3s it thinks it finds a match and downloads the "mp3"  (I also tried the Firefox plugin dowmthemall but it has the same effect) Does anybody have any idea how this sort of thing works?  

Ben

(as a side note, it's nice when I run into these types of sites when I'm booted into Ubuntu.  They may be annoying but I'm not worried about getting all sorts of nasty malware)

Thursday, October 22, 2009

Re: [BLUG] tftp server

On Thu, Oct 22, 2009 at 04:14:36PM GMT, Jeremy L. Gaddis [jeremy@evilrouters.net] said the following:
>
> Steven mentioned firewalling -- TFTP is one of those weird protocols.
> It'll use 69/UDP for the request, but the actual transfer will be made
> on a high, random port number, so just poking a hole for 69/UDP won't
> be enough.
>

Speaking of firewalls and 69, did you see the tanker explosion today at the
intersection of TFTP and SSMTP?

Ok sorry, that was super geeky.


--
Mark Krenz
Bloomington Linux Users Group
http://www.bloomingtonlinux.org/
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] tftp server

On Thu, Oct 22, 2009 at 9:56 AM, Barry Schatz <sorbetninja@gmail.com> wrote:
> I'm setting up a TFTP server and wanted to know which daemon you all
> recommend. My options are tftpd, tftpd-hpa, and atftpd.
> I don't need PXE support, but that might be nice in the future. I do
> need it to start via init scripts because I want to leave it disabled
> when not in use.

I run atftpd on a Debian box, but not via {x}inetd.

Steven mentioned firewalling -- TFTP is one of those weird protocols.
It'll use 69/UDP for the request, but the actual transfer will be made
on a high, random port number, so just poking a hole for 69/UDP won't
be enough.

--
Jeremy L. Gaddis
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] tftp server

You are aware that wanting to "leave it disabled when not in use" is the
canonical reason to start a service via inetd, right?

Personally, I'd go with inetd and a firewall rule to block it except
when I need it. That way if I forget to re-engage the firewall block,
whoops, it should still require specific MAC addresses, right? (IIRC,
this is how I've previously used the tftp service.)

Then again, I block any ports I'm not using, so the firewall rule would
be something I'd be doing even if I started the service from init.d.

I've used one of them before, but at this point I don't recall which one
it was, and I had a HD failure on the drive serving it. I do know it was
started via inetd. I didn't need it sitting around when I wasn't using
it. A little extra startup time (it was a slow machine) was fine to know
the process/memory overhead of running the service would be cleaned up
automatically when it wasn't needed.

Cheers,
Steven Black

On Thu, Oct 22, 2009 at 09:56:34AM -0400, Barry Schatz wrote:
> I'm setting up a TFTP server and wanted to know which daemon you all
> recommend. My options are tftpd, tftpd-hpa, and atftpd.
> I don't need PXE support, but that might be nice in the future. I do
> need it to start via init scripts because I want to leave it disabled
> when not in use.
>
> -Barry
> _______________________________________________
> BLUG mailing list
> BLUG@linuxfan.com
> http://mailman.cs.indiana.edu/mailman/listinfo/blug

_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] tftp server

I have a TFTP server running on a CentOS 5 machine. It is just plain
old tftpd. The primary usage of it is for my Cisco phones to pull
their config when they boot (Cisco SIP image to connect to Asterisk
requires tftp)

On Thu, Oct 22, 2009 at 9:56 AM, Barry Schatz <sorbetninja@gmail.com> wrote:
> I'm setting up a TFTP server and wanted to know which daemon you all
> recommend. My options are tftpd, tftpd-hpa, and atftpd.
> I don't need PXE support, but that might be nice in the future. I do
> need it to start via init scripts because I want to leave it disabled
> when not in use.
>
> -Barry
> _______________________________________________
> BLUG mailing list
> BLUG@linuxfan.com
> http://mailman.cs.indiana.edu/mailman/listinfo/blug
>

--
Kirk Gleason
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

[BLUG] tftp server

I'm setting up a TFTP server and wanted to know which daemon you all
recommend. My options are tftpd, tftpd-hpa, and atftpd.
I don't need PXE support, but that might be nice in the future. I do
need it to start via init scripts because I want to leave it disabled
when not in use.

-Barry
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Monday, October 12, 2009

Re: [BLUG] PHP ereg() question

On Mon, Oct 12, 2009 at 08:11:30PM +0000, Mark Krenz wrote:
>
> Its weird though because I would have thought the opposite would be
> true based on the comments people make about Perl (that its old and
> obfuscated). In our opinion obviously PCRE are better, but that doesn't
> really make them more obvious. I would think that given that most unix
> utilities use POSIX RE and not PCRE, that POSIX would be more standard.

You've not used a modern version of GREP. The recent GNU GREP has
support for libpcre, providing Perl Compatible Regular Expressions.

Given that SED/AWK can be replaced by Perl directly, Grep is the big
tool using Posix regular expressions -- and by default it uses Standard
Regular Expressions.

You also have to take in to account that any tools not explicitly
targetting Posix Regex actually targets Perl Compatible Regex...

> As I stated to the developers when I made my first post on PHP-DEV
> though, this wasn't about which was better, it was only about giving the
> proper amount of time (or major releases) in between announcing that
> something is deprecated and removing it. The PHP core developers think
> 1 minor release is enough warning for a major core function.

This *is* PHP we're talking about. It has a big enough footprint in the
market that it doesn't matter what they do.

How many projects will be so annoyed by it that they'll move to another
language? Probably none. Instead the folks actually running the services
will have to support crappy obsolete versions of PHP for longer periods
of time. (Just as it was only recently that PHP 4 stopped being included
in many distros.)

--
Steven Black <blacks@indiana.edu> / KeyID: 8596FA8E
Fingerprint: 108C 089C EFA4 832C BF07 78C2 DE71 5433 8596 FA8E

_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] PHP ereg() question

Its weird though because I would have thought the opposite would be
true based on the comments people make about Perl (that its old and
obfuscated). In our opinion obviously PCRE are better, but that doesn't
really make them more obvious. I would think that given that most unix
utilities use POSIX RE and not PCRE, that POSIX would be more standard.

As I stated to the developers when I made my first post on PHP-DEV
though, this wasn't about which was better, it was only about giving the
proper amount of time (or major releases) in between announcing that
something is deprecated and removing it. The PHP core developers think
1 minor release is enough warning for a major core function.


On Mon, Oct 12, 2009 at 08:00:43PM GMT, Sams, Weldon [wsams@indiana.edu] said the following:
> I agree with Steven. Also the preg functions are quite a bit faster.
>
> Weldon
>
> > -----Original Message-----
> > From: blug-bounces@cs.indiana.edu [mailto:blug-bounces@cs.indiana.edu]
> > On Behalf Of Black, Steven Wayne
> > Sent: Monday, October 12, 2009 15:53
> > To: Bloomington LINUX Users Group
> > Subject: Re: [BLUG] PHP ereg() question
> >
> > This is Extended Regular Expressions vs. Perl Compatible Regular
> > Expressions?
> >
> > I don't use PHP, so this doesn't impact me, however in general most
> > people expect Perl Compatible Regular Expressions, so I expect it will
> > clear up a number of issues.
> >
> > Cheers,
> > Steven Black
> >
> > On Mon, Oct 12, 2009 at 07:40:30PM +0000, Mark Krenz wrote:
> > >
> > > Any of you on the list use PHP? Did you know they are going to
> > remove
> > > the ereg set of functions in PHP 6 in favor of the PCRE functions
> > > (preg_match, etc.). Could I ask how do you feel about this?
> > >
> > > Thanks.
> > >
> > > --
> > > Mark Krenz
> > > Bloomington Linux Users Group
> > > http://www.bloomingtonlinux.org/
> > > _______________________________________________
> > > BLUG mailing list
> > > BLUG@linuxfan.com
> > > http://mailman.cs.indiana.edu/mailman/listinfo/blug
> >
> > _______________________________________________
> > BLUG mailing list
> > BLUG@linuxfan.com
> > http://mailman.cs.indiana.edu/mailman/listinfo/blug
>
> _______________________________________________
> BLUG mailing list
> BLUG@linuxfan.com
> http://mailman.cs.indiana.edu/mailman/listinfo/blug
>

--
Mark Krenz
Bloomington Linux Users Group
http://www.bloomingtonlinux.org/
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] PHP ereg() question

Ding ding ding. I too develop in Perl a lot and like PCRE better, but
I've been doing PHP development since 1997 and got used to using ereg()
and always thought that ereg was the more official function to use.

I've gotten into this big one-sided debate on the PHP internals mailing
list with all the core devs about how giving notice of removing the
ereg() one or two minor versions prior to PHP 6 is not enough time.
Pretty much everyone there disagrees with me and think its plenty of
time given that PHP 6 won't be out until late 2010.

Obviously none of them ever need to support PHP upgrades and don't
realize that most Linux distros don't include the latest PHP, in fact,
most of them include a version that is not supported by the PHP devs.

And amazingly enough, one guy called me a troll and now everyone is
just telling me to write a patch. Why should I have to write a patch?
Millions of people will be affected by this and they don't realize that
(or seem to care). Its really annoying and I needed to talk to some
more neutral people about it to get my bearings.

According to the people who answered "why this is happening", its
because PHP 6 will have unicode support and they don't feel like making
the changes to ereg to support unicode. Which seems incredibly
irresponsible given that PHP has hundreds of thousands of developers.


On Mon, Oct 12, 2009 at 07:59:24PM GMT, David Ernst [david.ernst@davidernst.net] said the following:
> Yeah, I learned RegExp's in perl, so whenever they aren't like perl, I
> get confused. I don't use PHP all that often, but when I do, I prefer
> the preg-style anyway. I don't know if I've ever use the ereg style.
> Having said that, I don't know why they'd have to remove it and
> require a bunch of people to have to go update existing
> code... harmless enough to leave them in, isn't it?
>
> David
>
>
> On Mon, Oct 12, 2009 at 03:53:04PM -0400, Steven Black wrote:
> >This is Extended Regular Expressions vs. Perl Compatible Regular
> >Expressions?
> >
> >I don't use PHP, so this doesn't impact me, however in general most
> >people expect Perl Compatible Regular Expressions, so I expect it will
> >clear up a number of issues.
> >
> >Cheers,
> >Steven Black
> >
> >On Mon, Oct 12, 2009 at 07:40:30PM +0000, Mark Krenz wrote:
> >>
> >> Any of you on the list use PHP? Did you know they are going to remove
> >> the ereg set of functions in PHP 6 in favor of the PCRE functions
> >> (preg_match, etc.). Could I ask how do you feel about this?
> >>
> >> Thanks.
> >>
> >> --
> >> Mark Krenz
> >> Bloomington Linux Users Group
> >> http://www.bloomingtonlinux.org/
> >> _______________________________________________
> >> BLUG mailing list
> >> BLUG@linuxfan.com
> >> http://mailman.cs.indiana.edu/mailman/listinfo/blug
> >
> >_______________________________________________
> >BLUG mailing list
> >BLUG@linuxfan.com
> >http://mailman.cs.indiana.edu/mailman/listinfo/blug
> _______________________________________________
> BLUG mailing list
> BLUG@linuxfan.com
> http://mailman.cs.indiana.edu/mailman/listinfo/blug
>

--
Mark Krenz
Bloomington Linux Users Group
http://www.bloomingtonlinux.org/
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] PHP ereg() question

I agree with Steven. Also the preg functions are quite a bit faster.

Weldon

> -----Original Message-----
> From: blug-bounces@cs.indiana.edu [mailto:blug-bounces@cs.indiana.edu]
> On Behalf Of Black, Steven Wayne
> Sent: Monday, October 12, 2009 15:53
> To: Bloomington LINUX Users Group
> Subject: Re: [BLUG] PHP ereg() question
>
> This is Extended Regular Expressions vs. Perl Compatible Regular
> Expressions?
>
> I don't use PHP, so this doesn't impact me, however in general most
> people expect Perl Compatible Regular Expressions, so I expect it will
> clear up a number of issues.
>
> Cheers,
> Steven Black
>
> On Mon, Oct 12, 2009 at 07:40:30PM +0000, Mark Krenz wrote:
> >
> > Any of you on the list use PHP? Did you know they are going to
> remove
> > the ereg set of functions in PHP 6 in favor of the PCRE functions
> > (preg_match, etc.). Could I ask how do you feel about this?
> >
> > Thanks.
> >
> > --
> > Mark Krenz
> > Bloomington Linux Users Group
> > http://www.bloomingtonlinux.org/
> > _______________________________________________
> > BLUG mailing list
> > BLUG@linuxfan.com
> > http://mailman.cs.indiana.edu/mailman/listinfo/blug
>
> _______________________________________________
> BLUG mailing list
> BLUG@linuxfan.com
> http://mailman.cs.indiana.edu/mailman/listinfo/blug

_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] PHP ereg() question

Yeah, I learned RegExp's in perl, so whenever they aren't like perl, I
get confused. I don't use PHP all that often, but when I do, I prefer
the preg-style anyway. I don't know if I've ever use the ereg style.
Having said that, I don't know why they'd have to remove it and
require a bunch of people to have to go update existing
code... harmless enough to leave them in, isn't it?

David


On Mon, Oct 12, 2009 at 03:53:04PM -0400, Steven Black wrote:
>This is Extended Regular Expressions vs. Perl Compatible Regular
>Expressions?
>
>I don't use PHP, so this doesn't impact me, however in general most
>people expect Perl Compatible Regular Expressions, so I expect it will
>clear up a number of issues.
>
>Cheers,
>Steven Black
>
>On Mon, Oct 12, 2009 at 07:40:30PM +0000, Mark Krenz wrote:
>>
>> Any of you on the list use PHP? Did you know they are going to remove
>> the ereg set of functions in PHP 6 in favor of the PCRE functions
>> (preg_match, etc.). Could I ask how do you feel about this?
>>
>> Thanks.
>>
>> --
>> Mark Krenz
>> Bloomington Linux Users Group
>> http://www.bloomingtonlinux.org/
>> _______________________________________________
>> BLUG mailing list
>> BLUG@linuxfan.com
>> http://mailman.cs.indiana.edu/mailman/listinfo/blug
>
>_______________________________________________
>BLUG mailing list
>BLUG@linuxfan.com
>http://mailman.cs.indiana.edu/mailman/listinfo/blug
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] PHP ereg() question

This is Extended Regular Expressions vs. Perl Compatible Regular
Expressions?

I don't use PHP, so this doesn't impact me, however in general most
people expect Perl Compatible Regular Expressions, so I expect it will
clear up a number of issues.

Cheers,
Steven Black

On Mon, Oct 12, 2009 at 07:40:30PM +0000, Mark Krenz wrote:
>
> Any of you on the list use PHP? Did you know they are going to remove
> the ereg set of functions in PHP 6 in favor of the PCRE functions
> (preg_match, etc.). Could I ask how do you feel about this?
>
> Thanks.
>
> --
> Mark Krenz
> Bloomington Linux Users Group
> http://www.bloomingtonlinux.org/
> _______________________________________________
> BLUG mailing list
> BLUG@linuxfan.com
> http://mailman.cs.indiana.edu/mailman/listinfo/blug

_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

Re: [BLUG] PHP ereg() question

On Mon, Oct 12, 2009 at 3:40 PM, Mark Krenz <mark@slugbug.org> wrote:
>  Any of you on the list use PHP?  Did you know they are going to remove
> the ereg set of functions in PHP 6 in favor of the PCRE functions
> (preg_match, etc.). Could I ask how do you feel about this?

I'd rather they remove PHP completely. =)

--
Jeremy L. Gaddis
http://evilrouters.net/

_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug

[BLUG] PHP ereg() question

Any of you on the list use PHP? Did you know they are going to remove
the ereg set of functions in PHP 6 in favor of the PCRE functions
(preg_match, etc.). Could I ask how do you feel about this?

Thanks.

--
Mark Krenz
Bloomington Linux Users Group
http://www.bloomingtonlinux.org/
_______________________________________________
BLUG mailing list
BLUG@linuxfan.com
http://mailman.cs.indiana.edu/mailman/listinfo/blug