cosimo's Journal cosimo's use Perl Journal en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-01-25T02:27:27+00:00 pudge Technology hourly 1 1970-01-01T00:00+00:00 cosimo's Journal To all of you considering moving away from <p>Yes, we have a nice service that we host at <a href=""></a>.</p><p>This is my "random" blog, for example: <a href=""></a>.</p><p>There are many blogs better than mine, with lots of builtin custom designs. There's photo albums as well, and 1 Gb of file storage. See <a href="">here</a>, <a href="">here</a>, or <a href="">here</a>.</p><p>I hope you will like it. If it sucks for you, just drop me a note. We're continuously improving it.</p> cosimo 2009-05-20T06:02:00+00:00 journal IO::Socket and LWP::Simple for Perl 6 <p>There's a long way to go, the code is crappy, there's support for nothing but INET sockets, whatever you want, but...</p><p>the minimal skeleton versions of IO::Socket and LWP::Simple are working in Perl 6. This happened thanks to Jonathan Worthington, as usual, Carl Masak, Martin Berends and me, who wrote the crappy code.</p><p>So here's the final <code>lwp-get.p6</code>:</p><p> <code> #!/usr/bin/perl6<br> use LWP::Simple;<br> say LWP::Simple.get(''); </code> </p><p>This was one of our goals for the 2009 Oslo Perl6 Hackaton. We did it! There's a huge lot of work still to do, but one significant step is done! Work is underway for server socket support (accept, bind, etc...) and fully speccing the sockets classes.</p> cosimo 2009-04-18T20:08:21+00:00 perl6 Win32::API port to 64-bits <p>I've been the current maintainer of <a href="">Win32::API</a> for some years now.</p><p>I am proud to be working on such a useful module, at least for Windows people. I even managed once to build it under Linux/winegcc.</p><p>Lately, I've been receiving user requests about porting it to 64-bit architectures. While this is something I want to do, I might have some problems. Mainly, my lack of knowledge about porting 32-bit stuff to 64-bits under Windows.</p><p>Luckily, there seems to be available information and enough interested users that can provide help, code, hardware and/or licenses.</p><p>So, if you are in any way interested in helping out or staying tuned on the 64-bit port of Win32::API, please join the <a href="">libwin32 mailing list</a>. I'm going to post some more details there.</p> cosimo 2009-02-03T23:12:51+00:00 cpan PAUSE warning about world-writable files? <p>Today I uploaded a proof-of-concept CPAN distribution I'm going to work on in the next weeks. It's called <a href="">Imager-SkinDetector</a>.</p><p> The PAUSE upload finished, and to my surprise, I received an indexer <b>FAIL</b> status. What? Why? The reason is that the distribution contains <b>"world writable files"</b>. </p><p> Great. I'm probably the only one on Earth to not know, but... if you know some way to make them not writable on Windows, please tell me. Thanks! </p> cosimo 2008-09-27T19:41:26+00:00 cpan My scalability talk at the Italian Perl Workshop 2008 <p>If you're interested, and you missed the great <b>Italian Perl Workshop</b> last week in Pisa, you can take a look at the <a href="">talk I presented there</a>, about scalability of our main community site here at Opera Software, <a href=""></a>. </p><p>The level is probably basic for most of the readers here, and the presentation is not so "bullety" (someone is supposed to be speaking...<nobr> <wbr></nobr>:-), anyway, it's up on <a href="">Slideshare</a>, and I will put it up as a simple PDF file sometime in the near future.</p><p> Any feedback is welcome. Please consider it's my first talk ever. Ok, fire now...<nobr> <wbr></nobr>:-) </p> cosimo 2008-09-23T07:46:58+00:00 journal Italian Perl Workshop 2008 ended today In short, IPW2008 was a great success. I look forward to get some time to publish my talks (at least one of them) somewhere. It was also the first time I gave talks to a Perl conference. Very nice people and great organization! cosimo 2008-09-19T22:42:04+00:00 journal My YAPC::Europe 2008 in Copenaghen - Day 1 <p>My <b>first</b> YAPC actually. Well, it was awesome. </p><p>First of all, I saw Larry "live" for the first time. His talk was interesting to follow the status of Perl 6, but heavy for me, honestly. I didn't expect Larry to have that baritonal voice.<nobr> <wbr></nobr>:)</p><p>It was great to meet again in person some cool guys I met at the Oslo Hackaton the first time.</p><p> About the talks, I attended the first two about Parrot/Perl6, but I knew already most of the material. Then I attended 3 other awesome talks:</p><ul> <li> <a href="">Everything but the secret sauce</a> by Jesse Vincent</li><li> <a href=""></a> by Darko Obradovic</li><li> <a href="">Nothing can possibly go wrong (again)</a> by Adam Kennedy. This one was particularly inspiring to me, since I happen to be preparing my first talk for the Italian Perl Workshop 2008.</li> </ul><p> Looking forward to the 2nd day! </p> cosimo 2008-08-13T17:24:12+00:00 yapce HTTP::DAV circular references <a href=""></a> <p> It was a pain to debug and fix.<br> Hope it will be useful to others as well. </p> cosimo 2008-08-05T20:58:09+00:00 journal HTTP::DAV leaking memory? <p>Yesterday I started investigating an "interesting" problem in our shiny new "Storage abstraction layer".</p><p>It's a new set of classes designed to solve the problem of how to handle static resources like images, thumbnails, favicons,<nobr> <wbr></nobr>... providing fault-tolerance and distributing them automatically onto pools of static servers. Kind of our little own 'CDN'<nobr> <wbr></nobr>:) </p><p>Anyway, that is using <b>WebDAV</b> as one of the server "backends", and in fact, we're now using <code>mod_dav</code> enabled servers to distribute our content.</p><p>Now I'm in the process of exporting hundreds of thousands of pictures, in 5 different formats, with a single script to many DAV servers, I'm noticing a steady increase of memory usage. </p><p> I tried to track down the problem, and it seems to live within <code>HTTP::DAV</code>, where there's at least one circular reference between <code>HTTP::DAV::Resource</code> back to <code>HTTP::DAV</code> parent object. </p><p> I tried also to get some information out of Perlmonks, or web searching in general about this issue, but found nothing. </p><p> Any pointers or similar experiences? </p> cosimo 2008-07-29T09:25:53+00:00 cpan Win32::API source code repository and history <p>It required some trial and error on my part due to lack of experience using <code>svn_load_dirs</code>, but at last, we have it.</p><p>The full <code>Win32::API</code> source code history throughout all CPAN releases. Check it out, it's <a href="">hosted on google code</a>, together with all others Win32 specific modules.</p><p>Thanks to Jan for helping me out with this. And if you're wondering, I think it's time to "open up" the source code repository for <code>Win32::API</code>.<br>Lately I've been receiving lots of emails, requests for support, new implementations and bug reports for it.</p><p>Since I have less and less spare time, I think it's important that people that want or know how to contribute, do it. And do it on the "latest and greatest" version, with all recent bug fixes and/or new features.</p><p>Of course, a new version is currently in development. It should fix problems using DLL APIs with double or float arguments, together with other minor issues. I will need some more time to finalize these changes, and then hopefully I will release the new version on CPAN in a reasonable time.</p><p>So, <a href="">here it is</a>... Enjoy!</p> cosimo 2008-05-23T22:45:29+00:00 cpan YouTube Data API <p>Do any of you have some insights or experiences to share about using <b>YouTube Data API</b>? </p><p>It seems <code>WebService::YouTube</code> uses the older API, not the newer <code>GData</code> one. And although there's a <code>Net::Google::GData</code>, it doesn't work under Windows.</p><p> I have looked at <a href="">the youtube-g ruby package</a> and it seems pretty clean and straight-forward. </p><p> So question, before I write my own wheel, or consider patching <code>WebService::YouTube</code>, is there something I'm missing here?</p><p>Thanks!</p> cosimo 2008-05-22T21:25:49+00:00 journal Regarding file locking... <p>This should have gone out as a reply to AdamK, but doesn't want to collaborate. Sorry Adam.</p><p>For sure, if there's one thing that's a <b>pain</b> is file locking. I have no recommendations for you, but recently for $work, <b>I wrote a class</b> for general file locking, not just a script (yes, I know, don't tell me).</p><p>For about 6-7 years I've been using <code>Fcntl</code> and <code>flock</code> without problems, but now it's different. I need to gracefully handle file locking <b>even on NFS volumes</b> and with many concurrent hosts that write on the same nfs share.</p><p>And yes, it's crazy. And no, <code>File::NFSLock</code> doesn't work for me. <code>LockFile::Simple</code> does, but needs to be tweaked, hence my class that extends and "fix" it...<nobr> <wbr></nobr>:)</p><p>Me too: any recommendations?</p> cosimo 2008-05-22T21:20:59+00:00 journal I'm not sure I understand SQL... <p>Can any good souls out there explain to me <b>why</b> this SQL query actually works? And no, it doesn't matter what it does... I already know that<nobr> <wbr></nobr>:) </p><blockquote><div><p> <tt>&nbsp; &nbsp; SELECT concept, count(*) AS cnt, c.rtype<br>&nbsp; &nbsp; &nbsp; FROM concepts JOIN conceptbindings AS c<br>&nbsp; &nbsp; &nbsp; &nbsp; ON (c.conceptid =<br>&nbsp; GROUP BY concept<br>&nbsp; ORDER BY cnt DESC<br>&nbsp; &nbsp; &nbsp;LIMIT 0,100;</tt></p></div> </blockquote><p> If there's some explanation which I missed entirely (and that's possible), good.<br> If there's not, can you guess the DBMS ?<nobr> <wbr></nobr>:) </p> cosimo 2008-05-07T08:30:38+00:00 journal My Oslo QA Hackaton - Day 2 (in progress...) <p>This morning, after the coffee-powered briefing, I bugged David about <code>CPAN::Shell</code>. David patiently explained to me the thing. Thanks Dave! Then I went to bug Adrian about <code>Test::Class::Load</code>. After a short chat, I decided to hack on <code>Test::Class::Load</code>, originally by Ovid,<nobr> <wbr></nobr>:-), to make it subclassable and to allow custom filtering of underlying files to be loaded.</p><p>This is something I'd have liked to work on for some time, and we actually need this at $work.</p><p>Some hours later, I had put together a patch for Test::Class 0.28, which will hopefully become 0.29. Let's see...<nobr> <wbr></nobr>:-)</p> cosimo 2008-04-06T12:23:56+00:00 journal My Oslo QA Hackaton - Day 1 <p>What can I say? I'm really happy I came here. Linpro's offices, the venue for the hackaton, are really at 5 minutes cycling distance from my house...<nobr> <wbr></nobr>:-)</p><p> Lots of cool people and interesting discussions. ADAMK, MarkOv, Andy Armstrong, DOMM, Ovid, Marcus, Merijn, the FreeBSD guys, Schwern, brian d foy, DAGOLDEN, Jonathan Worthington... Need to say more? </p><p> I even bugged JW to teach me something about Perl6 parser and actions...<br> Thanks to Marcus and Andy, there's also a nice <a href="">Flickr photo collection</a>... </p><p>Sadly I have to leave now, but I hope to get around here some time tomorrow...</p><p> Anyway, I haven't really understood if I should stick with EU::MM, or go for Module::Build, or even Module::Install...<nobr> <wbr></nobr>:-)</p> cosimo 2008-04-05T15:39:19+00:00 journal Let's see if I get it right this time... <p>Yes, I published an updated version of <code>Win32::API</code>, tagged <code>v0.54</code> which should solve the OS check and META.yml problems, preserving the "os unsupported" CPAN testers check.</p><p>Let's see if I got it right this time, without screwing up again...<nobr> <wbr></nobr>:-)</p> cosimo 2008-03-03T22:46:35+00:00 cpan Win32::API v0.53 released to CPAN <p>I just released version <b>0.53</b> of Win32::API. It should be available at your local CPAN mirror very soon.</p><p>This version should play nicer with CPAN testers, since it checks if the OS makes sense before going through <code>Makefile.PL</code>, so no more failures with Solaris, Linux, FreeBSD, and such are expected.</p><p>Please note that I published 0.51 one hour ago, but it's broken, so I have already scheduled its deletion. Please <b>don't use</b> 0.51.</p><p>Enjoy and please report to me any problems you have.</p><p> <b>UPDATE</b>: it seems that I screwed up again the <code>META.yml</code> and the dist resulted as UNauthorized because of my inclusion of <code>Devel::AssertOS</code>. Oh well...</p><p>. </p><p> For the real list of changes, look at CPAN's Changes file.</p><p>0.52-0.53: </p><ul> <li>Devel::AssertOS was not properly set up in 0.51.</li> </ul><p>0.51: </p><ul> <li>Cleaned up pod docs and clearly stated Win32::API license</li> <li>Fixed $$/pid tests for Cygwin</li> <li>Now uses Devel::AssertOS to check that we are on a Win32 or Cygwin system. This should ease the work of CPAN testers.</li> </ul> cosimo 2008-03-02T00:29:15+00:00 cpan Win32::API v0.48 adds cdecl function call support <p>As you probably know, I have been struggling to get Win32::API to work on Vista with various MSVC++ and GCC compilers.</p><p>Since many have asked for it, and some brave soul had an <b>old</b> patch available on the net, I decided to give it a shot.<br> I had already tried 2 or 3 times to get this patch (originally for v0.41) integrated in the new Win32::API versions, but always failed at it.</p><p>Today I decided to take the full journey, and seems I succeeded. Probably I broke something else...<nobr> <wbr></nobr>:-)<br> Please bare with me. Anyway, I have 2 things left in this release that I want to address in the new one:</p><ul> <li>There's a Borland C macro def that is completely broken (thanks to BrowserUk for noticing)</li> <li>I need to complete the stack cleanup assembler code at the end of Call() function in the XS code. This <b>should</b> be easy, for some definition of <b>"easy"</b>, since I already have some examples of MSVC/GCC assembler code in my RT queue.</li> </ul><p>In the meanwhile, if you notice something wrong with your OS/Perl/compiler, please mail me or fill in your bug report in RT. Thanks! </p> cosimo 2008-02-20T21:37:06+00:00 cpan Windows Vista compile of Win32::API with MinGW &amp; MSVC++ <p>On my main PC used to develop CPAN work on Windows I had installed MSVC6, cygwin and strawberry/vanilla Perl.</p><p>At the start of November I had to switch to a new laptop with (arghh...) Vista. Then I installed MSVC++ 2005 and 2008, the free editions. And I installed also the Windows Server 2003 Platform SDK, which I thought was the SDK to go with.</p><p>Last week Vista ended up filling all its allocated disk space, and I decided to dump all MSVC &amp; SDK installations plus other stuff to DVDs.</p><p>Then I reinstalled the compilers and the Microsoft Windows Vista SDK but since then I never got to compile anything again. The error messages are like the following:</p><p> <code> gcc -c -I"\Program files\Microsoft SDKs\Windows\V6.0\Include" -I"\Program files\ Microsoft SDKs\Windows\V6.0\VC\include" -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_ READFIX -s -O2 -DVERSION=\"0.47\" -DXS_VERSION=\"0.47\" "-IC:\strawberry\ perl\lib\CORE" Callback.c<br> In file included from<nobr> <wbr></nobr>/Program files/Microsoft SDKs/Windows/V6.0/Include/winnt.h<nobr> <wbr></nobr>:105,<br> from<nobr> <wbr></nobr>/Program files/Microsoft SDKs/Windows/V6.0/Include/windef. h:177,<br> from<nobr> <wbr></nobr>/Program files/Microsoft SDKs/Windows/V6.0/Include/windows<nobr> <wbr></nobr>.h:155,<br> from Callback.xs:17:<nobr> <wbr></nobr>/Program files/Microsoft SDKs/Windows/V6.0/Include/basetsd.h:81: error: syntax e rror before "INT64"<br><nobr> <wbr></nobr>/Program files/Microsoft SDKs/Windows/V6.0/Include/basetsd.h:81: warning: data d efinition has no type or storage class<br><nobr> <wbr></nobr>/Program files/Microsoft SDKs/Windows/V6.0/Include/basetsd.h:85: error: syntax e rror before "UINT64"<br><nobr> <wbr></nobr>/Program files/Microsoft SDKs/Windows/V6.0/Include/basetsd.h:85: warning: data d efinition has no type or storage class<br><nobr> <wbr></nobr>/Program files/Microsoft SDKs/Windows/V6.0/Include/basetsd.h: In function `PtrTo Ptr64':<br><nobr> <wbr></nobr>/Program files/Microsoft SDKs/Windows/V6.0/Include/basetsd.h:363: error: syntax error before "__int64"<br><nobr> <wbr></nobr>... </code> </p><p> They seem to be related to this <code>basetsd.h</code> header file and the <code>INT64</code> typedefs. </p><p> Now I don't know if the Vista SDK is screwed up, and I'd better revert to the <b>Win 2003 Server SDK</b>, or I did something else which screwed up everything... </p><p> What the _______ is going on here? Anyone has experiences with Perl gcc/MSVC compiles on Vista? </p><p>Anyway, I remember having correctly compiled <code>perl-5.10</code>, <code>parrot</code> and <code>Win32::API</code> with MSVC2005 and 2008 with W2003 Platform SDK. I will try to revert back to that and retry everything from scratch. </p><p> I promise I will write a step-by-step walk-through if everything works in the end.<br> BTW, I'm also working on patching <code>ExtUtils::MakeMaker</code> to correctly detect the <code>PASTHRU_INC</code> Makefile variable (there's already a ticket on RT about that). </p> cosimo 2007-12-28T22:49:23+00:00 windows Fortune file about 24's Jack Bauer <p>... and I finally managed to assemble a fortune file about Jack Bauer facts.</p><p> I looked at some websites that carry a lot of facts about Jack, like <a href=""></a>, or <a href=""></a>... </p><p> Of course, this was done with a Perl script. The good guys among you<nobr> <wbr></nobr>:-) already know that that very script is included in the shiny new pointless CPAN distribution named <a href="">Acme::24</a>. </p><p> <a href="">Here it is!</a> <br> You should generate also the ".dat" file to use with fortune program. The command is: </p><p> <code>strfile -r jackbauer</code> </p><p> This generates a "jackbauer.dat" file that should be copied into your "/usr/share/fortune" (or whatever) folder. Enjoy! </p> cosimo 2007-08-28T19:31:45+00:00 journal Math related material <p> I'd like to share with you that I found this website about interesting <b>math-related</b> lessons (or should I say lectures): </p><p> <a href=""></a> </p><p> I received a mail from the author of the site. At first I thought it was something like spam, but then I looked at it, and it seems pretty good! </p><p> I always wanted something like that, even if there's the Wikipedia...<nobr> <wbr></nobr>:-) </p> cosimo 2007-07-14T19:50:11+00:00 journal Running Win32::API on Linux <p> Probably you already know that <a href="">I</a> <a href="">took the mantainership</a> of <a href="">Win32::API</a> module and I'm <a href="">working</a> to make it build and test painlessly under the many platforms, compilers, makes under Win32. </p><p> But, wait... </p><p> Wouldn't it be cool to install and use Win32::API and all Windows dynamic libraries on, say, <b>Linux</b> ? </p><p> I started experimenting with <a href="">wine</a> and its <b>winegcc</b> wrapper.<br> The fun thing is that I actually <b>managed to successfully build</b> Win32::API's <code></code> on my Linux box with some not so dirty hacks. </p><p> However, there's something wrong when running the tests, as it segfaults badly.<br> I should try and build a debugging perl, so as to take stack traces and/or debug what is happening... </p><p> Isn't it cool?<br> Do you think it's doable?<nobr> <wbr></nobr>:-) </p> cosimo 2006-12-29T21:36:07+00:00 modules Win32::API install from CPAN shell <p> The latest version of <a href="">Win32::API</a>, <b>marked v0.46</b>, should now correctly install even from the CPAN shell. Finally! </p><p> There is a fair amount of work behind, but now it should build, test and install cleanly on all major platform and compiler combinations.<br> In short, the build of <code>API_test.dll</code> is now gone. In the 0.46 package there's a pre-built library compiled with MSVC 6, that happens to work smoothly when loaded by any Win32::API flavour. The test suite is now simpler and takes compiler/environment differences into account. </p><p> I directly tested it on: </p><ul> <li>Source-compiled perl 5.8.8 + MSVC 6 + nmake</li> <li>Source-compiled perl 5.8.8 + MSVC 2003 (Free toolkit) + nmake</li> <li>Strawberry perl + MinGW GCC + GNU make</li> <li>Strawberry perl + MinGW GCC + dmake</li> <li>Cygwin perl + gcc + GNU make</li> </ul><p> Obviously there are lots of problems and improvements possible: </p><ul> <li>For example, it'd be great to investigate why gcc built the (now gone) test dll <b>without</b> all kernel32.lib imports...</li> <li>Also, why functions with double or float return values always segfault when called.</li> <li>And last but not least, <b>callback</b> interface works fully only under MSVC 6.</li> </ul><p> I don't know now when I'll find the time to go on with this work, but for now, <b>have fun</b>! </p> cosimo 2006-12-23T17:53:00+00:00 cpan Win32::API latest news <p> After <a href="">taking the maintainership of Win32::API</a>, I have been busy trying to build several useful environments to be able to test the module. These test envs include combinations of: </p><ol> <li>Flavour: <a href="">Vanilla</a>, <a href="">Strawberry</a>, bleadperl</li> <li>Compiler: Gcc/MinGW, msvc6, msvc2003, borland?</li> <li>Make: nmake, dmake, GNU make</li> </ol><p> If we also consider that <b>cygwin</b> is entirely another story, this is definitely <b>a great mess</b>, at least for me: I'm not a Win32 development genius...<nobr> <wbr></nobr>:-) </p><p> <a href="">Latest version distributed on CPAN, marked v0.45</a>, should build and install (but <b>not</b> test) cleanly on at least VC6 and gcc/MinGW. Test suite is not yet ready to be enough "cross-platform" as we all want. </p><p> I'm now working on that, and on cygwin environment integration. I already applied some cygwin-related patches dated 2002 or so, but there are problems with msvc2003 Makefiles compatibility and <code>API_test.dll</code> building in the test suite... </p> cosimo 2006-12-06T22:29:38+00:00 modules Taking over Win32::API maintainership <p>I'm in the process of taking over the maintainance of Win32::API module from Aldo Calpini, the original author. </p><p> I'm collecting patches, related web pages and information as I'd like to make Win32::API work with the current VanillaPerl/Mingw environment. </p><p> I also updated <a href=""> Wiki</a> to announce this. </p><p> So, anyone interested in getting your patches, suggestions, rants,<nobr> <wbr></nobr>... please get onboard now and communicate with me. If you already have your bug reports filed on <a href=""></a>, be sure I'm working on those (if I ever get to manage all of these bugs;-D )... </p><p> Thanks for your attention. </p> cosimo 2006-11-15T18:29:27+00:00 modules