sort/order by [perl or possibly postgres]

2003-03-31 Thread allan juul
hi

using a postgres db i have run into a sort order problem because i need to 
order by a varchar type field/column. 
im not aware of any function in postgres that might order the result 
set "correctly" beforehand so i guess i want to post-sort the result-set with 
perl.
i'm looking for something pretty effecient as the datastructure could be 
potentially big


[

so in the end i need this order:

1
2
3
9
10
11
11a
11b
110

]



i have got the following sql syntax and datastructure


# sql, and data structure
$sth = $dbh->prepare( "SELECT id, name, team_no from DB order by team_no" ); # 
etc.

$sth->execute();
$sth->bind_columns( undef, \$id, \$name, \$team_no);

while ( $sth->fetch ) {
$tied_hash{$team_no} = [$id, $name];
}



...

using tied_hash would currently sort something like this:

1
10
11
110
11a
11b
2
3
9


any suggestions most welcome
thanks
./allan


Re: 10.2.x, perl 5.6.1, gcc3.1? Works!

2003-03-31 Thread Michael Glaesemann
In short, it works! Read on below for details.

On Tuesday, Apr 1, 2003, at 01:22 Asia/Tokyo, John Gruber wrote:

I just went through this last night. :^)
Good to know I'm in such illustrious company! (I frequent 
DaringFireball--really enjoy it!)

What happens if you type "which gcc2" at a command prompt? The
machine I was working on had a clean install of 10.2, an upgrade to
10.2.4, and the latest developer tools. (You have installed the
developer tools, right?)
Yup. Right after the install. And which gcc2 informed me that I do 
indeed have gcc2 right where you said it should be! /usr/bin/gcc2

Yesterday when I came across the notes about using gcc2, I did 'gcc2 
-v' in the shell and got nothing. And I did try configuring with the 
-Dcc=gcc2 switch, but I still got the same error.

Since yesterday I've upgraded from OS X 10.2.1 to 10.2.4, and I 
replaced hints/darwin.sh with Wilfredo Sanchez' October 2002 version. I 
also omitted the "perl -i.bak -p -e 's|Local/Library|Library|g' 
hints/darwin.sh line, thinking Mr. Sanchez had taken this into account. 
(I tried comparing the differences in BBEdit between the stock 
darwin.sh and Mr. Sanchez' version to see if indeed he had, but I'm 
still learning how to read both the "perl -i.bak " line and the sh 
files.)

My skills still need lots and lots of polishing, so I'm pretty sure I'm 
responsible for yesterday's failure--though I thought I had nailed down 
the gcc thing when I couldn't get a version number for gcc2 and I got 
the same compile error when I used the gcc2 flag. Live and learn, eh? :)

Today everything worked fine the first time and I now get "This is 
perl, v5.6.1 built for darwin" when I perl -v. Joy!

Now on to the perl modules (DBI, DBD::Pg and others via CPAN) and see 
if I can't get
Movable Type to work with Postgresql! The adventure continues.

Hope this helps.
Definitely did. Reassured me that it was possible and taught me the 
which command!  (I am learning a lot these days! And the list archives 
have been really helpful.) Thanks for your help, John, and all of you 
who've posted other tips that got me this far.

Michael Glaesemann
grzm myrealbox com


Re: 10.2.x, perl 5.6.1, gcc3.1?

2003-03-31 Thread John Gruber
Michael Glaesemann <[EMAIL PROTECTED]> wrote on 3/31/03 at 11:25p:

> Hello! I'm trying to install perl 5.6.1 on my Mac running 10.2.x

I just went through this last night. :^)


> I keep getting
>  make: *** No rule to make target `', needed by 
> `miniperlmain.o'.  Stop.

Yup.


> I've been following the instructions posted by Ray Zimmerman
> 
> and David Wheeler 
> with the variation to use the gcc2 compiler
> 
> (exact same "no rule to make target" error back in October 2002.)
> but of course that didn't work because I don't have a gcc2 compiler. 

Are you sure you don't? You should have gcc2 here:

/usr/bin/gcc2

What happens if you type "which gcc2" at a command prompt? The
machine I was working on had a clean install of 10.2, an upgrade to
10.2.4, and the latest developer tools. (You have installed the
developer tools, right?)

I got 5.6.1 to install cleanly (where by "cleanly", I mean with the
small handful of known test failures mentioned in the above
articles).

As per the aforementioned message to this list from Errol
Lewthwaite, all I needed to do was follow these instructions:

http://duke.usask.ca/~dalglb/macosx/Perl_5.6.html

*and* add -Dcc=gcc2 to the Configure switches:

sudo sh Configure -des -Dfirstmakefile=GNUmakefile \
-Dldflags="-flat_namespace" -Dcc=gcc2

Hope this helps.

-- 
John Gruber |   Daring Fireball: Mac Punditry and Curmudgeonry
[EMAIL PROTECTED]   |http://daringfireball.net


10.2.x, perl 5.6.1, gcc3.1?

2003-03-31 Thread Michael Glaesemann
Hello! I'm trying to install perl 5.6.1 on my Mac running 10.2.x (right 
now it's 10.2.1, but that will change in a couple of hours, when I 
should be back up to 10.2.4), but there seems to be an incompatibility 
between perl 5.6.1 and the gcc3.1 compiler that comes with the December 
2002 Developer Tools. I keep getting
make: *** No rule to make target `', needed by 
`miniperlmain.o'.  Stop.

I've been following the instructions posted by Ray Zimmerman

and David Wheeler 
with the variation to use the gcc2 compiler

(exact same "no rule to make target" error back in October 2002.)
but of course that didn't work because I don't have a gcc2 compiler. 
I'd rather not install a gcc2 compiler because I've heard of other 
incompatibilities with binaries compiled under the two different 
compilers.

Searching for "perl 5.6.1" and "gcc3.1" under google brought me to a 
posted patch for linux.
< http://archive.develooper.com/[EMAIL PROTECTED]/msg84893.html>
It appears the Ken William's fink installation includes a similar patch.
< http://archive.develooper.com/[EMAIL PROTECTED]/msg04611.html>
I'd rather compile it myself and keep it in it's own directories 
parallel to the 5.6.0 installation.

Is there a way I can use the patch supplied with the Ken William's fink 
installation during my own compile? If so, where I can look to find how 
to do this? Or maybe there's a way to modify the fink installation to 
install where I'd like it to?

Thanks in advance for any advice or pointers of where to look for more 
information.

Michael Glaesemann
grzm myrealbox com


Re: copy files with everything?

2003-03-31 Thread Peter N Lewis
At 9:16 +0200 31/3/03, Wischnewski, Berndt wrote:

copies just the file, but the resulting test2.doc has lost the icon, 
file type and creator. I think there must be a way, which I simply 
dont now.
/Developer/Tools/CpMac

usage: CpMac [-r] [-p] [-mac]  
   CpMac [-r] [-p] [-mac] ... 
Enjoy,
   Peter.
--