[OT] Struggling with EWS::Client
I have an idea for a side-project, but because I hate myself it involves trying to use information held in an Exchange Calendar. Being the most up to date, I've tried using EWS::Client [I've tried other modules, but they all dislike me too]. The version I'm using is 1.143070 I just can't get over the first hurdle. ➔ cat owa.pl #!/usr/bin/env perl use strict; use warnings; use Test::More; use EWS::Client; use DateTime; my $ews = EWS::Client-new({ server = 'hostname from OWA', username= 'c.wright', #set in $ENV{EWS_PASS} use_negotiated_auth = 1, }); isa_ok($ews,'EWS::Client'); my $cal = $ews-calendar; isa_ok($cal, 'EWS::Client::Calendar'); my $entries = $cal-retrieve({ start = DateTime-now(), end = DateTime-now()-add( months = 3 ), }); isa_ok($entries, 'EWS::Calendar::ResultSet'); done_testing; Gives: perl owa.pl ok 1 - An object of class 'EWS::Client' isa 'EWS::Client' ok 2 - An object of class 'EWS::Client::Calendar' isa 'EWS::Client::Calendar' Can't use an undefined value as an ARRAY reference at /Users/c.wright/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0/EWS/Calendar/Role/RetrieveWithinWindow.pm line 12. # Tests were run but no plan was declared and done_testing() was not seen. # Looks like your test exited with 255 just after 2. The line with the error is here: https://metacpan.org/source/OLIVER/EWS-Client-1.143070/lib/EWS/Calendar/Role/RetrieveWithinWindow.pm#L12 Using Data::Printer on $kind and $response give me: ➔ perl owa.pl ok 1 - An object of class 'EWS::Client' isa 'EWS::Client' ok 2 - An object of class 'EWS::Client::Calendar' isa 'EWS::Client::Calendar' FindItem \ {} Can't use an undefined value as an ARRAY reference ... I've tried stepping through with the debugger on previous attempts, but didn't have much luck. Has anyone had any success or experience with this module. Or know of a simple, reliable way to query calendar information in an Exchange server? Thanks all! -- Chisel e: chi...@chizography.net w: http://chizography.net
Re: CVE-2013-1667: important rehashing flaw
On Tue, Mar 12, 2013 at 8:58 AM, Leo Lapworth l...@cuckoo.org wrote: All updated now Thanks for doing this makes my prep-work much easier at $work. I've just stumbled across http://www.cpan.org/src/README.html which says: Latest releases in each branch of Perl Major Version Type Released Download 5.14 5.14.4 Devel 2013-03-07 perl-5.14.4-RC2.tar.gz 5.16 5.16.3 Maint 2013-03-11 perl-5.16.3.tar.gz 5.14 5.14.4 Maint 2013-03-10 perl-5.14.4.tar.gz To me it looks odd having the RC2 there ... should that be dropped until there is (another) release candidate? -- Chisel e: chi...@chizography.net w: http://chizography.net
Re: Beware: NET-A-PORTER
Hi there, I'm an employee at NET-A-PORTER. I've been asked to forward the response from our head of recruitment, which I've pasted in full below. I've also posted this to the Perl Jobs discussion list. (I was unable to continue the thread there as I wasn't a member of that list until earlier today.) Regards, Chisel cut here Hi Rudolf, I’m James and I head up the recruitment team for the NET-A-PORTER Group of businesses; I’d like to start by apologizing for this situation. I truly understand how frustrating and isolating the interview process can be: we try to stay in close contact with all candidates interviewing for roles within our organization, wherever possible we try to avoid using third party recruiters, as so often our message becomes occluded and things inevitably get ‘lost in translation’. I am very disappointed that much of what the recruiter has told you is incorrect; I would welcome the opportunity to speak with you directly to try to resolve this situation. I will also be speaking to the Recruitment Agency separately about this. For everyone else that has contributed to the discussion please understand that whilst we do partner with third party recruiters from time to time we have little or no control over what individual agents might purportedly say on our behalf, which is why we always encourage you to speak to members of our team directly – many of our developers are active within the community. We are deeply committed to the on-going development of Perl; both internally and within the wider community. You can find out more, or reach our recruitment team directly, via www.net-a-porter.com/careers Many thanks, James James Hudson Global Recruitment Manager NET-A-PORTER LTD 1 The Village Offices Westfield London Shopping Centre Ariel Way London W12 7GF (T) +44 0203 471 4589 (M) +44 7884 250 784 cut here
Re: Beware: NET-A-PORTER
On Fri, Dec 9, 2011 at 4:07 PM, Rudy Lippan rlip...@remotelinux.com wrote: I just saw your email, and I am fine with that. I await their response. I've shared NAPs response in this thread and on the Perl Jobs discussion list. [ http://london.pm.org/pipermail/london.pm/Week-of-Mon-20111205/021773.html ] [ Nothing showing in http://www.mail-archive.com/jobs-discuss@perl.org/maillist.html yet ] If you have any problems getting hold of James please let me know. Chisel -- Chisel e: chi...@chizography.net w: http://chizography.net
Exiting eval via next [perl v5.14]
Why is this considered 'bad'? There's some confusion over whether or not this is new, or has just surface because we've started using use warnings FATAL = 'all'; in some modules at $employer. (I suspect it's been warning for some time and we've never noticed.) $ perl -M5.14.0 -wle 'for my $i (qw/foo/) { eval { next; $i.=q{} }; } say done' Exiting eval via next at -e line 1. done perl -M5.14.0 -wle 'for my $i (qw/foo/) { eval { next; }; } say done' Exiting eval via next at -e line 1. done # why no error?! $ perl -M5.14.0 -wle 'for my $i (qw/foo/) { eval { $i.=q{}; next; }; } say done' done What's the 'correct' way to exit the for loop? -- Chisel e: chi...@chizography.net w: http://chizography.net
v0.6 != v0.6.0 ?
Is this expected behaviour? I get lost in what versions should and shouldn't numify. It definitely doesn't DWIM. ➔ perl -Mversion -le '$big=version-new(0.6.99); $small=version-new(0.6); print $big; print $small; print $big$small ? ok:wuh?' 0.6.99 0.6 wuh? ➔ perl -Mversion -le '$big=version-new(0.6.99); $small=version-new(0.6.0); print $big-numify; print $small; print $big$small ? ok:wuh?' 0.006099 0.6.0 ok ➔ perl -Mversion -le '$big=version-new(0.6.99); $small=version-new(0.6); print $big-numify; print $small-numify; print $big$small ? ok:wuh?' 0.006099 0.600 wuh? -- Chisel e: chi...@chizography.net w: http://chizography.net
Re: Perl-friendly message queue-like system
On Thu, Sep 22, 2011 at 9:15 AM, Martin A. Brooks mar...@antibodymx.netwrote: My Google-fu is failing me, what Perl-friendly system might I use for such a thing? If it's definitely perl-only, and will never talk to anything else, you might want to consider TheSchwartz: https://metacpan.org/release/TheSchwartz Or one of its close relatives: https://metacpan.org/module/TheSchwartz::Simple https://metacpan.org/module/TheSchwartz::Moosified We've used TheSchwartz in production for about two years and haven't had any problems with the module. -- Chisel e: chi...@chizography.net w: http://chizography.net
Re: [ANNOUNCE] Croyden.pm
On Mon, Jul 18, 2011 at 5:02 PM, David Cantrell da...@cantrell.org.ukwrote: There will be a Gathering of Croyden.pm at the Royal Standard in Croydon on Wednesday the 20th of July. I have to ask ... Croyd*e*n.pm? -- Chisel e: chi...@chizography.net w: http://chizography.net
perlbrew and Image::Magick
I don't know if it's perlbrew specific, or just a good way to encounter the problem but I'm stumped. I'm seeing the same thing with a 5.12.2 and 5.12.3 brewed perl; everything's under Ubuntu or Linux Mint. If anyone has any ideas or suggestions to what I've done wrong, or how to Make It Work I'd really appreciate them. Suggestions to 'use something else' will be more helpful if I know what the 'something else' should be. I'd need drop-in or not-to-hard-to-write replacements for: * Catalyst::Plugin::Upload::Image::Magick * Catalyst::Plugin::Upload::Image::Magick::Thumbnail I'm mostly using is_image() and scaling features. I've pasted lots of technical stuff below so people can see what I've done so far. Chiz __DATA__ ➔ cpanm Image::Magick -- Working on Image::Magick Fetching http://search.cpan.org/CPAN/authors/id/J/JC/JCRISTY/PerlMagick-6.67.tar.gz... OK Configuring PerlMagick-6.67 ... OK Building and testing PerlMagick-6.67 ... FAIL ➔ more /home/chisel/.cpanm/build.log cpanm (App::cpanminus) 1.4004 on perl 5.012002 built for x86_64-linux Work directory is /home/chisel/.cpanm/work/1302124855.30513 You have make /usr/bin/make You have LWP 5.837 You have /bin/tar: tar (GNU tar) 1.25 Copyright © 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by John Gilmore and Jay Fenlason. You have /usr/bin/unzip Searching Image::Magick on cpanmetadb ... -- Working on Image::Magick Fetching http://search.cpan.org/CPAN/authors/id/J/JC/JCRISTY/PerlMagick-6.67.tar.gz - OK Unpacking PerlMagick-6.67.tar.gz Entering PerlMagick-6.67 META.yml not found or unparsable. Fetching META.yml from search.cpan.org Configuring PerlMagick-6.67 Running Makefile.PL Checking if your kit is complete... Looks good Note (probably harmless): No library found for -lm Writing Makefile for Image::Magick - OK Finding PREREQ from Makefile ... Building and testing PerlMagick-6.67 cp Magick.pm blib/lib/Image/Magick.pm AutoSplitting blib/lib/Image/Magick.pm (blib/lib/auto/Image/Magick) /home/chisel/perl5/perlbrew/perls/perl-5.12.2/bin/perl /home/chiz/perl5/perlbrew/perls/perl-5.12.2/lib/5.12.2/ExtUtils/xsub pp -typemap /home/chiz/perl5/perlbrew/perls/perl-5.12.2/lib/5.12.2/ExtUtils/typemap Magick.xs Magick.xsc mv Magick.x sc Magick.c cc -c -I/usr/include/ImageMagick -I../ -I.. -I/usr/include/ImageMagick -I/usr/include/ImageMagick -fopenmp -fopenmp -g -O2 -Wall -pthread -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BIT S=64 -O2 -DVERSION=\6.6.7\ -DXS_VERSION=\6.6.7\ -fPIC -I/home/chiz/perl5/perlbrew/perls/perl-5.12.2/lib/5.12.2/x86_6 4-linux/CORE -D_LARGE_FILES=1 -DHAVE_CONFIG_H Magick.c Magick.xs: In function ‘XS_Image__Magick_Smush’: Magick.xs:13519:5: warning: implicit declaration of function ‘SmushImages’ Magick.xs:13519:10: warning: assignment makes pointer from integer without a cast Running Mkbootstrap for Image::Magick () chmod 644 Magick.bs rm -f blib/arch/auto/Image/Magick/Magick.so LD_RUN_PATH=/usr/lib cc -L../magick/.libs -lMagickCore -shared -O2 -L/usr/local/lib -fstack-protector Magick.o -o blib/ arch/auto/Image/Magick/Magick.so \ -lMagickCore -lperl \ /usr/bin/ld: cannot find -lperl collect2: ld returned 1 exit status make: *** [blib/arch/auto/Image/Magick/Magick.so] Error 1 - FAIL Installing Image::Magick failed. See /home/chisel/.cpanm/build.log for details. [2003][chisel@metropolis:PerlMagick-6.67-EzIQo2]➔ LD_RUN_PATH=/usr/lib cc -L../magick/.libs -lMagickCore -shared -O2 -L/usr/local/lib -fstack-protector Magick.o -o blib/arch/auto/Image/Magick/Magick.so -lMagickCore -lperl -L/home/chiz/perl5/perlbrew/build/perl-5.12.2 /usr/bin/ld: /home/chiz/perl5/perlbrew/build/perl-5.12.2/libperl.a(op.o): relocation R_X86_64_32S against `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC /home/chiz/perl5/perlbrew/build/perl-5.12.2/libperl.a: could not read symbols: Bad value collect2: ld returned 1 exit status ➔ perl -V Summary of my perl5 (revision 5 version 12 subversion 2) configuration: Platform: osname=linux, osvers=2.6.35-22-generic, archname=x86_64-linux uname='linux metropolis 2.6.35-22-generic #34-ubuntu smp sun oct 10 09:26:05 utc 2010 x86_64 gnulinux ' config_args='-de -Dprefix=/home/chiz/perl5/perlbrew/perls/perl-5.12.2' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -fstack
ActiveMQ Magical Mystery Tour - The 4096 Edition
- Sending: CONNECTED session:ID:svc-oct.dave.net-a-porter.com-59936-1288280088467-3:180025 3.3.3 No SEND message If the SEND message is omitted then the DISCONNECT message is successfully received. 2010-11-03 15:20:21,397 [10.0.0.1:57197 http://10.5.0.58:57197] TRACE StompTransportFilter - Received: CONNECT passcode:there login:hello 2010-11-03 15:20:21,397 [10.0.0.1:57197 http://10.5.0.58:57197] TRACE StompTransportFilter - Sending: CONNECTED session:ID:svc-oct.dave.net-a-porter.com-59936-1288280088467-3:180026 2010-11-03 15:20:21,398 [10.0.0.1:57197 http://10.5.0.58:57197] TRACE StompTransportFilter - Received: DISCONNECT 3.3.4 Pause between SEND and DISCONNECT Inserting a 0.5 second pause between the SEND and DISCONNECT messages results in both messages being successfully processed. With this pause in place all SEND payloads are successfully enqueued, regardless of size. CONNECT passcode:there login:hello 2010-11-03 15:27:52,471 [10.0.0.1:53576 http://10.5.0.58:53576] TRACE StompTransportFilter - Sending: CONNECTED session:ID:svc-oct.dave.net-a-porter.com-59936-1288280088467-3:180053 2010-11-03 15:27:52,472 [10.0.0.1:53576 http://10.5.0.58:53576] TRACE StompTransportFilter - Received: SEND destination:/queue/mjr.queue.thing 2010-11-03 15:27:52,522 [10.0.0.1:53576 http://10.5.0.58:53576] TRACE StompTransportFilter - Received: DISCONNECT 4 TCP Traffic 4.1 TCP stream of failed messages SEND message with payload of 4096 characters long. The TCP traffic trace (via wireshark) shows the TCP stream ending in the middle of the SEND payload. This conversation stops after 4055 characters of the SEND payload. CONNECT passcode:there login:hello .CONNECTED session:ID:svc-oct.dave.net-a-porter.com-59936-1288280088467-3:180055 . SEND destination:/queue/mjr.queue.thing xxx… - [ends here with no null byte] 4.2 TCP stream of successful messages SEND message with payload of 100 characters. The TCP traffic trace shows the TCP stream including the complete SEND command with a terminating null byte, however, the DISCONNECT command is never sent. CONNECT passcode:there login:hello .CONNECTED session:ID:svc-oct.dave.net-a-porter.com-59936-1288280088467-3:180055 . SEND destination:/queue/mjr.queue.thing xxx…. 4.3 TCP stream of messages with pause SEND message with payload of 4096 characters. Insert 0.5 second pause between the SEND and DISCONNECT messages. The TCP traffic trace shows the TCP stream including the complete SEND and DISCONNECT commands and the corresponding null terminators. CONNECT passcode:there login:hello .CONNECTED session:ID:svc-oct.dave.net-a-porter.com-59936-1288280088467-3:180062 . SEND destination:/queue/mjr.queue.thing xxx….DISCONNECT . 5 AMQ broker log 5.1 Exception on Stomp message Exception appears to be generated on *every* stomp message whether enqueuing at the broker is successful or not. java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:50) at org.apache.activemq.transport.tcp.TcpTransport$2.fill(TcpTransport.java:527) at org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:58) at org.apache.activemq.transport.tcp.TcpTransport$2.read(TcpTransport.java:512) at java.io.DataInputStream.readByte(DataInputStream.java:248) at org.apache.activemq.transport.stomp.StompWireFormat.unmarshal(StompWireFormat.java:157) at org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:211) at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:203) at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:186) at java.lang.Thread.run(Thread.java:619) Author: Matthew Ryall matt.ry...@net-a-porter.commatt.ry...@net-a-porter.com Date: Day 3 of week 44 of 2010 -- Chisel e: chi...@chizography.net w: http://chizography.net
Re: Perl 5.12 Reference Manual
On Mon, Oct 11, 2010 at 7:29 PM, Steve Mynott st...@gruntling.com wrote: http://www.network-theory.co.uk/perl/language/ Print out of perldoc with $1 to Perl Foundation. £30? I think I'll stick to typing perldoc in my terminal window... -- Chisel e: chi...@chizography.net w: http://chizography.net
Re: London.pm Roast Duck Gold Mine Thursday 1pm
Léon Brocard wrote: After trying the roast duck at Four Seasons, it's time to go a few restaurants down the road and try it at Gold Mine. Which restaurant will be deemed London.pm's favourite roast duck place? London.pm dim sum is a social event where we meet up every Thursday at 1pm at a different Chinese restaurant, spend about an hour (and about £10 cash) eating tasty dim sum (steamed and fried dumplings), then go our separate ways. Duck Thursdays ... like Dim Sum Thursdays except we eat duck, not dim sum. Chiz -- Chisel Wright e: chi...@herlpacker.co.uk w: http://www.herlpacker.co.uk/ It's just a motivational meeting. I don't care if I miss it.
Re: PARing autobox has me stumped
On Wed, Aug 12, 2009 at 04:53:52PM +1000, Toby Wintermute wrote: On Ubuntu 8.10 and 9.04, that returns a list that includes autobox.pm and autobox.so. Just to confuse things further ... not for me: chi...@zombie:tmp$ pp -p -o test.par test.pl chi...@zombie:tmp$ unzip -l test.par Archive: test.par Length Date TimeName 0 08-12-09 16:04 script/ 433 08-12-09 16:04 MANIFEST 215 08-12-09 16:04 META.yml 272 08-12-09 16:04 script/main.pl 29 08-12-09 16:04 script/test.pl --- 949 5 files chi...@zombie:tmp$ cat /etc/issue Ubuntu 9.04 \n \l -- Chisel Wright e: chi...@herlpacker.co.uk w: http://www.herlpacker.co.uk/ Ubuntu is an old African word which means: I can't configure Debian
Re: PARing autobox has me stumped
On Wed, Aug 12, 2009 at 04:06:56PM +0100, Chisel Wright wrote: Just to confuse things further ... not for me: Of course I get different results after actually installing autobox: chi...@zombie:tmp$ unzip -l test.par Archive: test.par Length Date TimeName 0 08-12-09 17:40 lib/ 0 08-12-09 17:40 script/ 542 08-12-09 17:40 MANIFEST 215 08-12-09 17:40 META.yml 15452 08-12-09 17:40 lib/Cwd.pm 629 08-12-09 17:40 lib/File/Spec.pm 7749 08-12-09 17:40 lib/File/Spec/Unix.pm 675 08-12-09 17:40 lib/Scope/Guard.pm 0 11-05-08 03:36 lib/auto/Cwd/Cwd.bs 13660 11-05-08 03:36 lib/auto/Cwd/Cwd.so 272 08-12-09 17:40 script/main.pl 29 08-12-09 17:40 script/test.pl --- 39223 12 files -- Chisel Wright e: chi...@herlpacker.co.uk w: http://www.herlpacker.co.uk/ Always move fast - you never know who's catching up!
Re: setting up a file hierarchy
On Tue, May 19, 2009 at 04:33:06PM +0100, David Cantrell wrote: I'll pay attention when it doesn't rely on Module::Install. Should I ask why? -- Chisel Wright e: chi...@herlpacker.co.uk w: http://www.herlpacker.co.uk/ I like to photograph people naked, but they usually ask me to get dressed again as it's not a pretty sight.
Re: system() with timeout
On Fri, Apr 17, 2009 at 11:25:54AM +0100, Matt Lawrence wrote: I haven't had a chance to test any of this on the latest perl, 5.8.8 is the latest I've tried it with. Odd, I'm on 5.8.8 and don't seem to be seeing the same behaviour: $ perl sigdie.pl [1] 14327 $ ps -Fp 14327 UIDPID PPID CSZ RSS PSR STIME TTY TIME CMD cwright 14327 1335 99 1097 1436 0 12:01 pts/11 00:00:08 perl sigdie.pl ... $ ps -Fp 14327 UIDPID PPID CSZ RSS PSR STIME TTY TIME CMD cwright 14327 1335 98 1097 1436 0 12:01 pts/11 00:00:53 perl sigdie.pl Oooh, but interestingly, if I chmod the script and run it: $ chmod 0755 sigdie.pl $ ./sigdie.pl [1] 14421 $ ps -Fp 14421 UIDPID PPID CSZ RSS PSR STIME TTY TIME CMD cwright 14421 1335 94 3404 10384 0 12:03 pts/11 00:00:06 /usr/bin/perl ./sigdie.pl ... $ ps -Fp 14421 UIDPID PPID CSZ RSS PSR STIME TTY TIME CMD cwright 14421 1335 98 12863 48308 0 12:03 pts/11 00:00:35 /usr/bin/perl ./sigdie.pl -- Chisel Wright e: chi...@herlpacker.co.uk w: http://www.herlpacker.co.uk/ You're the font of all knowledge? It's just a shame someone pulled the plug.
Re: system() with timeout
On Fri, Apr 17, 2009 at 12:30:17PM +0100, Matt Lawrence wrote: I've just verified that both cases leak on my system. Is it definitely the same version of perl in each case? Good point. perl == /opt/.../bin/perl It's compiled in-house, v5.8.8 /usr/bin/perl is the system perl: 5.10.0-11.1ubuntu2.2 and does increase in size. -- Chisel Wright e: chi...@herlpacker.co.uk w: http://www.herlpacker.co.uk/ Screenie or it didn't happen.
Re: Empty Hash Values
On Sun, Apr 12, 2009 at 06:54:55PM +0100, Nigel Peck wrote: The only way round this I've found is to concatenate an empty string: I tend to use: element_2 = ($var || undef), Again, I'm sure there's a better way too ... it just hasn't come to me yet. -- Chisel Wright e: chi...@herlpacker.co.uk w: http://www.herlpacker.co.uk/ Stop pedanting. All nouns can be verbed.
Re: How we see CVs
On Mon, Apr 06, 2009 at 07:30:40PM +1000, Toby Wintermute wrote: Wow, sounds like something that would have come out of a certain Clerkenwell-based Digital marketing agency I worked for some years ago.. Some people just can't be told, although it's sad that it's still so common from so many sources :( I'm sure the techies worked very hard to make sure that happened as little as possible though. :-) Chiz -- Chisel Wright e: chi...@herlpacker.co.uk w: http://www.herlpacker.co.uk/ Ubuntu is an old African word which means: I can't configure Debian
Re: ExtUtils::Installed vs pminst vs?
On Mon, Apr 06, 2009 at 09:29:29PM +0100, Paul LeoNerd Evans wrote: Any ideas what this is about? I don't want to depend on this, if the smoketesters can't install it... Presumably something to do with Matt's last reply? but I've just noticed is that the CPAN shell doesn't seem to be able to see it any more Chisel -- Chisel Wright e: chi...@herlpacker.co.uk w: http://www.herlpacker.co.uk/ Remember kids: MySQL only looks like a database.
Re: Introduction to Perl for non-programming Mac folk
On Tue, Dec 23, 2008 at 12:16:54PM +, Peter Corlett wrote: On Mon, Dec 22, 2008 at 01:32:20PM +, Andy Wardley wrote: [...] * Knowing where to look for documentation and how to read it. Anything I've missed? A big lump of clue-by-four to reiterate that last point, applied repeatedly until it registers, or until they stop pestering you to give the answers on a plate. I don't this should be limited to Mac folk. -- Chisel Wright e: chi...@herlpacker.co.uk w: http://www.herlpacker.co.uk/ You can simulate the effect of buying a boat by standing in a cold shower while tearing up twenty pound notes...
Re: London.pm Dim sum Thursday 1pm: Pearl Liang
On Thu, Nov 06, 2008 at 09:19:15AM +, Léon Brocard wrote: 2008/11/4 Léon Brocard [EMAIL PROTECTED]: Thursday 1pm Pearl Liang 8 Sheldon Square London W2 6EZ Paddington Station Tube Station http://maps.google.co.uk/maps?q=W26EZ http://london.randomness.org.uk/wiki.cgi?Pearl_Liang%2C_W2_6EZ http://www.pearlliang.co.uk/ It's quite hard to find: be sure to check Getting here on the link above. This is today! Who's coming? I think I should make an effort. -- Chisel Wright e: [EMAIL PROTECTED] w: http://www.herlpacker.co.uk/ It's like ingenuity wrapped in stupidity wrapped in a function.
Re: DBIx::Class - Related Tables
On Tue, Oct 07, 2008 at 12:08:03PM +0100, Raphael Mankin wrote: The problem here is not with the ORM but rather that you are breaking the MVC separation and putting controller logic in the view. A good ORM would have its data cached so that your test might not require two SQL queries. However, the template is, in this instance, the wrong place to put the test. I'm sure someone more knowledgeable can confirm, but I think the ORM known as DBIC does indeed Cache Stuff. Yes, I know DBIC is not the only ORM. -- Chisel Wright e: [EMAIL PROTECTED] w: http://www.herlpacker.co.uk/ For this and the answers to many other questions don't ask me.
Re: Siesta party
On Thu, Aug 14, 2003 at 02:03:17PM +0200, Elizabeth Mattijsen wrote: Hmmm... PerlIO::via::backwards? Or (assuming vim as the mutt editor used): select lines, then !rev :) -- e: [EMAIL PROTECTED] | Sackings will continue until morale w: http://www.herlpacker.co.uk/ | improves. gpg: D167E7FE |
fork()ing in perl
I've got a colleague here in the orifice, and between us we know how to use fork() but don't understand it as well as we'd like. There's a parent process that does a nice chunky select from a database, does other bits and pieces, and becomes a large process (around 70Mb). Then it forks off little kiddie processes. These all seem to have the same size/footprint as the parent. The parent allocates subsets of a big data chunk to each child. So the children undef some of the bloaty variables they inherited from the parent. They still appear to be the same size! Can anyone out there explain: 1. what's happening 2. how we make the kiddies smaller 3. point me at information on the web. I've STFWd already, but couldn't find anything. TIA Chisel -- e: [EMAIL PROTECTED] | They asked how many employees we had, w: www.herlpacker.co.uk | broken down by sex. Told them drugs gpg: D167E7FE | and alcohol was more of a problem.
regexps
Just how you you pronounce 'regexps'? Personally I don't because I keep tripping over my tongue. Is it r-egg-eckps, rej-eckps or something more pronouncable? Inquiring monds want to know. Chiz -- e: [EMAIL PROTECTED] | They asked how many employees we had, w: www.herlpacker.co.uk | broken down by sex. Told them drugs gpg: D167E7FE | and alcohol was more of a problem.
Re: regexps
On Fri, Jul 18, 2003 at 04:44:10PM +0100, Joel Bernstein wrote: HTH, HAND ;) Helps a bit, but I'd like to pronounce the title of this article please: http://www.perl.com/pub/a/2003/07/01/regexps.html -- e: [EMAIL PROTECTED] | They asked how many employees we had, w: www.herlpacker.co.uk | broken down by sex. Told them drugs gpg: D167E7FE | and alcohol was more of a problem.
Text::CSV_XS
I've had a quick google and can't find anything mentioned out there, so I thought I'd ask the other hackers out there if they've had any problems with Text::CSV_XS. Let me explain; I've got a text file, where the fields are TAB-separated, and there isn't any quoting (or more precisely quotes aren't supposed to be special in any way). So for example: onetabtwotabthree Should give me three fields: one two three The code I'm using to read and parse this is: cut here #!/usr/bin/perl -w use strict; use IO::File; use Text::CSV_XS; use Data::Dumper; my ($csv, $io, $columns); $csv = Text::CSV_XS-new({ 'binary'= 1, 'sep_char' = \t, 'quote_char'= undef, }); $io = new IO::File testquote.csv; if (not defined $io) { warn can't open IO for testquote.csv: $!; return undef; } while ($columns = $csv-getline($io)) { # when there are no columns we've read the file # Text::CSV_XS is a bit pants when it reaches the end of the file last if not scalar @$columns; print Dumper($columns); $csv-combine(@$columns); print $csv-string, \n; } cut here and a representation of the file I'm testing with is: cut here onetabtwotabthree onetabtwotabthree onetabtwotabthree fake line my onetabtwotabthree cut here THe output I'm getting is a little worrying: cut here $VAR1 = [ 'one', 'two', 'three' ]; one two three $VAR1 = [ 'one', 'two three' ]; one two three $VAR1 = [ 'one two three fake line' ]; one two three fake line $VAR1 = [ 'my one', 'two', 'three' ]; my one two three cut here All of these (with the exception of fake line) should have three fields. As you can see this isn't the case. Has anyone else experienced this? Is it a bug in Text::CSV, or have I inadvertently created a non-CSV that looks a lot like one? Once again, input and comments most appreciated, Chisel -- e: [EMAIL PROTECTED] | They asked how many employees we had, w: www.herlpacker.co.uk | broken down by sex. Told them drugs gpg: D167E7FE | and alcohol was more of a problem.
Re: Text::CSV_XS
On Fri, Jul 04, 2003 at 06:02:23PM +0200, Robin Berjon wrote: The default escape char is , have you tried to set it to undef or the empty string? It looks as if it's escaping \t and \n setting escape_char to undef seems to do exactly what I was expecting it to do before. why didn't I try that earlier? (probably because RTFMing didn't make the difference clear to me) Chisel -- e: [EMAIL PROTECTED] | They asked how many employees we had, w: www.herlpacker.co.uk | broken down by sex. Told them drugs gpg: D167E7FE | and alcohol was more of a problem.
Re: Text::CSV_XS
On Fri, Jul 04, 2003 at 06:54:52PM +0200, Robin Berjon wrote: I thought about it because CSV is a terrible, terrible format and I got bitten by it badly much more than once. Baah. For tiny databases, DBD::SQLite is *much* better. Heck, as much as I bitch about people misusing XML for a small table I'd use XML over CSV any day. At least if some guy starts dumping Latin-9 in your nice UTF-8 it'll blow up instead of feeding junk to your application. Well, I'm receiving data from 'an external source'. It's going into a database at my end. I've only just dipped my perl-toes into the XML water myself, so I wasn't familair enough with it to force the external source to transfer data in XML. Anyway, since I got to choose the format this time, at least I chose tab-delimited (since the data should never contain tabs), as opposed to their format which was pipe-delimited, with no restrictions on text fields. I had some fun populating fields with the pipe character. :) Cheers for your help, Chisel -- e: [EMAIL PROTECTED] | They asked how many employees we had, w: www.herlpacker.co.uk | broken down by sex. Told them drugs gpg: D167E7FE | and alcohol was more of a problem.
Re: Magazines
On Wed, Jul 02, 2003 at 10:49:35AM +0100, Dean Wilson wrote: The TPJ however is still going, does anyone here subscribe to it and is it worth the cash? (I know its not that much.) I subscribe. I think it's $1/issue or something silly. I find it to be an interesting read, and it sometimes makes me think about old things in a new way, or just makes me think about new things. It'll be a real shame it TPR has fizzled out, I quite enjoyed that too. Profanity is the one language all programmers understand Or the first attempt by $website to print this for me: http://tinyurl.com/ftfz :-( -- e: [EMAIL PROTECTED] | They asked how many employees we had, w: www.herlpacker.co.uk | broken down by sex. Told them drugs gpg: D167E7FE | and alcohol was more of a problem.
DBD::Pg - insert_id
Sorry to pollute the list with a non-Buffy post, I'm a bit stumped. I regularly work with mysql and postgres databases. I use the DBD::mysql and DBD::Pg modules for this work, via DBI. One piece of functionality I can't find in the postgres database interface is the equivalent of: $sth-{'mysql_insertid'} I've searched the web, and as many postgres documents as I can find, but I'm still unsure how to find the id of an inserted row when using postgres. I'm aware of: $sth-{'pg_oid_status'} but I'm not sure how to get from an OID to an insertid. It would just be really nice to be able to do something like: $sql = q[INSERT INTO foo (foofield1) VALUES (?)]; $sth = $dbh-prepare($sql); $sth-execute($barbaz); return $sth-{'pg_insertid'}; The only way I can think of doing this is to use something along these lines: ... $oid = $sth-{'pg_oid_status'} ($tablename) = ($sql =~ m{^insert\s+into\s+(.+?)\s+\(/}i); $sth = $dbh-prepare(SELECT id FROM $tablename WHERE oid = $oid); ... Which seems really groady, and prone to breakage. Can anyone offer some clues? -- Chisel Wright
Re: [scott@asofyet.org: xsubpp patch]
On Thu, Jun 12, 2003 at 03:44:08PM +0100, Joel Bernstein wrote: I'm hoping mutt will DTRT with forwarding the .patch attachment. Which, of course, it didn't. Attaching it now. I don't know if this will help when forwarding messages with attachments: ## === ## Forwarding attachments ## === message-hook . set mime_forward=ask-no message-hook ~h multipart set mime_forward=ask-yes Just bung it in your muttrc. -- e: [EMAIL PROTECTED] | They asked how many employees we had, w: www.herlpacker.co.uk | broken down by sex. Told them drugs gpg: D167E7FE | and alcohol was more of a problem.
s/$search/$replace/$parameters
I've been banging my head against a brick wall on and off over this one now. I inherited some code that contain the following statement inside two nested for loops: eval \$variable_hash-{'$variable'} =~ s/$search/$replace/$parameters;; I did some benchmarking, and profiling to confirm my suspicions that eval{} inside for(){for(){ ...}} is slow. I thought there must be another way. I found s/(?${parameter}:$search)/$replace/ This was working fine, until I found out that some instances of $replace contain $1. e.g. $search = q[(.+)]; $replace = q['$1']; $search seems to arrive at the function containing this as a qr'd regexp. In this instance $parameters was empty. In the code I'm fighting with $parameter is usually g or nothing. If I passed the value 16/07/2002 14:58:09 to the eval() version I would get: '16/07/2002 14:58:09' If I pass the value 16/07/2002 14:58:09 to the s///, I get: '$1' I'd really like to kill the eval() but don't know how to get $replace expanded in the s/// version. I've recently realised that you can't have s/(?g:$search)/$replace/ so I've tweaked my code to check for g in $parameters and do s///g or s/// accordingly. If anyone has any ideas/pointers/references/solutions I'd really like to hear, Chisel -- e: [EMAIL PROTECTED] | A. Top posters. Q. What is the most w: www.herlpacker.co.uk | annoying thing in e'mail? gpg: D167E7FE |
Re: yapi / photo organisers
On Mon, Feb 03, 2003 at 06:41:29PM +, Chris Heathcote wrote: Can anyone suggest an online web photo organiser, like yapi(2), but that doesn't require Template Toolkit and other shenanigans? I'm trying to install on my webspace at he.net, so no root stuff. Something that you can install somewhere locally and not just something that already exists and can upload pictures to [fotopic.net]? I don't know what yapi is, and there's nothing obvious from google. Chisel -- e: [EMAIL PROTECTED] | People replying to my sig annoy me. w: www.herlpacker.co.uk | That's why I change it all the time. gpg: D167E7FE |
Re: Mysql on soliaris
On Thu, Jan 30, 2003 at 04:25:55PM +, Tony Kennick wrote: mysql SELECT UNIX_TIMESTAMP('1970-01-01'); +--+ | UNIX_TIMESTAMP('1970-01-01') | +--+ |-3600 | +--+ 1 row in set (0.00 sec) Isn't epoch 1am or something like that? So you're asking for a timestamp one hour before epoch? -- e: [EMAIL PROTECTED] | One word geek test - pronounce the w: www.herlpacker.co.uk | word 'coax' gpg: D167E7FE |
Re: PGSQL - ALTER TABLE .. ALTER TABLE
On Tue, Jan 21, 2003 at 10:43:46AM +, Raf wrote: borg=# ALTER TABLE my_table ALTER COLUMN my_column DROP NOT NULL; ERROR: parser: parse error at or near NOT borg=# Any ideas? Is it just restricted to dropping defaults? What are you trying to do? Delete rows where my_column IS NULL? Or delete columns where my_column IS NULL? I'm not sure if the second makes any sense, but I haven't had today's wake-up drink yet. As I understand it you can set the default value for a column, or drop the default value for a column. DROP NOT NULL doesn't seem like a sensible thing to try to do... Chisel -- e: [EMAIL PROTECTED] | Theoretically, if I were to know your w: www.herlpacker.co.uk | password, what would it be? gpg: D167E7FE |
Re: Book: Best of the Perl Journal
On Wed, Nov 20, 2002 at 03:24:14PM +, Natalie S. Ford wrote: Sounds good to me! Neil and I live in Sussex, but Guildford is only 30 aol Sussex.pm? ;-) Chisel -- e: [EMAIL PROTECTED] | People replying to my sig annoy me. w: www.herlpacker.co.uk | That's why I change it all the time. gpg: D167E7FE |
Re: webmail
On Mon, Oct 28, 2002 at 02:49:59PM -0800, Randal L. Schwartz wrote: I wish people would stop discovering Mason and discover TT instead. I wish people would stop discovering TT and discover HTML::Template instead. Each to their own I guess. :-) Chisel -- e: [EMAIL PROTECTED] | Eagles may soar, but weasels don't get w: www.herlpacker.co.uk | sucked into jet engines. gpg: D167E7FE |
Re: webmail
On Tue, Oct 29, 2002 at 09:32:19AM +, Dave Cross wrote: Depends what you're doing I guess. At least half of what I do with templates has nothing at all to do with generating HTML so it makes no sense to use a templating system that is tied to producing HTML. I guess the name is misleading. I've used H::T for templating in general. I guess HTML was what it was originally intended to template, but it's not tied to it. (honestly not tryingto start a flamewar here) Personally I just had a yukky time with TT at work, so have an irrational dislike for it. Chisel -- e: [EMAIL PROTECTED] | Sackings will continue until morale w: www.herlpacker.co.uk | improves. gpg: D167E7FE |
Re: Viewing MS Word docs in email
On Wed, Oct 23, 2002 at 10:51:14AM +0100, Michael Stevens wrote: 3) Most of the negative properties of a Word document occur for the recipient, not me, and they *asked* to experience those negative properties. What about the negative property of having to (re)boot into windows, or find a windows box, type up your CV. Save. Then everytime you want to ammend your CV: reboot, edit, save, lather, rinse, repeat Although I do try to send out both Word and plain text when I get a feeling I'm dealing with more technical people. I aim to send mine in text or html. Michael Chisel (I don't have a cat :( ) I do. -- e: [EMAIL PROTECTED] | I am Dyslexic of Borg. Your arse will w: www.herlpacker.co.uk | be laminated. gpg: D167E7FE |
Re: OT: Help with SQL SELECT on Varchar from character 0..n
On Tue, Sep 17, 2002 at 09:34:08AM +, Rafiq Ismail (ADMIN) wrote: I'm using postgres and remember having done something ages ago with some operator in mysql, although it makes zero sense to me now as to how I did it the first time. What I want to do is have a select return a partial string from the ith character of a string to the jth character of a string. I'd like postgres to filter this partial string and return it to me. Not completed but do you mean something along the lines of: create table FOO ( content text ); insert into foo values ('I\'m using postgres and remember having done something ages ago with some'); insert into foo values ('operator in mysql, although it makes zero sense to me now as to how I did'); insert into foo values ('it the first time. What I want to do is have a select return a partial'); insert into foo values ('string from the ith character of a string to the jth character of a'); insert into foo values ('string. I\'d like postgres to filter this partial string and return it to'); insert into foo values ('me.'); select substring(content from 11 for 4) from FOO; and you'd like a where clause on the 4 characters? Chisel -- e: [EMAIL PROTECTED] | Stick with what you know and travel w: www.herlpacker.co.uk | light; if you only carry a hammer then gpg: D167E7FE | all problems are nails.
Re: OT: Help with SQL SELECT on Varchar from character 0..n
On Tue, Sep 17, 2002 at 11:04:53AM +, Rafiq Ismail (ADMIN) wrote: Kind of typical, it came back to me after posting. select substring(content from 11 for 4) from FOO; and you'd like a where clause on the 4 characters? thus : SELECT substr(content,11, 15) AS fish FROM FOO where fish='fish' That didn't work when I tried it: chisel=# select substring(content from 11 for 4) as fish from FOO where fish = 'post'; ERROR: Attribute 'fish' not found chisel=# select substring(content from 11 for 4) as fish from FOO where substring(content from 11 for 4) = 'post'; +--+ | fish | +--+ | post | +--+ (1 row) Chisel -- e: [EMAIL PROTECTED] | Buy 'em books, and they eat the w: www.herlpacker.co.uk | fscking covers. gpg: D167E7FE |