From lukecloss at gmail.com Fri Dec 4 00:04:48 2009 From: lukecloss at gmail.com (Luke Closs) Date: Fri, 4 Dec 2009 00:04:48 -0800 Subject: [Van-pm] Next Van.pm meetup: open data hackathon Message-ID: Hey folks, Konobi asked me to let everyone know that for our december meeting we're going to crash the Vancouver Open Data Hackathon next Wednesday at the City Archives: https://www.socialtext.net/vandata/index.cgi?open_data_hackathon_december_2009 There are lots of opportunities for projects that can directly help people here in Vancouver based on Open data and open government. Perl is such a great language for integrating with different feeds and I'd love to see lots of great tools written in Perl. There will probably be some people with ideas that need hackers, and some existing projects that could use help. I was thinking of working on a crowdsourced tool to analyze election campaign finance data, and I could use people interested in building some visualizations based on the APIs I'm making, and with improving the APIs. We should be back to a more traditional Van.pm meeting in the new year. Hope to see some of you at the hackathon, Luke -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukecloss at gmail.com Sun Dec 13 13:23:10 2009 From: lukecloss at gmail.com (Luke Closs) Date: Sun, 13 Dec 2009 13:23:10 -0800 Subject: [Van-pm] Super Happy Hacker House #5 Message-ID: (Apologies for the cross-posting) Hello hackers, Super Happy Hacker House #5 is almost upon us. Please consider joining us for another social hackathon this Friday (Dec 18th) at Van Hack Space. http://vancouver.hackspace.ca/doku.php?id=shhh_-_december_18_2009 The hackathon starts at 7pm and we'll again do late night lightning renegade talks around 11:30pm since they've been such a hit the past few times. Bring your projects and stay heads-down on some productive hacking, or come and socialize with other like-minded people, or do a bit of both. VHS still has lots of TV-B-Gone kits if you want to build one. Hope to see some of you on Friday. Cheers, Luke From telcodev at gmail.com Tue Dec 22 20:49:13 2009 From: telcodev at gmail.com (Joseph Werner) Date: Tue, 22 Dec 2009 20:49:13 -0800 Subject: [Van-pm] Strange code effect Message-ID: <4c93055f0912222049i329ae952s746ea69a9941f4f6@mail.gmail.com> Hey guys [and gals], I encountered a strange Perl code phenomenon dealing with some object references, and and array of object references. Specifically, I could not shift a reference to an object off of an array of object references. More troubling, I also was unable to use the object references in a boolean context. I have written code very similar to this dozens if not hundreds of times and never encountered this type of problem... The code is all proprietary, and the powers that be frown on release of any sort, so I will pseudo code what I am talking about. We are running Active State Perl 5.10 on a Win32 platform, if that matters my $some_parms = shift; my $objhref = get_objects($some_parms); # $objhref = { # '01' => bless( {}, 'ASpecialObject' ), # '03' => bless( {}, 'ASpecialObject' ), # '02' => bless( {}, 'ASpecialObject' ) # }; # ASpecialObject class does have the <=> overloaded # But I cannot see the making a difference... # Sorting works fine: my @arrayoforefs; eval { @arrayoforefs = sort { $a <=> $b } values %{$objhref}; } # Error checks ignored # Server dies silently at the following statement: my $chosenO = shift @arrayoforefs; # If I do this instead: my $chosenO = $arrayoforefs[0]; # Then this causes the server to silently crash: return unless $chosenO; __END__ Any help here? Thanks, Saltbreez From ted at psg.com Tue Dec 22 22:40:07 2009 From: ted at psg.com (Ted Powell) Date: Tue, 22 Dec 2009 22:40:07 -0800 Subject: [Van-pm] Strange code effect In-Reply-To: <4c93055f0912222049i329ae952s746ea69a9941f4f6@mail.gmail.com> References: <4c93055f0912222049i329ae952s746ea69a9941f4f6@mail.gmail.com> Message-ID: <20091223064007.GA5957@theplace.enposte.net> On Tue, Dec 22, 2009 at 08:49:13PM -0800, Joseph Werner wrote: > Hey guys [and gals], > > I encountered a strange Perl code phenomenon dealing with some object > references, and and array of object references. Specifically, I could > [...] > The code is all proprietary, and the powers that be frown on release > of any sort, so I will pseudo code what I am talking about. We are > [...] Sorry, my pseudo code debugger is in the shop. It's not especially likely that your problem is related to the proprietary aspects of your program. So you should be able to produce a small test program that compiles cleanly with Perl, contains no proprietary elements, and yet exhibits the same problem. In the course of doing that you may well solve the problem yourself, for example if the bug goes away between one stage of simplification and the next. Failing that, you will have something that the rest of us can use non-pseudo debugging tools upon. >From your description of the problem, the first thing I would want to try would be to run the program (or a test program that is known to fail on your system) on a different platform, but with only pseudo code I can't run it at all. -- Ted Powell http://psg.com/~ted/ This is *my* computer, not Microsoft's. From telcodev at gmail.com Wed Dec 23 14:21:12 2009 From: telcodev at gmail.com (Joseph Werner) Date: Wed, 23 Dec 2009 14:21:12 -0800 Subject: [Van-pm] SPUG: Strange code effect In-Reply-To: References: <4c93055f0912222049i329ae952s746ea69a9941f4f6@mail.gmail.com> Message-ID: <4c93055f0912231421g724d27e2w122de21787cc80e3@mail.gmail.com> Hey Ben, Thanks for the feedback! First, let me bring you up to current status. I attempted to construct, by building up to, the problem. This attempt failed to reproduce the central first issue: why was I unable to shift the object off of the array? However, it did answer the second question: The object failed to respond in a boolean context because one overloaded operator had been declared, but neither bool nor stringify had been declared. STRANGER still, fixing the second problem [bool overload] made the first [shift from array] problem disappear. I STILL cannot connect the two. Anyhow, problem solved, but the central question remains unanswered. No, we are not using Apache. Wish we were. I tread a tightrope of my nondisclosure commitments, but I can say: we use thin servers, what I have com to call 'campstove' servers [all the expectations of Apache in 2,000 lines of code or less] and due to the environment in which the server runs, either the crashes produce output to a log file, or we never see it. See additional comments below. On Wed, Dec 23, 2009 at 12:36 PM, BenRifkah Bergsten-Buret wrote: > See comments below. > > On Tue, Dec 22, 2009 at 8:49 PM, Joseph Werner wrote: >> >> Hey guys [and gals], >> >> I encountered a strange Perl code phenomenon dealing with some object >> references, and and array of object references. Specifically, I could >> not shift a reference to an object off of an array of object >> references. More troubling, I also was unable to use the object >> references in a boolean context. I have written code very similar to >> this dozens if not hundreds of times and never encountered this type >> of problem... >> >> The code is all proprietary, and the powers that be frown on release >> of any sort, so I will pseudo code what I am talking about. We are >> running Active State Perl 5.10 on a Win32 platform, if that matters >> >> my $some_parms = shift; >> my $objhref = get_objects($some_parms); >> # $objhref = { >> # '01' => bless( {}, 'ASpecialObject' ), >> # '03' => bless( {}, 'ASpecialObject' ), >> # '02' => bless( {}, 'ASpecialObject' ) >> # }; >> > > Have you tried assigning anything from $objhref directly at this point? For > example, do you get an error if you try to do $myobj = $objhref->{01}? Yes, the hash ref is fully loaded and performs these type of operations. > >> >> # ASpecialObject class does have the <=> overloaded >> # But I cannot see the making a difference... >> >> # Sorting works fine: >> >> my @arrayoforefs; >> eval { >> @arrayoforefs = sort { $a <=> $b } values %{$objhref}; >> } >> # Error checks ignored > > Since you've wrapped this in an eval it seems like you're expecting > exceptions to be thrown. Why ignore them? See if there is an exception > that might lead you in the right direction. My BAD. Ignoring exceptions was only pseudocode. In production, we do trap the exceptions. But it is a sunny day scenario [from the point of view of the evaled statement] that is producing the problem, so I omitted any checking to keep the waters clear. > > Also, are you able to access anything within @arrayoforefs without using an > assignment? For example what happens when you do warn "arrayofrefs[0]: > @arrayofrefs[0]"? Do the server crash? Not certian if what @arrayofrefs[0] is what you mean? A slice of one element? I will try and get back to you. > >> >> # Server dies silently at the following statement: >> >> my $chosenO = shift @arrayoforefs; >> >> # If I do this instead: >> >> my $chosenO = $arrayoforefs[0]; >> >> # Then this causes the server to silently crash: >> >> return unless $chosenO; > > You've said "server dies silently" and "silently crash" but I'm not clear > what you mean. Is this two different things or the same? By "crash" do you > mean that the server process exits with a core dump? Is this an Apache > server? Mod_perl? When perl "dies" it generates a message. Also, in my > experience when Apache dumps core it puts a message in the log but you've > said "silently" so perhaps something else is going on. Yes, silently. No core. Frustrating, nothing prints to the log at all, just the server is no longer running. > > My suggestion is to code up the simplest case you can where the problem is > encountered. Strip out as much code as possible that doesn't directly > relate to what you're doing. For example, the following script can be run > outside of your web server and outside of your Mason environment: Unfortunately my attempts to reproduce the array shift issue outside of the server have failed. Hey Thanks again for the feedback > > #!/usr/bin/perl > > use strict; > use warnings; > use lib "/my/code/path"; > use ASpecialObject; > > my $objects = { > 01 => ASpecialObject->new(), > 02 => ASpecialObject->new(), > }; > > my @sorted = sort {$a <=> $b} values %{$objects}; > > #Does this result in the same problems you're having? > my $chosen0 = shift @sorted; > print "If you see this then the script is done\n"; > __END__ > > You'll probably have to include some object initialization code but if you > still have problems with this then you know the problem is somewhere in > ASpecialObject.pm. Then you can start stripping out the code from there to > find the minimum amount of code that causes the problem. > > -- > Ben >